Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone simulator doesn't see my NSString category

Tags:

xcode

iphone

ios4

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:(NSString *)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

like image 912
jean71 Avatar asked Nov 05 '22 11:11

jean71


1 Answers

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.

like image 75
rehos Avatar answered Nov 12 '22 16:11

rehos