Вопрос

NSString *path = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"favorites.plist"];

BOOL canWrite = [arr writeToFile:path atomically:YES];// arr is an NSArray

I got canWrite = NO. Did some research which says that the main bundle is readonly. Is there a way to make the mainbundle files readwrite?

Thanks,

Это было полезно?

Решение

No, this is not possible. This would mean that you change your binary and add features that apple would have rejected your app for in review.

Just copy any file from you mainBundle to the documents directory and save changes to that file.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top