0
votes

Main.m

NSDictionary *additionalQueryParameters = [NSURL ab_parseURLQueryString:[url query]];

OAuth.h

@interface NSURL (OAuthAdditions)

+ (NSDictionary *)ab_parseURLQueryString:(NSString *)query;

@end

OAuth.m

@implementation NUSL (OAuthAdditions)

+ (NSDictionary *)ab_parseURLQueryString:(NSString *)query
{
 does something..
}

When it runs that line, it throws this error...

2012-12-03 15:10:58.506[12500:1d403] +[NSURL ab_parseURLQueryString:]: unrecognized selector sent to class 0xaece26c

2012-12-03 15:10:58.508[12500:1d403] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSURL ab_parseURLQueryString:]: unrecognized selector sent to class 0xaece26c'

* First throw call stack: (0xada8012 0xa3d6e7e 0xae332ad 0xad97bbc 0xad9794e 0x17b5ee8 0x17b5724 0x17b58d6 0xa84f53f 0xa861014 0xa8522e8 0xa851fcb 0x96097b24 0x960996fe) libc++abi.dylib: terminate called throwing an exception

Any idea why it can't find it and how to fix it? Thanks.

2
Is the method in OAuth.m within @implementation (OAuthAdditions)? - rmaddy
Lack of an import would barf a compiler warning, but not a runtime error. - bbum
Is the OAuth.m target membership correct? - rmaddy
yes I did import the .h file to the class that's using it. - unwise guy
None of the answers below solved this question - unwise guy

2 Answers

1
votes

Make sure OAuth.m is actually in the target and building in your project....

1
votes

Your category implementation (OAuth.m) is named NUSL, not NSURL. The compiler is fine with the method since the category interface (header) is named correctly.