2013-03-30 101 views
-1

我有一些加密數據,我想在應用程序啓動後解密它。我做這個代碼:找不到實例方法'-decrytedWithKey'(將默認值返回爲'id')

NSMutableData *FR2ENData=[NSMutableData dataWithContentsOfFile:FR2ENFilePath]; 
     FR2ENData=[FR2ENData decryptedWithKey:@"XXXXXXXX"]; 
     NSString * FR2ENString = [NSString stringWithUTF8String:[FR2ENData bytes]]; 
     NSArray *FR2EN0=[FR2ENString componentsSeparatedByString:@"\n"]; 

而且我得到這個警告信息:

實例方法「-decrytedWithKey」未找到(返回默認tyoe到「身份證」)

哪有我清理它?

感謝提前:)

+2

c#????我想這是Objective-c。 –

+0

@AnoopVaidya昨天我看到一個標籤爲C++的Objective-C問題... Xcode有點*可以理解,但C#和C++?真? – 2013-03-30 12:13:55

+0

真的很抱歉傢伙! – Icarox

回答

3

你缺少的NSDatadecryptedWithKey:方法類別標題。它看起來像您使用的是擴展類defined by the user Karl in the third post on this page(我複製下面的標題):

#import <Foundation/Foundation.h> 

@interface NSData (AES256) 
- (NSData*) encryptedWithKey:(NSData*) key; 
- (NSData*) decryptedWithKey:(NSData*) key; 
@end 

你的代碼需要,以避免編譯錯誤導入這個頭。您還需要將實現添加到項目中,作爲源代碼或庫,以避免鏈接錯誤。

相關問題