【发布时间】:2010-06-22 16:02:50
【问题描述】:
我有一个 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,非常奇怪。 有什么建议吗? 谢谢。 让
【问题讨论】:
-
我会先尝试“清理所有目标”(关闭构建菜单) - 您可能有不同的半构建代码位用于模拟器和设备。为了安全起见,我也会从两者中卸载它:)