加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-14 19:11:43 所属栏目:百科 来源:网络整理
导读:我为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
我为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,非常奇怪.
有什么建议吗?
谢谢.
吉恩

解决方法

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

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

例如

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

它看起来像上面的代码和新的私有API之间的冲突,但我不确定.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读