Reputation: 41
NSString *result = [encData base64EncodeData:encData];
why base64EncodeData does't work? it had the message like:
:-[NSConcreteData base64EncodeData:]: unrecognized selector sent to instance 0x4e1f020
how to use it? Someboby suggust me that to inlude the third library, how to import it?
Upvotes: 0
Views: 1121
Reputation: 3831
It's not in a standard library, you need to declare and implement additional category to make it work.
@interface NSString (Base64)
- (NSString *)base64EncodeData;
@end
@implementation NSString (Base64)
- (NSString *)base64EncodeData
{
return .. do something with self to make a base64 encoded string ..;
}
@end
Upvotes: 1
Reputation: 6287
You can read the article in http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html and download the third party class there
Upvotes: 1