【发布时间】:2012-03-10 13:08:49
【问题描述】:
我已经在 ios4 中实现了 ALAssetsLibraryChangedNotification 并且它运行良好,但是现在在 ios5 中它似乎被忽略了。我补充:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ALAssetsLibraryChangedNotification) name: ALAssetsLibraryChangedNotification object:self.library];
在我的视图控制器初始化器和 dealloc 中我放了:
[[NSNotificationCenter defaultCenter] removeObserver:self name:ALAssetsLibraryChangedNotification object:nil];
那么methdod实现本身就是:
- (void) ALAssetsLibraryChangedNotification
{
//doSomeStuff
}
我需要在初始化程序中添加它并在 dealloc 中删除它,以便如果用户在应用程序外更改库时它会更新。有人知道这个问题的好方法吗?
【问题讨论】:
-
这是一个iOS5's bug。因此,我们必须采取我写的链接中描述的解决方法。
标签: iphone objective-c ios cocoa-touch ios5