0

这是我的代码:

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

在“void send sender”括号中,有一个“expected identifier”错误。我该如何解决?

4

1 回答 1

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

老实说,我不确定整行发生了什么^^。例如,withSubject:[settingsSubjectBox]没有任何意义。如果这应该是一个方法调用,它应该看起来像这样withSubject:[self settingsSubjectBox]。或者如果它正在读取一个属性的值,就像这样withSubject:self.settingsSubjectBox

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

于 2013-08-23T23:56:38.663 回答