Skip to content
November 3, 2011 / windperson

Source type 1 not available 錯誤

拿一個擴增實境的範例程式在Xcode,用模擬器跑時,發生下面這個詭異的錯誤:

Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Source type 1 not available’

結果原因是因為有段code:

imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;

模擬器沒有camera,所以那個sourceType在模擬器執行時assign給它UIImagePickerControllerSourceTypeCamera會發生錯誤。

reference:

https://discussions.apple.com/thread/1720561?start=0&tstart=0

http://zcentric.com/2008/08/28/using-a-uiimagepickercontroller/

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: