objective c - expected identifier error in Xcode mail -
here code:
-(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; }
in "void send sender" brackets, there "expected identifier" error. how fix?
[self sendemailto:[phonenumberentry @"@txt.att.net"] withsubject:[settingssubjectbox] withbody:[settingsmsgbox]];
well honest i'm not sure going on on entire line ^^. example, withsubject:[settingssubjectbox]
doesn't make sense. if supposed method call, should withsubject:[self settingssubjectbox]
. or if it's reading value of property, withsubject:self.settingssubjectbox
.
either way, withsubject:[settingssubjectbox]
invalid syntax. recommend rewriting entire line because problem exists every argument on line.
Comments
Post a Comment