在xCode中,当我使用po
进行调试时,我收到此错误。
(lldb) po [NSString stringWithFormat:@"tel:%@",item.CNUMBER]
error: too many arguments to method call, expected 1, have 2
我看到的一些问题但对我没有帮助。
Too many arguments to method call expected 1, have 2
Too many arguments to method call
Too many arguments to method call, expected 1, have 2?(Xcode)
我甚至有一个时刻,我质疑我的理智,并去了苹果文件。 https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Strings/Articles/FormatStrings.html
[NSString stringWithFormat:@"Long %C dash", 0x2014]; // from apples doc
结果是一样的......
(lldb) po [NSString stringWithFormat:@"Long %C dash", 0x2014];
error: too many arguments to method call, expected 1, have 2
即时通讯使用macOS 10.12.4和xCode 8.3.2。我甚至从头开始重新安装xCode。可能导致这种情况的任何想法!?
e:使用po item.CNUMBER
给我一个类似于
item
只是我用来解析json响应的模型,没有涉及任何方法。
LeasesModel *item; // declared as an instance var
...
@interface LeasesModel : NSObject
@property(nonatomic, strong) NSString *ID, *PROPERTYNAME, *ADDRESS1, *ADDRESS2, *CITY, *STATE, *ZIP, *WBPOINT, *COMMENTS, *CNAME, *CNUMBER, *CEMAIL, *CCOMPANY, *ISRETAILSPACE, *ISOFFICESPACE, *ISCOMMUNITYFACILITY, *SQFT, *STATUS, *ASKINGRENT, *FLOORCOUNT, *FLOOR1SF, *FLOOR1ASKING, *FLOOR2SF, *FLOOR2ASKING, *FLOOR3SF, *FLOOR3ASKING, *FLOOR4SF, *FLOOR4ASKING, *FLOOR5SF, *FLOOR5ASKING;
@end
e:我无法在新项目中重现错误。
答案 0 :(得分:1)
感谢@danh,我们发现问题是一个NSString扩展方法。删除它允许我像平常一样进行调试。