{"action":"created","issue":{"url":"https://api.github.com/repos/evermeer/EVCloudKitDao/issues/35","labels_url":"https://api.github.com/repos/evermeer/EVCloudKitDao/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/evermeer/EVCloudKitDao/issues/35/comments","events_url":"https://api.github.com/repos/evermeer/EVCloudKitDao/issues/35/events","html_url":"https://github.com/evermeer/EVCloudKitDao/issues/35","id":119592505,"number":35,"title":"Unhandled exception when processing notifications that an item has been deleted","user":{"login":"tbaggett","id":1326678,"avatar_url":"https://avatars.githubusercontent.com/u/1326678?v=3","gravatar_id":"","url":"https://api.github.com/users/tbaggett","html_url":"https://github.com/tbaggett","followers_url":"https://api.github.com/users/tbaggett/followers","following_url":"https://api.github.com/users/tbaggett/following{/other_user}","gists_url":"https://api.github.com/users/tbaggett/gists{/gist_id}","starred_url":"https://api.github.com/users/tbaggett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbaggett/subscriptions","organizations_url":"https://api.github.com/users/tbaggett/orgs","repos_url":"https://api.github.com/users/tbaggett/repos","events_url":"https://api.github.com/users/tbaggett/events{/privacy}","received_events_url":"https://api.github.com/users/tbaggett/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-30T22:10:16Z","updated_at":"2015-12-05T19:20:31Z","closed_at":null,"body":"Quick question for you... I am continuing to test and ran into an issue. I am simulating situations where items are added on one device and removed on another. I am hitting an unhanded exception if I follow these steps:\r\n\r\n1. Launch my tvOS app with at least one of my EVCloudData object types in existence\r\n2. Return to main Apple TV screen but leave my app running in Xcode\r\n3. Delete the EVCloudData object record using the iCloud dashboard in a browser\r\n4. Return to my app on the Apple TV and BOOM goes the dynamite.\r\n\r\nThe unhandled exception is occurring in the EVCloudData deleteObject method. \r\n\r\n    /**\r\n     Delete an object from every data collection where it's part of\r\n     \r\n     - parameter recordId: The recordId of the object that will be deleted\r\n     :return: No return value\r\n     */\r\n    private func deleteObject(recordId: String) {\r\n        for (filter, _) in self.data {\r\n            let itemID: Int? = data[filter]!.EVindexOf {item in return item.recordID.recordName == recordId}\r\n            if itemID != nil {\r\n                data[filter]!.removeAtIndex(itemID!)\r\n                NSOperationQueue.mainQueue().addOperationWithBlock {\r\n                    (self.deletedHandlers[filter]!)(recordId: recordId, dataIndex:itemID!)\r\n                    (self.dataChangedHandlers[filter]!)()\r\n                    self.postDataDeletedNotification(filter, recordId: recordId, dataIndex: itemID!)\r\n                }\r\n                dataIsUpdated(filter)\r\n            }\r\n        }\r\n    }\r\n\r\nThis line of code is the culprit:\r\n\r\n    let itemID: Int? = data[filter]!.EVindexOf {item in return item.recordID.recordName == recordId}\r\n\r\nIt blows up when the item's recordName/recordId comparison is attempted. Here's the exception output:\r\n\r\n    2015-11-30 15:52:47.748 Marquees[1818:672274] -[__NSDictionaryM recordName]: unrecognized selector sent to instance 0x147758100\r\n    2015-11-30 15:52:47.751 Marquees[1818:672274] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM recordName]: unrecognized selector sent to instance 0x147758100'\r\n    *** First throw call stack:\r\n    (0x1857458e8 0x184db3f80 0x18574c5fc 0x1857495a0 0x18564d6cc 0x1001e18f4 0x1001e0d40 0x1001d5da4 0x1001d6278 0x1001e55f0 0x1001f2f20 0x1001db530 0x100083010 0x1000830f8 0x18a6200b0 0x18a60ef20 0x186ceb790 0x186cebb10 0x1856fcee4 0x1856fc978 0x1856fa678 0x1856296c0 0x186b34088 0x18a3d1d64 0x1000855b0 0x1851ca974)\r\n    libc++abi.dylib: terminating with uncaught exception of type NSException\r\n    Message from debugger: Terminated due to signal 6\r\n\r\nPrior to executing the problem line, I inspected the item:\r\n\r\n    Printing description of item:\r\n    (EVCloudKitDao.EVCloudKitDataObject) item = 0x00000001476fb3f0 {\r\n        EVReflection.EVObject = {\r\n            ObjectiveC.NSObject = {}\r\n        }\r\n        recordID = 0x0000000147758100 {\r\n            ObjectiveC.NSObject = {}\r\n        }\r\n        recordType = \"Performance\"\r\n        creationDate = 0x000000014775cab0 2015-11-30 21:48:51 UTC\r\n        creatorUserRecordID = Some {\r\n            Some = 0x0000000147757ec0 {\r\n                ObjectiveC.NSObject = {}\r\n            }\r\n        }\r\n        modificationDate = 0x000000014775cb20 2015-11-30 21:48:51 UTC\r\n        lastModifiedUserRecordID = Some {\r\n            Some = 0x000000014773f5e0 {\r\n                ObjectiveC.NSObject = {}\r\n            }\r\n        }\r\n        recordChangeTag = \"ihmhmw90\"\r\n        encodedSystemFields = 0 bytes {\r\n            Some = 0x000000014773f060 0 bytes\r\n        }\r\n    }\r\n\r\nHave you seen this issue before? I'm not sure if any of my recent changes would have impacted this or not."},"comment":{"url":"https://api.github.com/repos/evermeer/EVCloudKitDao/issues/comments/162238945","html_url":"https://github.com/evermeer/EVCloudKitDao/issues/35#issuecomment-162238945","issue_url":"https://api.github.com/repos/evermeer/EVCloudKitDao/issues/35","id":162238945,"user":{"login":"tbaggett","id":1326678,"avatar_url":"https://avatars.githubusercontent.com/u/1326678?v=3","gravatar_id":"","url":"https://api.github.com/users/tbaggett","html_url":"https://github.com/tbaggett","followers_url":"https://api.github.com/users/tbaggett/followers","following_url":"https://api.github.com/users/tbaggett/following{/other_user}","gists_url":"https://api.github.com/users/tbaggett/gists{/gist_id}","starred_url":"https://api.github.com/users/tbaggett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbaggett/subscriptions","organizations_url":"https://api.github.com/users/tbaggett/orgs","repos_url":"https://api.github.com/users/tbaggett/repos","events_url":"https://api.github.com/users/tbaggett/events{/privacy}","received_events_url":"https://api.github.com/users/tbaggett/received_events","type":"User","site_admin":false},"created_at":"2015-12-05T19:20:31Z","updated_at":"2015-12-05T19:20:31Z","body":"Heh, I decided to google \"CKRecordID recordName missing\" and the first link led me to http://stackoverflow.com/questions/28678060/any-drawback-if-ckrecordid-recordname-is-generated-on-client. Small world thing..."}}