I get this warning in Xcode
comparison of addresses of NSUbiquitycontainerDidChangeNotification not equal to a null pointer is always true
it is in the Core Data Ensembles Framework in
CDEICloudFileSystem.m
in
- (void)addUbiquityContainerNotificationObservers {
[self removeUbiquityContainerNotificationObservers];
/// in this line
if (&NSUbiquityIdentityDidChangeNotification != NULL) {
///
__weak typeof(self) weakSelf = self;
ubiquityIdentityObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSUbiquityIdentityDidChangeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) {
__strong typeof(weakSelf) strongSelf = weakSelf;
[strongSelf stopMonitoring];
[strongSelf willChangeValueForKey:@"identityToken"];
[strongSelf didChangeValueForKey:@"identityToken"];
}];
}
}
Can someone tell me how to fix this ?
Thanks
I wrote that code. As several have pointed out, it is there to ensure that the NSUbiquityIdentityDidChangeNotification
symbol exists before using it. Before iOS 6, that notification did not exist.
The code is several years old, and iOS 5 is not supported now in the framework, so I will remove the check.
Update Turns out the check could not be removed, because we still support OS X 10.7. So I added #pragmas to silence the warning instead.