iPhone模拟器没有看到我的NSString类别

时间:2010-06-22 16:02:50

标签: iphone xcode ios4

我为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上使用该应用程序(带有iOS4的3GS)时,应用程序和测试都没有问题。 当我使用iPhone模拟器时,我没有调用添加的方法。调试我已经看到xcode'跳过'调用并返回null,非常奇怪。 有什么建议吗? 谢谢。 让

2 个答案:

答案 0 :(得分:2)

使用wsdl2objc生成的代码时遇到了同样的问题(请参阅issue)。我通过重命名一个方法来解决它:

+ (NSDate *)dateWithString:(NSString *)str

到例如。

+ (NSDate *)wsdl2objcDateWithString:(NSString *)str;

看起来上面的代码与新的私有API之间存在冲突,但我不确定。

答案 1 :(得分:0)

rehos是正确的 - 谢谢

只是为了像我这样的明星更加清晰;

在NSDate + ISO8601Parsing.m和.h

中重命名方法

在中使用重命名的方法  +(NSDate *)deserializeNode:(xmlNodePtr)cur