1. 程式人生 > >ios開發過程中碰到的嚴重bug,修復…

ios開發過程中碰到的嚴重bug,修復…

蘋果管網開發工具和系統下載地址:https://developer.apple.com/downloads/index.action

1.上傳appstore,私有api的使用導致驗證通不過,報:_terminateWithStatus 私有api被拒絕

解決辦法:使用終端,cd
在編譯聲稱的.app檔案拖入,在使用 strings appName | grep'terminateWithStatus' 即可找到私有方法
刪掉GHUnit.framwork 再執行上述命定,發現不出現該方法,說明成功了 
cd/Users/fenda/Library/Developer/Xcode/DerivedData/
appName-fixozdyebqcgohdxqigmmootkzuy/Build/Products/Debug-iphoneos/
appName.app
pool-100-0-0-56:
appName.app xx$ strings ColorBand | grep'terminateWithStatus'
_
terminateWithStatus:
pool-100-0-0-56:appName.app xx$ 

cd/Users/fenda/Library/Developer/Xcode/DerivedData/
appName-fixozdyebqcgohdxqigmmootkzuy/Build/Products/Debug-iphoneos/appName.app
pool-100-0-0-56:
appName.app xx$ strings ColorBand | grep'terminateWithStatus'
pool-100-0-0-56:
appName.app xx$ (_terminateWithStatus:方法不存在了)


  1. No architectures tocompilefor(ONLY_ACTIVE_ARCH=YES   

      這種錯誤   修改building settings下 Build Active Architecture only 為NO即可。
  2. dyld: Symbol not found:_objc_setProperty_nonatomic    

     _objc_setProperty_nonatomic是ios6.0的新方法,三方庫設定了Deployment Target為6.0就會呼叫這2個新增的方法,為ios5中沒有,我們的專案是支援ios5的。所以報錯。把lib的target設定為5.0之後,沒有這個錯誤了

          如果你在使用新浪sdk,使用了libWeiboSDK_X64的庫,如果在5.x上執行,也會報這個錯,猜測這個版本的庫時6.x以下的。換成那個不帶_X64的庫,沒有問題。

  1. 在使用百度統計是,如果出現類似錯誤

    在buildPhases 下新增coreTelephoney.framework即可

    這個問題,花費了我2天的時間才找到,總以為是自制的靜態庫的問題。

  2. no provisioning profile at path'/Users/user/Library/MobileDevice/ProvisioningProfiles/XXXXX.XXX
     當報這種錯誤時,工程證書不正確,修改build setting下 的ProvisioningProfile為正確的的專案證書即可
  3. malformed or corrupted AST file:iosXXX,類似的錯誤時,時xcode編譯器的問題,清理下/Library/Developer/Xcode/DerivedData下的資料
    即可。
  4. Assertion failure in -[UISectionRowDatarefreshWithSection:tableView:tableViewRowData:],/SourceCache/UIKit_Sim/UIKit-2903.23/UITableViewRowData.m:578

    libc++abi.dylib: terminate_handler unexpectedly threw anexception

    這個錯誤的原因是在計算tableview的高度是出錯,

    對現實的圖片UIImage計算高度,但是此時image為nil,做了200/image.size.height這個操作

    導致height += 200/image.size.height,這個計算後,height為NaN,之後報這個錯誤,

    keychain錯誤:Terminating app due to uncaught exception'NSInternalInconsistencyException', reason: 'Couldn't add theKeychain Item.'

     KeyChain內部以kSecAttrAccount 與kSecAttrService作為唯一鑰匙串標識,


  5. 把XCode升級到6.2版本,IOS模擬器找不到了,找了半天,發現模擬器路徑變了,最終發現要自己手動增加模擬器,用快捷鍵“Shift+Cmd+2“,開啟DEVICES管理介面,點左下角的“+”號,選擇建立一個新的模擬器,最後點選“Create”。重啟xcode,即OK。操作了一下,確實如此。再開啟xcode就可以選擇了,不過ios8已經不支援iphone4了,最低也是4S,所以在選項裡看不到iphone4的模擬器了。
  6. The file “xxxxx” couldn’t be opened because you don’t havepermisios開發過程中碰到的嚴重bug,修復彙總Build Active ArchitectureOnly改為yes。 Project---Build Setting中 修改這一項,變成Default Compiler(AppleLLVM 6.0)
    圖片:FEB24309-350E-49AA-9193-9B09F7A478C6.png
  7. 聯調出現的大片警告在Build Settings -> other lingkr Flags 中新增-w 就可以解決了
持續更新中.................