开发者

can i update my local text file on iphone

开发者 https://www.devze.com 2023-01-10 17:31 出处:网络
i have atext file so can i update this text开发者_如何学运维 file from web ??? lets say i have

i have a text file so can i update this text开发者_如何学运维 file from web ??? lets say i have

   1. NSString *filePath = [[NSBundle mainBundle] pathForResource:@"MyFile" ofType:@"txt"];  
   2. NSData *myData = [NSData dataWithContentsOfFile:filePath];  
   3. if (myData) {  
   4.     // do something useful  
   5. } 

right now Myfile.text is having 10 data so how to insert 10 more to this data??

plz help


Files stored inside your app bundle will not be writable.

You will have to make a copy of the file and store it in the Documents or Library folder before you will be able to edit it.

0

精彩评论

暂无评论...
验证码 换一张
取 消