-1
我有必須使用正則表達式的一個項目,所以我決定用RegexKitLite,我下載了它,增加了RegexKitLite.m成「編譯來源」,並RegexKitLite.h將「」複製到「複製文件」部分。項目庫增加了libicucore.A.dylib。進口RegexKitLite.h到我的課,寫(只是爲了測試)代碼:RegexKitLite - iOS設備:無法識別的選擇
NSString *str = @"testing string";
if ([str isMatchedByRegex:@"[^a-zA-Z0-9]"])
{
NSLog(@"Some message here");
}
之後,我有錯誤消息:
-[__NSCFString isMatchedByRegex:]: unrecognized selector sent to instance 0x1ed45ac0
2013-02-28 19:46:20.732 TextProject[8467:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString isMatchedByRegex:]: unrecognized selector sent to instance 0x1ed45ac0'
我錯過了什麼?請幫助我..
沒有ü聲明你頭文件:在您的實現文件#進口「RegexKitLite.h」? – tiguero 2013-02-28 17:58:27
我已經將「RegexKitLite.h」導入到我的標題類 – LightNight 2013-02-28 18:00:42
它適用於Mac OS還是iOS,因爲這個lib似乎只適用於MacOS。您還試圖導入iOS上不允許的動態庫。 – tiguero 2013-02-28 18:08:29