2

I have created one library project, in that i am trying to Twitter sharing. But when i tried to on Twitter the application is crashes at following line

NSString *_oAuthNonce = [NSString ab_GUID];

by error:

+[NSString ab_GUID]: unrecognized selector sent to class 0x1a09fd8

ab_GUID this method is present in OAuthCore class

+ (NSString *)ab_GUID
{
    CFUUIDRef u = CFUUIDCreate(kCFAllocatorDefault);
    CFStringRef s = CFUUIDCreateString(kCFAllocatorDefault, u);
    CFRelease(u);
    return [(NSString *)s autorelease];
}

(My all classes are present in static Library)

Pfitz
  • 7,336
  • 4
  • 38
  • 51
Pallavi
  • 249
  • 2
  • 10

2 Answers2

1

Since you are saying that you use a static library:

Make sure you have the -ObjC flag enabled (in the project using the library same problem treated here). Or it will not link categories in a static library.

Objective-C categories in static library

enter image description here

Community
  • 1
  • 1
Pfitz
  • 7,336
  • 4
  • 38
  • 51
  • Yes my -ObjC flag is enabled, but still it crashes. There are two static methods in OAuthCore class where application is crashing by error Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSString ab_GUID]: unrecognized selector sent to class 0x1a15fd8' – Pallavi Jul 11 '12 at 05:23
0

Have you imported the <OAuthCore/OAuth+Additions.h>? It seems importing <OAuthCore/OAuthCore.h> won't include this automatically.

Also make sure OAuth+Additions.m is compiled into the static library.

kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005