iOS App 開發(fā)問題匯總

1.Ad Hoc分發(fā)應(yīng)用

導(dǎo)出Ad Hoc授權(quán)應(yīng)用 Xcode > Product > Archive > Export

安裝Ad Hoc分發(fā)的應(yīng)用 Open iTunes > File > Add To Library… > select Ad Hoc provisioning profile and App.ipa > Sync

2.Xcode編譯出現(xiàn)如下警告提示:

[WARN]warning: no rule to process file xxx.h’ of type sourcecode.c.h for architecture armv7

解決辦法:這是因?yàn)闄z查到有.h文件在編譯列表中了。所以只要在列表中去掉就可以了。

點(diǎn)擊你的xcode項(xiàng)目文件,然后點(diǎn)擊[Build Phases],確保在[Compile Sources]中沒有.h文件。

Reference:Xcode編譯提示:warning: no rule to process file ‘xxx.h’ of type sourcecode.c.h for architecture armv7

3.ld: warning: directory not found for option ‘-L/Users/dongmeiliang/Documents/soh.client.iOS/sohiOSApp/sohiOSApp/Component/BaiduMap_IOSSDK_v2-2/Release-iphonesimulator’

Undefined symbols for architecture x86_64: “DDExtractFileNameWithoutExtension”, referenced from:?57-[AJSocketBinaryClientChannel setupReadTimerWithTimeout:]block_invoke76 in libPods-sohiOSApp-AJFrame.iOS.a(AJSocketBinaryClientChannel.o) -[AJSocketBinaryClientChannel doReadTimeout] in libPods-sohiOSApp-AJFrame.iOS.a(AJSocketBinaryClientChannel.o) -[AJSocketBinaryClientChannel endCurrentRead] in libPods-sohiOSApp-AJFrame.iOS.a(AJSocketBinaryClientChannel.o) “OBJC_CLASS$DDLog”, referenced from: objc-class-ref in libPods-sohiOSApp-AJFrame.iOS.a(AJSocketBinaryClientChannel.o) “OBJC_CLASS$_GCDAsyncSocket”, referenced from: objc-class-ref in libPods-sohiOSApp-AJFrame.iOS.a(AJTcpConnector.o) ld: symbol(s) not found for architecture x86_64

解決辦法:從輸出的日志可以看出問題是出在鏈接,由Cocoapods管理的第三方庫(kù)安裝后鏈接配置項(xiàng)沒有設(shè)置正確,需要手動(dòng)設(shè)置沒有被自動(dòng)鏈接的庫(kù),例如這里我需要鏈接:-l"Pods-CocoaAsyncSocket"。

4.dyld: could not load inserted library ‘/usr/lib/libgmalloc.dylib’ because image not found

解決辦法:Edit Scheme > Run > Diagnostics > Memory Managerment

Malloc uncheck Enable Scribble

uncheck Enable Guard Edges

uncheck Enable Guard Malloc

Reference:xcode : could not load inserted library: /usr/lib/libgmalloc.dylib 的解決

5.APNs服務(wù)器地址

答案: gateway.push.apple.com 2195 (Product)

gateway.sandbox.push.apple.com 2195 (Development)

6./Users/user/XCodeWork/iPhoneDev/MyAppSourceFolder/en.lproj/MainWindow-iPhone.xib:

Compilation failed. Unable to write to path:??

/Users/user/Library/Developer/Xcode/DerivedData/MYAPPNAME- dudnhxzgpqtcnqcgaguirvkhmvco/Build/Intermediates/ArchiveIntermediates/ MYAPPNAME/InstallationBuildProductsLocation/Applications/MyAppname.app/ en.lproj/MainWindow-iPhone.nib

解決辦法:For every xib’s that we’ve problems, in the right panel go to the first tab, “Interface Builder Document” -> “Builds for” and select “iOS 7.0 and Later”. My old configuration was “iOS 4.3 and Later”.

Reference:Interface Builder XIB Error - Unable to write to path

7.duplicate symbol?OBJC_METACLASS$_SDWebImagePrefetcher in:

/Users/dongmeiliang/Library/Developer/Xcode/DerivedData/jiaxiaotong-dxrmnnwbexugoqfekesgvdiijcdm/Build/Products/Debug-iphonesimulator/libPods-weima-SDWebImage.a(SDWebImagePrefetcher.o)

/Users/dongmeiliang/Library/Developer/Xcode/DerivedData/jiaxiaotong-dxrmnnwbexugoqfekesgvdiijcdm/Build/Products/Debug-iphonesimulator/libPods-SDWebImage.a(SDWebImagePrefetcher.o)

ld: 727 duplicate symbols for architecture x86_64

解決辦法:?jiǎn)栴}出現(xiàn)的原因是我用CocoaPods管理第三方庫(kù),在Build Settings > Linking > Other Linker Flags 里面即顯示指定了-l"Pods-SDWebImagePrefetcher",又設(shè)置了變量$(inherited)。我去掉$(inherited)就好。

8.2015-04-05 22:35:26.917 weima[67059:2338954] NSScanner: nil string argument

2015-04-05 22:35:26.917 weima[67059:2338954] NSScanner: nil string argument libc++abi.dylib: terminate_handler unexpectedly threw an exception

9.Cannot send push notifications using Javapns/Javaapns SSL handshake failure

解決辦法:

123456developer_identity.cer <= download from Apple (aps cert)mykey.p12 <= Your private key (CSR generate private key or install aps cert get a private key both ok)openssl x509 -in developer_identity.cer -inform DER -out developer_identity.pem -outform PEMopenssl pkcs12 -nocerts -in mykey.p12 -out mykey.pemopenssl pkcs12 -export -inkey mykey.pem -in developer_identity.pem -out iphone_dev.p12

Reference:Cannot send push notifications using Javapns/Javaapns SSL handshake failure

10.導(dǎo)航欄如何顯示兩行文本?

解決辦法:After setting up your titleView or titleLabel, call sizeToFit on it, also make sure titleLabel.textAlignment = UITextAlignmentCenter. It’ll be centered in the width of the navbar rather than in the space between the button edge and far edge of navbar.

Reference:Adjusting navigationItem.titleView’s frame?

11.SVN how to resolve “l(fā)ocal unversioned, incoming add upon update”

12345$ svn statusD? ? C logs? ? ? >? local unversioned, incoming add upon updateSummary of conflicts:? Tree conflicts: 1

解決辦法:

12345$ svn resolve --accept working logsResolved conflicted state of 'logs'$ svn revert logsReverted 'logs'$ svn status

Reference:Resolve Tree Conflict SVN (local unversioned, incoming add upon update)

12.Calling a C function from within a function in a .mm file

解決辦法:The .mm file is looking to call a mangled version of the function name. You need either?BEGIN_DECLS and?END_DECLS around the C function declarations seen by the C++-compiled file, or you need to do the equivalent yourself. The idea is to mark those function declarations as extern “C” when seen by an (Obj-)C++ compiler, but not when seen by any other sort of compiler.

Referenc:Calling a C function from within a function in a .mm file

13.Compilation failed. Unable to write to path

1234567891011Underlying Errors:? ? Description: The file “objects.nib” doesn’t exist.? ? Failure Reason: The file doesn’t exist.? ? Underlying Errors:? ? ? ? Description: The operation couldn’t be completed. No such file or directory? ? ? ? Failure Reason: No such file or directory? ? Description: “DMLUserElementCell~iphone.nib” couldn’t be removed.? ? Failure Reason: The file doesn’t exist.? ? Underlying Errors:? ? ? ? Description: The operation couldn’t be completed. No such file or directory? ? ? ? Failure Reason: No such file or directory

解決辦法:在Target > Build Phases > Compile Sources里去掉出錯(cuò)的nib文件。

Reference:Xcode 5 storyboard compile failure

14.Where iPhoto Pictures are Located and How to Access the iPhoto Library and Picture Files

解決辦法:iPhoto 11 (9.0) Photo Library Storage Location:~/Pictures/iPhoto Library.photolibrary/Masters/

Reference:Where iPhoto Pictures are Located and How to Access the iPhoto Library and Picture Files

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Tutorials Videos Podcast Forums Store LOGIN / SIGN UPBECO...
    0x4d4746h閱讀 732評(píng)論 0 1
  • mean to add the formatted="false" attribute?.[ 46% 47325/...
    ProZoom閱讀 3,229評(píng)論 0 3
  • Introduction What is Bowtie 2? Bowtie 2 is an ultrafast a...
    wzz閱讀 6,261評(píng)論 0 5
  • 日更日日更。無意間發(fā)現(xiàn)簡(jiǎn)書,毅然從線下走到線上,對(duì)自己算是一種督促和鞭策吧,不求脫胎換骨,但求日日進(jìn)步。
    歡喜著喜歡的閱讀 499評(píng)論 1 2
  • 白發(fā)簪花君莫笑 歲月從不敗美人 改自兄長(zhǎng)的隨筆,原文為“白發(fā)戴花君莫笑,歲月從不敗美人”。本人在此私自將“...
    想笑就笑了閱讀 332評(píng)論 0 1

友情鏈接更多精彩內(nèi)容