【问题标题】:RegexKitLite & Unrecognized Selector Sent to Instance ErrorRegexKitLite & Unrecognized Selector Sent to Instance 错误
【发布时间】:2010-05-18 11:04:39
【问题描述】:

我不知道为什么下面这行:

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

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

我的代码有什么问题?

【问题讨论】:

  • 地址是如何声明的?
  • 请添加描述地址属性或方法的代码。

标签: iphone objective-c xcode instance


【解决方案1】:

stringByReplacingOccurrencesOfRegex:withString: 是 RegexKitLite 库的 RegexKitLite.h 中定义的 NSString 类别。 看起来您尚未将此类别正确添加到您的项目中,请参阅:
http://regexkit.sourceforge.net/RegexKitLite/#AddingRegexKitLitetoyourProject
或者 addDetails.Address 不是 NSString。

【讨论】:

  • 哦,是的!这解决了问题!问题在于添加库的方式。我只是简单地添加了“RegexKitLite.h”文件而没有进入动态库。谢谢弗拉基米尔!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-22
  • 1970-01-01
  • 2020-01-19
  • 1970-01-01
相关资源
最近更新 更多