Skip to content

Instantly share code, notes, and snippets.

NSDictionary *jsonDataTobeEncode = @{@"sub":@"123456",@"name":@"Premal",@"admin": @true};
NSString *jwtTokenValue = [JWTBuilder encodePayload:jsonDataTobeEncode].secret(@"SecretKey").algorithm([JWTAlgorithmFactory algorithmByName:@"HS256"]).encode;
I am using the library to generate the token for the data. Every time i run the app and it crash and give me following error
-[NSConcreteData base64UrlEncodedString]: unrecognized selector sent to instance 0x7fa9ba8145b0
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteData base64UrlEncodedString]: unrecognized selector sent to instance 0x7fa9ba8145b0'
I put debug points and found that in the JWT.m file there is method named** - (NSString )encodeSegment:(id)theSegment withError:(NSError *)error **. In this method there is the code as below
`NSString *encodedSegment = nil;