簡體   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