我試圖通過設備發送短信。但它崩潰就行通過Iphone,MFMessageComposeViewController發送短信
[self presentModalViewController:picker animated:YES];
CODE:
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
picker.recipients = rec; // your recipient number or self for testing
picker.body = billInfo;
[self presentModalViewController:picker animated:YES];
[picker release];
錯誤日誌:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target <billSummary: 0xfc7e780>.'
你有沒有檢查選擇器是使用斷點零與否。根據錯誤日誌它聲明選擇器是零爲呈現模式視圖,所以找到爲什麼選擇器是零 – Sumanth