对于 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
该类别在最终应用程序中,而不是在静态库中。当我在iPhone(3GS和iOS4)上使用该应用程序时,应用程序和测试都没有问题。当我使用 iPhone 模拟器时,我添加的方法不会被调用。调试我已经看到 xcode '跳过'调用并返回 null,非常奇怪。有什么建议吗?谢谢。让