Я пытаюсь отправить несколько локальных уведомлений, используя запрос на выборку для объекта. И хотя этот код работает нормально
NSFetchRequest *myRequest = [[NSFetchRequest alloc] init];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"active == YES"];
[myRequest setEntity:[NSEntityDescription entityForName:@"Entry" inManagedObjectContext:managedObjectContext]];
[myRequest setPredicate:predicate];
NSError *error = nil;
NSArray *fetchedObjects = [self.managedObjectContext executeFetchRequest: myRequest error: &error];
if (fetchedObjects == nil){
// Deal with error...
}
// We fill the NSMutableArray with the values of the fetch
self.activeList = [[NSMutableArray alloc] initWithArray:[fetchedObjects valueForKey:@"textbody"]];
[self scheduleAlarms:[self.activeList objectAtIndex:0]];
[fetchedObjects release]; //this line crashes the app
1), если я выпускаю fetchedObjects, приложение вылетает.Разве я не должен выпускать его?
2) Могу ли я использовать localNotif.userinfo для оптимизации кода вместо вызова метода для планирования каждого localNotification со строками в моем activeList?Я не могу понять, как это сделать.
Спасибо,
Майк