<< | Index | >>
Currently got this error.
Maybe URL path has problem.
2013-09-25 11:52:03.325 generika[1714:60b] -[ProductManager storeBarcode:ofEan:] [Line 158] itemAtURL #=> file:///var/mobile/Applications/BF151CD8-6BB9-484C-BAA1-9BBEEC502A3B/Documents/barcodes/7680451140154_1380077523.png 2013-09-25 11:52:03.327 generika[1714:60b] -[ProductManager storeBarcode:ofEan:] [Line 159] barcodesDir #=> file:///private/var/mobile/Library/Mobile%20Documents/4B37356EGR~org~oddb~generika/Documents/barcodes/7680451140154_1380077523.png 2013-09-25 11:52:03.334 generika[1714:60b] -[ProductManager storeBarcode:ofEan:] [Line 161] error #=> The operation couldn’t be completed. (Cocoa error 4.)
After create of directory "barcodes" in iCloud stroge, save works.
# move file to iCloud saved = [fileManager setUbiquitous:true itemAtURL:[NSURL fileURLWithPath:filePath] destinationURL:[dir URLByAppendingPathComponent:fileName] error:&error]; # copy local file to iCloud NSString *fileName = [filePath lastPathComponent]; saved = [fileManager copyItemAtURL:[NSURL fileURLWithPath:filePath] toURL:[dir URLByAppendingPathComponent:fileName] error:&error];
I copied image in async
block.
used removeAtItemURL:error
of NSFileManager.
NSURL *dir = [[ubiq URLByAppendingPathComponent:@"Documents" isDirectory:YES] URLByAppendingPathComponent:directory isDirectory:YES]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error = nil; saved = [fileManager removeItemAtURL:[dir URLByAppendingPathComponent:fileName] error:&error];
Create Sync switch in settings. This value is stored in NSUserDefault.
continue to weekend.