[英]Why am I getting this Parse Issue in Xcode?
I'm currently learning Objective-C and app development, but I'm also using a canned framework (buzztouch) to develop simple apps. 我目前正在学习Objective-C和应用程序开发,但是我也在使用固定框架(buzztouch)开发简单的应用程序。 Currently, I'm getting this Parse Issue:
目前,我收到此解析问题:
'theTitle' used as the name of the name of the previous parameter rather than as part of the selector 'theTitle'用作上一个参数名称的名称,而不是选择器的一部分
Here's the line of code: 这是代码行:
-(void)showAlert:(NSString *)theTitle:(NSString *)theMessage:(int)alertTag;
What am I doing wrong and how can I avoid this in the future? 我在做什么错?将来如何避免这种情况? Sorry if this is an easy question, I'm just trying to learn how all of this works.
抱歉,如果这是一个简单的问题,我只是想学习所有这些的工作原理。
Compare the two: 比较两者:
Your code: 您的代码:
-(void)showAlert:(NSString *)theTitle:(NSString *)theMessage:(int)alertTag;
Now, look at this: 现在,看看这个:
-(void)showAlert:(NSString *)theTitle theMessage:(NSString *)theMessage alertTag:(int)alertTag;
The problem is in the way you have declared your method: 问题在于您声明方法的方式:
Here is some detailed information on declaring your methods: Mac Developer Library . 以下是有关声明方法的一些详细信息: Mac Developer Library 。 Take a look at the section titled Methods and Messaging .
看一下标题为“ 方法和消息传递 ”的部分。
I find it useful to compare Objective C methods to C++ or C# style methods. 我发现将Objective C方法与C ++或C#样式方法进行比较很有用。
in C# 在C#中
public int Add(int number1, int number2) {
return number1 + number2;
}
in Objective C 在目标C中
- (int)add:(int)number1 toNumber:(int)number2 {
return number1 + number2
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.