开发者

RegexKitLite & Unrecognized Selector Sent to Instance Error

开发者 https://www.devze.com 2022-12-30 11:42 出处:网络
I am not sure why the following line: addDetails.Addre开发者_C百科ss = [addDetails.Address stringByReplacingOccurrencesOfRegex:@\" +\" withString:@\" \"];

I am not sure why the following line:

addDetails.Addre开发者_C百科ss = [addDetails.Address stringByReplacingOccurrencesOfRegex:@" +" withString:@" "];

causes an "Unrecognized Selector Sent to Instance" error, closing my iPhone App in my Simulator(XCode).

What's wrong with my code?


stringByReplacingOccurrencesOfRegex:withString: is a NSString category defined in RegexKitLite.h of RegexKitLite lib. Looks like you haven't add this category into your project properly see:
http://regexkit.sourceforge.net/RegexKitLite/#AddingRegexKitLitetoyourProject
or addDetails.Address is not NSString.

0

精彩评论

暂无评论...
验证码 换一张
取 消