my application rejected due to this issue :
http://i.imgur.com/yajQh.png
My application is a dictionary which uses SQL DBs , with bookmarking and etc ... <
Your app is "crashing" because you're hitting that assert on line:
assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]);
And I suspect your problem is actually in how you are setting up the URL:
[NSURL URLWithString:@"<myApplication>/Library/Caches"];
How are you getting the path to "<myApplication>
"?
You need to get your application's true Cache's folder, which you can do via:
[NSFileManager defaultManager] URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask]; (for the location passed back via file URL's)
or
NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); (for the path in the form of a NSString)
So ultimately, what you need to do is not assert if the key has already been set in defaults and you need to properly set the file URL for the file you're saving.
Create your URL (a file URL, to be precise) using something like:
NSArray * arrayOfURLs = [[NSFileManager defaultManager] URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask];
// make certain there's at least one file url returned by the above call
if([arrayOfURLs count] > 0)
{
// and this would just be the URL to the cache directory...
NSURL * cacheDirectoryPath = [arrayOfURLs objectAtIndex: 0];
// ... to create a file url to your actual dictionary, you'd need to add a
// filename or path component.
// Assuming you save this as a property within your object
self.cacheFileURL = [cacheDirectoryPath URLByAppendingPathComponent: @"myDatabase.db"];
}