McGrady
McGrady

Reputation: 41

how to use base64EncodeData?

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

Answers (2)

iwat
iwat

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

Manny
Manny

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

Related Questions