【IOS】IOS開發問題解決方案索引(二)

來源:互聯網
上載者:User

標籤:ios   objective-c   bug   調試技巧   

IOS開發問題解決方案索引(二)

1       不使用ARC編譯,-fno-objc-arc

ios5 選擇了ARC但是不使用ARC編譯,-fno-objc-arc

 

http://leobluewing.iteye.com/blog/1384797

http://blog.cnrainbird.com/index.php/2012/03/13/object-c_kai_fa_zhong_hun_he_shi_yong_huo_bu_shi_yong_arc/

 

2       SIGABRT錯誤的調試辦法

SIGABRT錯誤的調試辦法

http://www.cnblogs.com/kimimaro/archive/2012/03/29/2423486.html

 

iOS經常會遇到一個頭疼的error就是在main函數上顯示“ Thread 1: signal SIGABRT”這個錯誤,終於在stackoverflow上找到了調試的辦法:

原文連結: http://stackoverflow.com/questions/9782621/i-have-an-error-in-main-m-thread-1-signal-sigabrt-how-can-i-fix-this

 

重點就是 Set an exceptionbreakpoint.

 之前我們遇到的在main函數上的那個崩潰資訊,如果想要調試就加入一個 an exception breakpoint ,它會在exception 被 cathc 的時候停下來,這樣就可以追蹤到造成 exception 的代碼了。 

加入一個exception breakpoint的方法就是:在navigator的斷點頁面,點擊左下角的加號就能看到 exceptionbreakpoint;

加入的時候可以設定,預設是 all,也可以選擇針對 oc 還是 c 的斷點。

 

         如果ViewController中的nib Name沒有與xib檔案名稱對應上(或者class沒有與ViewController名對應上),也會拋出這個異常。

 

Compileerrors with #include <string> in Cocoa App

3        Compileerrors with #include <string> in Cocoa App

Compile errors with #include <string> in Cocoa App

http://stackoverflow.com/questions/7542850/compile-errors-with-include-string-in-cocoa-app

 

Ifit is ".m", try to change it to obj-cpp ".mm", so thatXcode will deduce correct language. Or just put c++-specific headers inside"#ifdef __cplusplus" block

 

4       如何解決Couldnot launch app - No such file or directory

 

如何解決Could notlaunch app - No such file or directory

http://blog.csdn.net/wohaoxuexi/article/details/8233562

1.斷開裝置,刪除在裝置調試的APP

 

2.強行退出XCode(Quitxcode),不要只是關閉,直接強行退出

 

3.刪除系統產生的檔案(~/Library/Developer/Xcode/DerivedData/),使用終端命令進入到相應目錄,然後執行:rm-rf DerivedData/,等一會就可以了

 

4.重啟XCode,串連完裝置測試就可以了

 

5       iphone 接收搖動事件

http://www.cnblogs.com/dabaopku/archive/2012/06/11/2544490.html

 

iphone接收搖動事件

關鍵詞: ios iphone shakegesture UIView

在 ios3.0 之後, UIView 提供了三個函數接收搖動事件

motionBegan:
 
motionEnded:
 
motionCancelled:

只需要繼承 UIView 並實現以上函數即可.

需要注意的事項:

1. 這個UIView要成為事件響應者,也就是顯示之後 becomeFirstResponder

2. 更加重要! 這個 UIView要實現 canBecomeFirstResponder函數並且返回 YES.否則上一條建議無效.

 

參考資料: http://www.iphonedevsdk.com/forum/iphone-sdk-development/4381-iphone-shaking-code.html

motionBegan: motionEnded: motionCancelled:

6       ios 調用googleapi 實現語音辨識

ios 調用google api 實現語音辨識

http://blog.csdn.net/reylen/article/details/8709457

ios 調用google api 實現語音辨識

http://blog.csdn.net/ixijiangyue123/article/details/8883222

 

7       ios 音頻處理

iOS底層音頻處理技術(帶原始碼)

http://www.cocoachina.com/newbie/basic/2011/1122/3563.html

 

Iphone檢測聲音輸出裝置及耳機麥克風的處理

http://blog.sina.com.cn/s/blog_6c234ba90101a5nd.html

檢測iphone麥克風 

http://sxsoul.blog.163.com/blog/static/42849160201010825817519/

擷取麥克風的聲音資料流

http://www.cocoachina.com/bbs/read.php?tid=78224

 

http://ios.eoe.cn/thread-11635-1-1.html

 

8       ios音頻佇列服務編程指南

 

音頻佇列服務編程指南

音頻佇列服務編程指南(AudioQueue Services Programming Guide)(一)

http://blog.csdn.net/just_we_0727/article/details/8200853

 (二)

http://blog.csdn.net/just_we_0727/article/details/8201023

(三)

http://blog.csdn.net/just_we_0727/article/details/8373440

 

9       ios資料繫結

關於 PickerView資料來源的問題

http://blog.sina.com.cn/s/blog_69ee96d70100kz8r.html

PickerView的工作方式是怎樣的

http://www.cocoachina.com/bbs/simple/?t22239.html

 

PickerView資料來源的綁定在“無形”之中,因為並不是採用一種可視的方法,比如xxxx.dataSource = myDataSource,而是通過實現協議的方式,對於UIPickerVIew,需要實現如下等若干協議

 

 

10    交叉編譯libogg & libvorbis   

交叉編譯libogg& libvorbis

http://blog.163.com/dong_xiao_yang/blog/static/21613820520132125548615/

 

Tutorial: Open Source on iOS (Part 2): Compiling libogg oniOS

http://iosdeveloperzone.com/2012/09/29/tutorial-open-source-on-ios-part-2-compiling-libogg-on-ios/

 

Cross Compiling libogg for iOS

http://stackoverflow.com/questions/11711100/cross-compiling-libogg-for-ios

 

11    ios感應器總結(1)

ios感應器總結(1)

http://blog.csdn.net/shaobojohn/article/details/7843104

 

12    iosUIView事件註冊   

UIView事件註冊 

http://menglinger-520.blog.163.com/blog/static/16929433020117584733320/

 

 

13    ios進度條的實現

 

進度條的實現(MBProgressHUD)

http://blog.csdn.net/weasleyqi/article/details/8072897

 

 

14    ios錄音功能的實現

ios錄音功能的實現

http://blog.csdn.net/rs_network/article/details/6988447

iOS 錄音Wav 音頻 轉換 Amr ,Android 播放

http://blog.csdn.net/justinjing0612/article/details/9633121

 

http://code4app.com/ios/Sound-Recorder/4f9252d606f6e71769000000

 

15    Xcode引用檔案注意

Xcode引用檔案時,不要直接拷貝檔案到項目目錄,再以添加引用的形式引用,這時有可能報“找不到檔案”錯誤,而且引用的檔案目錄是藍色的,最好是直接飲用,選擇copyitem的方式

 

 

16    ios‘libxml/xmlversion.h‘ file not found in xcode 4.2?

‘libxml/xmlversion.h‘ file not found in xcode 4.2?

http://stackoverflow.com/questions/8850724/libxml-xmlversion-h-file-not-found-in-xcode-4-2

 

Rememberto add the library in Link Binary en Build Phases Section of the targetproject.   

 

Youneed to put all the libxml headers on the include path. For Xcode do this byadding /usr/include/libxml2 tothe header paths (that will pass -I/usr/include/libxml2 to the c compiler)

This is in the build settings tab in SearchPaths -> Header Search Paths

 

 

17    iosASIHTTPRequest類庫簡介和使用說明

ASIHTTPRequest類庫簡介和使用說明

http://www.cnblogs.com/dotey/archive/2011/05/10/2041966.html

ASIHTTPRequest 類庫在iOS 7.0 中需要修改的地方

http://blog.s135.com/post/490/

代碼技巧之ASIHttpRequest類庫的使用

http://bbs.9ria.com/thread-259725-1-1.html

 

18    ios相對路徑與絕對路徑的轉化NSBundle

ios相對路徑與絕對路徑的轉化NSBundle

http://blog.csdn.net/zi2xuan/article/details/7319210

iOS的相對路徑和絕對路徑

http://wiki.eoe.cn/page/iOS_blog_page_98641.html

 

19    NSString字串相加串連

NSString字串相加串連的三種方法

http://blog.sina.com.cn/s/blog_56e2f4250102dusl.html

 

Objective-C文法之NSString字串的那些事兒(三)

http://blog.csdn.net/xys289187120/article/details/6777283

 

20    iosXCode clang failed with exit code 254

原因:

         進入IOS虛擬機器,然後直接開啟了共用目錄中的Xcode工程進行編譯;

 

 

XCode clang failed with exit code 254

http://stackoverflow.com/questions/17426810/xcode-clang-failed-with-exit-code-254

clang failed with exit code 254 only for iOS device target

http://stackoverflow.com/questions/11984074/clang-failed-with-exit-code-254-only-for-ios-device-target

 

iOS 5 - Apple LLVM compiler 3.0 error

http://www.cnblogs.com/mfryf/archive/2012/02/26/2369190.html

 

21    Regex

匹配幾個字串之一:

 

Var tagnameRex = /(div|font|table|ol|ul)/I;            尋找任何指定字串

【整理】關於用Regex處理html代碼方面的建議

http://www.crifan.com/for_process_html_with_many_tag_recommend_use_third_lib_while_simple_html_use_regular_expression/

【IOS】IOS開發問題解決方案索引(二)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.