I've an application with the following category for NSString:
@interface NSDate(ISO8601Parsing)
//This method is the one that does all the work. All the others are convenience methods.
+ (NSDate *)dateWithString:(NSString *)str strictly:(BOOL)strict getRange:(out NSRange *)outRange;
+ (NSDate *)dateWithString:(NS开发者_如何学编程String *)str strictly:(BOOL)strict;
//Strictly: NO.
+ (NSDate *)dateWithString:(NSString *)str timeSeparator:(unichar)timeSep getRange:(out NSRange *)outRange;
+ (NSDate *)dateWithString:(NSString *)str timeSeparator:(unichar)timeSep;
+ (NSDate *)dateWithString:(NSString *)str getRange:(out NSRange *)outRange;
+ (NSDate *)dateWithString:(NSString *)str;
@end
The category is in the final application, not in a static library. When I use the application on the iPhone (3GS with iOS4), there is no problem both with application and tests. When I use the iPhone simulator my added methods aren't called. Debugging I've seen that xcode 'skips' the call and return null, very strange. Any suggestion? Thanks. Jean
I encountered the same issue when using the code generated by wsdl2objc (see issue). I solved it by renaming one method:
+ (NSDate *)dateWithString:(NSString *)str
to e.g.
+ (NSDate *)wsdl2objcDateWithString:(NSString *)str;
It looks like a conflict between the code above and a new private API, but I'am not sure.
rehos is correct - Thanks
Just for extra clarity for noobs like myself;
rename method in NSDate+ISO8601Parsing.m and .h
and
use renamed method in
+(NSDate *)deserializeNode:(xmlNodePtr)cur
精彩评论