- (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