J'ai un tableau stocké dans ViewController.m. Mais quand l'application entre en arrière-plan, je veux poster des notifications à partir du tableau.Utilisation de tableau à partir de ViewController dans AppDelegate
donc mon NSMutableArray "liste" a été créée en ViewController.m mais je dois utiliser dans AppDelegate.m
- (void)applicationDidEnterBackground:(UIApplication *)application
for (NSString *thing in list) {
UILocalNotification *notif = [[UILocalNotification alloc] init];
notif.alertBody = thing.text;
[[UIApplication sharedApplication] presentLocalNotificationNow:notif];
où devrais-je mettre cela? – Brian
Le code ci-dessus devrait être mis dans le délégué de l'application ... Mais vous devriez faire ce que j'ai dit à propos de NSUserDefaults à la place. –