Опитвам се да създам множество локални известия в моето приложение, но по някаква причина се появява само първото изскачащо известие, останалите просто не работят, това е моят код.
Имам клас с име criaAlertas, който отговаря за създаването на известията, в този клас имам следния метод:
-(void)setarNotificacao:(NSInteger)quando nome:(UILocalNotification *)notification
{
UIApplication *myapp = [UIApplication sharedApplication];
notification.fireDate = [NSDate dateWithTimeIntervalSinceNow:quando];
notification.alertBody = @"Nice";
notification.timeZone = [NSTimeZone defaultTimeZone];
notification.soundName = UILocalNotificationDefaultSoundName;
NSMutableArray *arrayOfNOtifications = [[NSMutableArray alloc]init];
[arrayOfNOtifications addObject:notification];
myapp.scheduledLocalNotifications = arrayOfNOtifications;
}
Така че аз инстанцирах обект от този клас и се опитах да направя това:
criaAlertas *novoAlerta = [[criaAlertas alloc]init];
UILocalNotification *notaUm = [[UILocalNotification alloc]init];
UILocalNotification *notaDois = [[UILocalNotification alloc]init];
[novoAlerta setarNotificacao:15 nome:notaUm];
[novoAlerta setarNotificacao:30 nome:notaDois];
Какво правя грешно?