2010-05-18 55 views
0

我不知道为什么下面一行:RegexKitLite及无法识别的选择发送到实例错误

addDetails.Address = [addDetails.Address stringByReplacingOccurrencesOfRegex:@" +" withString:@" "]; 

导致“无法识别的选择发送到实例”的错误,关闭我的iPhone应用程序在我的模拟器(的XCode)。

我的代码有什么问题?

+2

地址如何声明? – Mark 2010-05-18 11:06:49

+0

请添加描述Address属性或方法的代码。 – 2010-05-18 11:16:54

回答

0

stringByReplacingOccurrencesOfRegex:withString:是在RegexKitLite lib的RegexKitLite.h中定义的NSString类别。 看起来像你还没有正确地将这个类别添加到你的项目中看到:
http://regexkit.sourceforge.net/RegexKitLite/#AddingRegexKitLitetoyourProject
或addDetails.Address不是NSString。

+0

哦,是的!这解决了问题! 问题在于库的添加方式。我只是简单地添加了'RegexKitLite.h'文件而没有获取动态库。谢谢弗拉基米尔! – Susanth 2010-05-19 03:47:59

相关问题