我與下一個代碼的一個問題:無法識別選擇
NSDictionary * imagen = [[NSDictionary alloc] initWithDictionary:[envio resultValue]];
NSString *imagenS = [imagen valueForKey:@"/Result"];
ClaseMaestra *b1 = [[ClaseMaestra alloc]init];
NSData *imagenDecode = [[NSData alloc] initWithData:[b1 base64DataFromString:imagenS]];
NSLog(@"Decode Image:");
NSLog(@"%@", imagenDecode);
//SAVE IMAGE
NSArray *sysPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
NSString *docDirectory = [sysPaths objectAtIndex:0];
NSString *filePath = [NSString stringWithFormat:@"%@david.png",docDirectory];
[imagenDecode writeToFile:filePath atomically:YES];
塊引用
[envio resultValue] - >在基地返回與一個圖像的NSDictionary 64編纂。
我想解碼器和保存此圖像,但在我的控制檯我已經表現出這樣的信息:
2011-08-23 19:19:39.750 WSStub[38501:a0f] *************************
2011-08-23 19:19:39.752 WSStub[38501:a0f] SendImage
2011-08-23 19:19:39.752 WSStub[38501:a0f] *************************
2011-08-23 19:19:39.759 WSStub[38501:a0f] -[ClaseMaestra base64DataFromString:]: unrecognized selector sent to instance 0xd00ad0
Program received signal: 「EXC_BAD_ACCESS」.
ClaseMaestra接口:
#import <Foundation/Foundation.h>
@class NSString;
@interface ClaseMaestra : NSObject
+ (NSMutableData *)base64DataFromString: (NSString *)string;
@end
我不能明白「無法識別的選擇」錯誤...