我在尝试使用此如何比较NSPersistentStoreUbiquitousTransitionType枚举值
// Check type of transition
if let type = n.userInfo?[NSPersistentStoreUbiquitousTransitionTypeKey] as? UInt {
FLOG(" transition type is \(type)")
if (type == NSPersistentStoreUbiquitousTransitionType.InitialImportCompleted) {
FLOG(" transition type is NSPersistentStoreUbiquitousTransitionTypeInitialImportCompleted")
}
}
比较从NSPersistentStoreCoordinatorStoresDidChangeNotification
接收的值时,下面的错误,但我得到以下编译器错误
NSPersistentStoreUbiquitousTransitionType is not convertible to UInt
当我以为我得到了斯威夫特的喋喋不休,我再次陷入困境!
谢谢,所以我正确地将userInfo的值作为Uint获取,还是有更好的方式来处理不需要获取原始值的事情? – 2014-10-07 06:30:23
更新了我的答案 – 2014-10-07 14:25:03