Я слишком долго пытался выяснить, что происходит не так, поэтому я надеюсь, что кто-то ее сможет мне помочь.Нужна помощь с iphone sdk: не правильно сохранить каталог .plist в документах
Мой код:
- (IBAction)fedDog {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"dogsFedDays.plist"];
NSMutableArray *dogsFedSave = [[NSMutableArray alloc] arrayWithCapacity: 48];
for (int i = 0; i < 48; i++) {
NSDictionary *myDict = [[NSDictionary alloc] initWithObjectsAndKeys:
date[i], @"string",
fed[i], @"Yes",
nil];
[dogsFedSave addObject:myDict];
[myDict release];
}
if (![dogsFedSave writeToFile:path atomically:YES])
NSLog(@"not successful in completing this task");
}
Я подключил действие к кнопке, но при нажатии на кнопку, Тренажер замерзает, и файл не появляется в папке Documents.
Дон» t спросить о двух несвязанных проблемах в одном вопросе – hop