Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write in Main Bundle directory. Is it allowed?

I was pretty sure that writing in the main Bundle isn't possible in iOS ... for example an operation like :

NSString *path = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"];
.....something
[xmlData writeToFile:path atomically:YES];

Why does the first example in Apple's documentation use this exact code?

like image 305
MatterGoal Avatar asked Dec 21 '11 11:12

MatterGoal


1 Answers

The example is for OS X, which isn't quite as strict with permissions as iOS.

I'd be surprised if you are able to do that for much longer (if you can at all now) in a Mac App Store application bundle, though.

It could be worth filing a bug regarding the documentation.

like image 95
jrturton Avatar answered Sep 23 '22 21:09

jrturton