对方法的参数调用过多
Too many argument calls to method
在 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
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
给我 phone 数字,就像它应该
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: 我无法在新项目中重现错误。
感谢@danh,我们发现问题出在 NSString 扩展方法上。删除它让我可以像往常一样调试。
在 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
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
给我 phone 数字,就像它应该
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: 我无法在新项目中重现错误。
感谢@danh,我们发现问题出在 NSString 扩展方法上。删除它让我可以像往常一样调试。