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