天天看點

【ios開發】ios開發問題集錦

1、

ARC forbids explicit message send of'release'

'release' is unavailable: not available inautomatic reference counting mode

解決辦法:

打開目前工程,打開"Build Settings",找到Objective-C Automatic Reference Counting項,将它的值設定為NO。

再次編譯,就消除了這個錯誤了。

2、

ld: warning: ignoring file [Path/FileName.a], missing required architecture i386 in file [Path/FileName.a] (2 slices)

Undefined symbols for architecture i386:

"_OBJC_CLASS_$_HRMonitor", referenced from:

objc-class-ref in ViewController.o

ld: symbol(s) not found for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

解決方法:

This warning means that you're trying to use library made for Device (ARM) with your Simulator (i386).

You can use this terminal command to create a universal library:

More info about lipo command here (Mac Developer Library).

3、

Multiple errors occurred while copying the files.

解決方法:

如果往Xcode中添加多個圖檔時出現這個錯誤,那說明這不是你第一次做這種嘗試了,而第一次添加的時候,因為某張圖檔有重名現象,或者格式問題等原因,導緻第一次沒有添加成功,之後再添加多個圖檔的時候就會報這個錯誤,原因就是因為第一次的時候,部分圖檔沒有添加成功,但是大部分還是給添加到項目裡,但是你在 Xcode上是看不到的,是以直接導緻添加失敗,解決的辦法很簡單;

首先product-->clean一下,這是個好習慣,然後在Xcode中打開項目所在目錄(show in finder),你會發現你添加的圖檔在裡面,删除重新添加即可。

4、

 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Requesting the window of a view (<CallView: 0x17664950; frame = (0 0; 0 0); transform = [0, 0, 0, 0, 0, 0]; alpha = 0; opaque = NO; layer = (null)>) with a nil layer. This view probably hasn't received initWithFrame: or initWithCoder:.'

解決辦法:

  if (self = [super init])

{

}

這種問題基本是是沒用init。

stackOVerflow連結

5、

Undefined symbols for architecture i386

解決辦法:

這個錯誤的發生原因一般是“XXX”這個檔案(類庫)雖然引入了工程中,但是由于種種原因(常見于多人開發,svn同步不規範)導緻“XXX”并未被添加到project.pbxproj這個檔案中。

解決方法是點選工程,在targets界面中找到Build Phases,根據提示資訊“XXX”來判斷缺少什麼檔案,一般如果缺少自定義的檔案,XXX會是缺少的類名,那麼就在Complie Sources中加入該檔案。如果缺少類庫,則在Link Binary With Libraries中加入該類庫。

 6、

ld: warning: directory not found for option '-L/Users/wxian/Documents/DoubleDie/sim-libs'

【ios開發】ios開發問題集錦

解決辦法:

If it is a "directory not found for option '-L/..." That means it's a Library Error, and you might want to try:

  • Click on your project (targets)
  • Click on Build Settings
  • Under Library Search Paths, delete the paths
【ios開發】ios開發問題集錦

If it is a "directory not found for option '-F/..." That means it's a Framework Error, and you might want to try:

  • Click on your project (targets)
  • Click on Build Settings
  • Under Frameworks Search Paths, delete the paths

ld: library not found for -lg7221codec-arm-apple-darwin9

解決辦法:

【ios開發】ios開發問題集錦

缺少庫檔案

7、

更新證書錯誤Code Sign error: Provisioning profile ‘XXXX'can't be found

解決方法:

      在Xcode中當你在更新了你得證書而再重新編譯你的程式,真機調試一直會出現 Code Sign error: Provisioning profile ‘XXXX’ can't be found是不是會另你很惱火。下面說說解決方法,讓你很好的解決這個問題。

  • 關閉你的項目,找到項目檔案XXXX.xcodeproj,在檔案上點選右鍵,選擇“顯示包内容”(Show Package Contents)。會新打開一個Finder。注:XXXX.xcodeproj就是一個檔案夾,這裡新打開的一個Finder裡面的三個檔案就是該XXXX.xcodeproj檔案夾裡面的檔案。
  • 在新打開的Finder中找到project.pbxproj,并且打開。在這之中找到你之前的證書的編碼資訊。
  • 儲存,重新啟動你的項目,再編譯。就OK了。

轉載于:https://www.cnblogs.com/ymonke/p/3382348.html