{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/2421","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2421/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2421/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2421/events","html_url":"https://github.com/realm/realm-cocoa/issues/2421","id":102287156,"number":2421,"title":"Really Strange Thing!!! I got results from an non-exist realm.(How to delete .realm file correctly)","user":{"login":"Onetaway","id":3251826,"avatar_url":"https://avatars.githubusercontent.com/u/3251826?v=3","gravatar_id":"","url":"https://api.github.com/users/Onetaway","html_url":"https://github.com/Onetaway","followers_url":"https://api.github.com/users/Onetaway/followers","following_url":"https://api.github.com/users/Onetaway/following{/other_user}","gists_url":"https://api.github.com/users/Onetaway/gists{/gist_id}","starred_url":"https://api.github.com/users/Onetaway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Onetaway/subscriptions","organizations_url":"https://api.github.com/users/Onetaway/orgs","repos_url":"https://api.github.com/users/Onetaway/repos","events_url":"https://api.github.com/users/Onetaway/events{/privacy}","received_events_url":"https://api.github.com/users/Onetaway/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/Help","name":"Help","color":"cc317c"},{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/pending","name":"pending","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-08-21T03:16:20Z","updated_at":"2015-09-29T21:59:49Z","closed_at":"2015-09-29T21:59:49Z","body":"I want to implement Clear Cache function. My idea is delete all the realm files in specific directory. At first it created a realm, then I deleted it. Next time, first I should check if cache existed, Here strange thing happens. I got results from the file I deleted. Hope anyone can help.\r\n\r\nHere is the code:\r\n\r\n```\r\nNSString *realmName = [NSString stringWithFormat:@\"%@/%ld+%@.realm\", kBZLocalCacheDirectory ,(long)self.category.categoryID, self.category.name];\r\n\r\nNSString *realmPath = [FCFileManager pathForDocumentsDirectoryWithPath:realmName];\r\n    \r\n    if ([[NSFileManager defaultManager] fileExistsAtPath:realmPath]) {\r\n        MDLog(@\"realm exists\");\r\n    } else {\r\n        MDLog(@\"realm not exists\");\r\n    }\r\n\r\nRLMRealm *realm = [RLMRealm realmWithPath:realmPath];\r\n```\r\n\r\nThe `realmPath` file is not exists, but I still get results from `realm` according to \r\n\r\n```\r\nRLMResults *results = [XXX objectsInRealm:realm withPredicate:nil];\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/144203429","html_url":"https://github.com/realm/realm-cocoa/issues/2421#issuecomment-144203429","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2421","id":144203429,"user":{"login":"jpsim","id":474794,"avatar_url":"https://avatars.githubusercontent.com/u/474794?v=3","gravatar_id":"","url":"https://api.github.com/users/jpsim","html_url":"https://github.com/jpsim","followers_url":"https://api.github.com/users/jpsim/followers","following_url":"https://api.github.com/users/jpsim/following{/other_user}","gists_url":"https://api.github.com/users/jpsim/gists{/gist_id}","starred_url":"https://api.github.com/users/jpsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpsim/subscriptions","organizations_url":"https://api.github.com/users/jpsim/orgs","repos_url":"https://api.github.com/users/jpsim/repos","events_url":"https://api.github.com/users/jpsim/events{/privacy}","received_events_url":"https://api.github.com/users/jpsim/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T21:59:49Z","updated_at":"2015-09-29T21:59:49Z","body":"Closing since we never heard back."}}