Sara
Sara

Reputation: 63

Too many argument calls to method

In xCode when i debug using po i get this error.

(lldb) po [NSString stringWithFormat:@"tel:%@",item.CNUMBER]
error: too many arguments to method call, expected 1, have 2

Some questions that i looked at but doesnt help me.

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)

I even had a moment where i questioned my sanity and went to apples documentions. https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Strings/Articles/FormatStrings.html

[NSString stringWithFormat:@"Long %C dash", 0x2014]; // from apples doc

and the results are the same...

(lldb) po [NSString stringWithFormat:@"Long %C dash", 0x2014];
error: too many arguments to method call, expected 1, have 2

im using macOS 10.12.4 and xCode 8.3.2. I even reinstalled xCode from scratch. Any ideas what can be causing this!?

e: using po item.CNUMBER gives me the phone number like its supposed to

item is just a model i use to parse a json response, no methods involved.

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: i was unable to reproduce the error in a new project.

Upvotes: 4

Views: 268

Answers (1)

Sara
Sara

Reputation: 63

Thanks to @danh, we figured out the issue with was a NSString extension method. Removing it allowed me to debug like normal.

Upvotes: 1

Related Questions