简体   繁体   English

为什么我在Xcode中遇到此Parse问题?

[英]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.

相关问题 为什么我在XCode中收到过时的警告 - Why am I getting a deprecated warning in XCode iOS:为什么我在Xcode中得到“未使用的变量”? - iOS : Why am I getting 'Unused variable' in Xcode? 在Swift 4中解析JSON后,为什么会得到空白的UITableView? - Why am I getting a blank UITableView after parse JSON in Swift 4? 我在Xcode for iOS中得到了“枚举类型的隐式转换”警告,我不知道为什么 - I am getting an “Implicit conversion from enumeration type” warning in Xcode for iOS and I don't know why 我在Xcode中获得了预期的标识符 - I am getting Expected identifier in Xcode 为什么在调试过程中会收到有关从远程iOS设备读取Xcode框架文件的警告? - Why am I getting warnings about Xcode reading framework files from the remote iOS device during debugging? 为什么我在Xcode 6中收到错误“无法找到或生成匹配的签名资产”? - Why am I getting an error “Failed to locate or generate matching signing assets” in Xcode 6? 为什么我从Xcode收到此警告? iOS代码似乎很好 - Why am I getting this warning from Xcode? The iOS code seems fine 为什么我将高度设为0 - Why I am getting the altitude as 0 为什么我没有得到UIScrollView的实际contentSize? - Why am I not getting the actual contentSize of UIScrollView?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM