- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{ NSMutableString *message=[[NSMutableString alloc]init];
// Notifies users about errors associated with the interface
switch (result)
{
case MFMailComposeResultCancelled:
message = @"Result: canceled";
break;
case MFMailComposeResultSaved:
message = @"Result: saved";
break;
case MFMailComposeResultSent:
message = @"Result: sent";
break;
case MFMailComposeResultFailed:
message = @"Result: failed";
break;
default:
message = @"Result: not sent";
break;
}
我使用mailcomposer的上述代碼。編譯時會給出警告incompatable pointer types assigning to NSMutableString from NSString
。我相信這發生在我們使用NSString而不是NSMutableString時。我該如何解決這個問題? 在此先感謝。錯誤警告疑惑
@lostln交通情況MFMailComposeResultCancelled: [消息appendString:@ 「結果:取消」]; 休息;對??? – ICoder
@編碼器是的。我只是想發佈與警告相關的代碼。其他一切都保持不變。在每種情況下都會做出相同的更改([message appendString:])。 – lostInTransit