views:

62

answers:

1

Hey all, I am using http://pastie.org/966473 as a reference as all I need to do is encrypt something using AES256 encrypting. I created a class and put the implementation in the pastie on top of the implementation for my class.

@implementation
//pastie code
@end

@implementation 
//my class code
@end

In my class code I create a NSMutableData and try to call the EncryptAES method and I get a warning saying it might not respond to that. What am I doing wrong here? do I need to implement the pastie code elsewhere? Thanks for any help.

A: 

That's just the @implementation block. You also need to define the category. Put this in your header file:

@interface NSMutableData (AES)
    - (NSMutableData*)EncryptAES:(NSString *)key;
    - (NSMutableData*)DecryptAES:(NSString *)key
                      andForData:(NSMutableData*)objEncryptedData;
@end
Jeff Kelley
ah You're a lifesaver. Thanks a ton.
Robert