顯示具有 xcode 標籤的文章。 顯示所有文章
顯示具有 xcode 標籤的文章。 顯示所有文章

2012年4月27日

X Code@Lion三指切換header/source(.h/.m)的方法

雖然Lion都出這麼久了,不過應該還是可以寫一下
剛從雪豹升級到Lion,發現三指向上的手勢被換成切桌面,看code實在很不方便,就google一下
在stackoverflow看到這篇:
http://stackoverflow.com/questions/6771057/trackpad-gesture-to-switch-to-header-source/7923619#7923619
文中說Xcode 4.2有修正,不過我的4.3還是不能切,照著下面做了
1.切到要修改的檔案的所在目錄開終端機,輸入:cd /Users/[使用者名稱]/Library/Preferences/ByHost
2.用ls -lah找出要修改的檔案
應該會找到一個.GlobalPreferences.XXXX-XXXX-XXXX-XXXX.plist,X由一串英文數字組成
3.用Xcode開啟該檔案(或用vim直接編輯該檔也可以)
open -a /Developer/Applications/Xcode.app ".GlobalPreferences.XXXX-XXXX-XXXX-XXXX.plist"
4.把com.apple.trackpad.threeFingerVertSwipeGesture改成1,並存檔
5.重開機(沒開機前好像還是不會成功)

2011年6月17日

iOS App開啟載入的圖片(launch image)

如何替iOS App加入一個啟動時的載入圖片?
只要把圖片存成下列檔名後,加入專案中即可:
Default.png      320*480 iPhone, iPod
Default@2x.png 640*960 iPhone, iPod Retina Display
Default.png iPad Portriat
Default-Portrait.png      768*1004 iPad Portrait
Default-Landscape.png  1004*768  iPad Landscape

在xcode 4開始更簡單,只要在project或target裡Summary->Launch Images右鍵就可以直接加了
以為很麻煩的功能,其實出乎意料的簡單,記一下

2011年6月13日

iOS 5 beta SDK touble shooting

如果有用到libz.1.2.3.dylib這個framework(例如ASIHTTP)
iOS SDK升級到5 beta會遇到下列錯誤:
ld: library not found for -lz.1.2.3
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
或是用了ASIHTTP:

2011年5月17日

iOS keychainWrapper trouble shooting

之前把一個project用官方提供的Keychain Services加上了自動記憶帳號密碼的功能
一直都正常運作,直到某一天一台裝置忽然跑出了不該出現的assert:
NSAssert(SecItemAdd((CFDictionaryRef)
[self dictionaryToSecItemFormat:keychainData],NULL) == noErr, @"Couldn't add the Keychain Item." );

當機,帳號密碼存不起來
想說嘗試著要把舊的刪掉加新的看看:
SecItemDelete((CFDictionaryRef)[self dictionaryToSecItemFormat:keychainData]));
結果錯誤訊息是-25300(errSecItemNotFound, The item cannot be found.)
然後試了:
SecItemAdd((CFDictionaryRef)[self dictionaryToSecItemFormat:keychainData],NULL));
得到-25299(errSecDuplicateItem, The item already exists.)
想說這下是見鬼了,查了一堆文件也沒找到解答,其他裝置好像也沒災情
解不掉就只好暫時丟著不管