繁体   English   中英

Xcode邮件中的预期标识符错误

[英]expected identifier error in Xcode mail

这是我的代码:

-(void) sendEmailTo:(NSString *)to withSubject:(NSString *) subject withBody:(NSString *)body {
NSString *mailString = [NSString stringWithFormat:@"mailto:?to=%@&subject=%@&body=%@",
                        [to stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding],
                        [subject stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding],
                        [body  stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:mailString]];
}

-(void) send:(id) sender {
[self sendEmailTo:[phoneNumberEntry @"@txt.att.net"] withSubject:[settingsSubjectBox] withBody:[settingsMsgBox]];
}

-(IBAction)launchBomb:(id)sender {
sender;
}

在“无效发送方”括号中,出现“预期标识符”错误。 我该如何解决?

[self sendEmailTo:[phoneNumberEntry @"@txt.att.net"] withSubject:[settingsSubjectBox] withBody:[settingsMsgBox]];

好吧,老实说,我不确定整行^^是怎么回事。 例如, withSubject:[settingsSubjectBox]没有任何意义。 如果这应该是方法调用,则应该使用withSubject:[self settingsSubjectBox]看起来像这样。 或者,如果它正在读取属性的值,例如withSubject:self.settingsSubjectBox

无论哪种方式, withSubject:[settingsSubjectBox]都是无效的语法。 我建议重写整行,因为该行上的每个参数都存在此问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM