как записать данные XML в файл plist в iphone? я использую этот код
`Я использую этот код
- (void) connectionDidFinishLoading: (NSURLConnection *) соединение
{
NSString *thexml=[[NSString alloc] initWithBytes:[webdata mutableBytes] length:[webdata length] encoding:NSASCIIStringEncoding];
NSArray *paths = NSSearchPathForDirectoriesInDomains
(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
//make a file name to write the data to using the documents directory:
// NSString * path = [[NSBundle mainBundle] pathForResource: @ "mySettings" ofType: @ "plist"];
NSString * fileName = [NSString stringWithFormat: @ "% @ / textfile.plist",
documentsDirectory];
//create content - four lines of text
//NSString *content = @"One\nTwo\nThree\nFour\nFive";
NSString *content =thexml;
NSLog(@"%@",thexml);
//save content to the documents directory
[content writeToFile:fileName
atomically:YES
encoding:NSStringEncodingConversionAllowLossy
error:nil];
[self writePlist: 1 fileName: thexml];
[релиз xxml];
[освобождение соединения]; `
но я вижу, что plist-файл, который отображает файл, является curuupted. ?? Пожалуйста, дайте мне решение ....
заранее спасибо