我为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
Run Code Online (Sandbox Code Playgroud)
该类别位于最终应用程序中,而不是静态库中.当我在iPhone上使用该应用程序(带有iOS4的3GS)时,应用程序和测试都没有问题.当我使用iPhone模拟器时,我没有调用添加的方法.调试我已经看到xcode'跳过'调用并返回null,非常奇怪.有什么建议吗?谢谢.吉恩
当QLPreviewController更改显示的文档时,我有一个需要通知的对象.QLPreviewController具有属性currentPreviewItemIndex,该属性在文档更改时更新.我已经添加了我的对象作为currentPreviewItemIndex的观察者,它在我的代码中更改了属性时收到通知,到目前为止一切都很好.问题是用户可以在屏幕上更改显示的文档,我发现在这种情况下不会生成通知.
在这种情况下,收到通知的任何解决方案?我想当通知属性currentPreviewItemIndex的setter时生成通知,并且可能在用户滑动属性时在对象QLPreviewController内部更改.
另一种解决方案可能是在QLPreviewController中禁用水平滑动但保留垂直滑动(有箭头按钮来更改显示的文档).你是怎样做的?
在此先感谢您的帮助.
Giannandrea