Reputation: 1240
I am integrating Twilo sdk to my iPhone app.
NSString *urlString=@"urlstring";
NSURL* url = [NSURL URLWithString:urlString];
ASIFormDataRequest *request=[ASIFormDataRequest requestWithURL:url];
[request setDelegate:self];
[request startSynchronous];
NSString *response=[request responseString];
NSLog(@"Response:%@",response);
NSDictionary *dict=[response JSONValue];
NSMutableString *capabilityToken=[[NSMutableString alloc] initWithFormat:@"%@",[dict objectForKey:@"message"]];
device = [[TCDevice alloc] initWithCapabilityToken:capabilityToken delegate:nil];
I am getting response as
{"message":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJBQzYwYTFlOTMxOTI5NmFhNmFlZDcwZjhkYjZhMTQyNGJmIiwiZXhwIjoxMzM3NzU5MTA3LCJzY29wZSI6InNjb3BlOmNsaWVudDpvdXRnb2luZz9hcHBTaWQ9QVAxODRlNTE3YzZmN2EyZGI5NTkwMzM5N2I3NWRkMDliMSJ9.fXjQhBaXu3OlN_zXZIvSkoElphtQuW1QnNSbmUzfsSc"}
Assigning that string to TCDevice object while initializing I am getting following exception.
-[__NSCFString PJSTRString]: unrecognized selector sent to instance 0x77a21d0
Can anyone please help me the reason for this exception and how to solve it.
Thanks in advance.
Upvotes: 0
Views: 272
Reputation: 861
Try adding the flags '-ObjC -all_load' to the "Other Linker Flags" in your target's Build Settings
Upvotes: 2