2012-04-12 3 views
3

iPhoneのドキュメントフォルダにアプリ内購入データを保存するため、自分のアプリが拒否されました。NSURLIsExcludedFromBackupKeyまたはkCFURLIsExcludedFromBackupKeyの使用方法は?

Data that can be recreated but must persist for proper functioning of your app - or because customers expect it to be available for offline use - should be marked with the "do not back up" attribute. For NSURL objects, add the NSURLIsExcludedFromBackupKey attribute to prevent the corresponding file from being backed up. For CFURLRef objects, use the corresponding kCFURLIsExcludedFromBackupKey attribute.

は、しかし、私は、彼らがオフラインになっている場合でも、ユーザーがデータを使用したいので、私はkCFURLIsExcludedFromBackupKeyまたはNSURLIsExcludedFromBackupKey使用します。彼らの違いは何ですか?

質問は、それらのいずれかを使用する方法であり、それは何を返し、どのように私は、これはデータを返さ使用することができますか?

答えて

5
NSError *error = nil; 

BOOL result = [fileURL setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&error]; 
+1

、その後、私は通常、URLからデータを取得します?それはそれです..私は結果とどうすればいいですか? –

+0

'if(結果==いいえ){NSLog(@"エラー:%@ "、エラー); } ' –

関連する問題