繁体   English   中英

意外的“预期标识符”错误

[英]Unexpected “Expected Identifier” error

我的一个控制器中有以下两种方法。 buttonPressed方法连接到按钮并正常工作。 但是,当我将调用添加到workWithAString时,出现错误。 想知道我在这里失踪了什么,并感谢你的建议。

-(NSString *) workWithAString: (NSString *) string1
{

NSString *string2 = [[NSString alloc] initWithString:string1];

// Here I will do some other things with string2

return string2;

}


-(IBAction)button1Pressed
{
NSString *modifiedString1 = [[NSString alloc] initWithString:InputValue.text];
modifiedString1 = [[self workWithAString: modifiedString1 ];  // Expected identifier error here


}

出于某种原因,你有两个括号......

[self workWithAString:modifiedString1];

暂无
暂无

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

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