Wednesday 15 May 2013

objective c - NSURLIsExcludedFromBackupKey does not work on iOS 8 -


after

I use the standard method for leaving the backup:

  + (bool) addSkipBackupAttributeToItemAtURL :( inclusion NSURL *) URL (emphasis [([[NSFileManager default manager] Failaksstappth: [url path]]); NSError * error = nil; BOOL success = [URL Setarssorsvalu: @ (Yes) of: Ansuaraielai for Error of backpack: & amp; Error; if (! Success) {NSLog (@ "error except% @ from backup% @", [URL's last Gather blanket], error);} Return to Success;}  

As some people have suggested that I use this method [NSUr fileURLWithPath: Path] to do well but it does not work:

except error groups.xml backup error domain = NSCocoaErrorDomain code = 513 "Не удалось завершить операцию. (Cocoa, 513 ошибка)" from

UserInfo = 0x170272ac0 {

NSURL = file: /// private / var / mobile / Containers / Bundle / Application / 59286088 -C226-4653-A84F-A4B5D40C11DE / anatomyfree.app / groups.xml, NSFilePath = / private / var / mobile / container / bundle / Away Not / 59286088-C226-4653-A84F-A4B5D40C11DE / anatomyfree.app / groups.xml, NSUnderlyingError = 0x1702492a0 "Не удалось завершить операцию. Action is not allowed "}

This file exists. It is parsed but it can not be removed from backup. What is the reason for this?

I use iOS 8.2, iPhone 6, ru location

There is a method call :.

  NSString * path = [[Ansbindl main bundle] name Pthfosr resource file type: extension]; ns URL * url = [Ansuar file URL Vithpathः path] [Utilities addSkipBackupAttributeToItemAtURL: url];  

Try it, it works perfectly for me in iOS 8:

  NSString * documentsPath = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, Yes) objectAtIndex: 0 ]; NSURL * url = [Ansuar file URL Vithpath: [NSString stringWithFormat: @ "% @ /% @.% @", Dastavejpath, filename, extension]] [Utilities addSkipBackupAttributeToItemAtURL: url];  

No comments:

Post a Comment