2011年6月28日

數位閱讀軟體開發雜談

一些閱讀開發的淺談,本來寫一寫想投稿試試的,結果一直忘了寄出去,有些東西不貼就要過期了,只好貼這邊吧。

2011年6月23日

In-app purchase和server測試的注意事項

之前有用到就整理起來,主要針對開始撰寫程式前需要的準備事項
改天再針對程式方面發一篇
整個過程,主要可以分成三種角色:Apple、商品提供者、程式開發者
下面列一下各個方面的一些注意事項:

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.)
想說這下是見鬼了,查了一堆文件也沒找到解答,其他裝置好像也沒災情
解不掉就只好暫時丟著不管