iOS get info.plist value

App中需要取得info.plist內容可使用下面這方式
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"PLIST_KEY_STRING"];

sample: App顯示名稱
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];

MACOS Fix Duplicate or Old Items on "Open With" Menu

Mac上常常會有看到在"open with"列表中相當東重複或舊的應用程式,下圖為正常狀況,但是常會有很多相同的應用程式混於其中,以下只需要兩個步驟解決此問題。


Step 1. 打開終端機,然後輸入以下這串指令
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/\
LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local\
-domain system -domain user

Step 2. 重新啟動Finder(Command+option+esc),點選重新啟動Finder


完成後就可以體驗乾乾淨淨的open with menu了~

iOS simulator memory warning on device


平常在simulator上可以使用從"Hardware -> Simulator Memory Warning",Device上可以使用以下這串code來模擬

[[UIApplication sharedApplication] performSelector:@selector(_performMemoryWarning)];

iOS _OBJC_CLASS_$_CALAYER error

一般開發中應該比較不會遇上這問題,應該是在copy別的code使用時比較會遇上...或者寫的很順就忘記去import framework
_OBJC_CLASS_$_CALAYER

解決方式只要把"QuartzCore.framework"加入即可

Nodejs file upload

在server端需要加入,主要為上傳到暫存資料夾,然後刪除再將檔案移動至想要的資料夾中


html使用form方式加入,使用bootstrap的CSS將畫面美化


相關連結
Twitter Bootstrap
Nodejs