我正在尝试运行此 MD5 algorithm ,我在 this post on stackoverflow 上找到的。但我不断收到以下错误:
2010-08-06 14:45:40.971 Intel[3195:a0f] -[TaskController md5:]: unrecognized selector sent to instance 0x108df0
2010-08-06 14:45:40.973 Intel[3195:a0f] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TaskController md5:]: unrecognized selector sent to instance 0x108df0'
*** Call stack at first throw:
(
0 CoreFoundation 0x9875abba __raiseError + 410
1 libobjc.A.dylib 0x96a3a509 objc_exception_throw + 56
2 CoreFoundation 0x987a78db -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x987017e6 ___forwarding___ + 950
4 CoreFoundation 0x987013b2 _CF_forwarding_prep_0 + 50
5 Intel 0x00003143 -[TaskController findFileOrCreateFile] + 709
6 Intel 0x00002d29 -[TaskController init] + 92
7 Intel 0x00002c03 main + 128
8 Intel 0x00002a6a start + 54
)
我虽然这可能与我的字符串是 UTF-8 有关,但我尝试输入以下字符串,但仍然出现错误:
NSString *foo = @"your text here";
const char *bar = [foo UTF8String];
有什么帮助吗?
非常感谢
最佳答案
这和你的字符串格式没有任何关系。运行时正在寻找您的 md5 方法,但没有找到。您是否在 TaskController 对象的 @interface 部分中定义了它?您是否使用正确数量的参数定义/调用它?
关于objective-c - 使用MD5算法时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3424426/