2016-11-22 13 views

Répondre

2

Une solution qui peut résoudre votre problème consiste à enregistrer pour le UIApplicationDidFinishLaunchingNotification dans une méthode de chargement de classe. Par exemple.

+ (void)load { 
    NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter]; 
    [defaultCenter addObserver:self 
         selector:@selector(appDidLaunch) 
          name:UIApplicationDidFinishLaunchingNotification 
         object:nil]; 
} 

+ (void)appDidLaunch:(NSNotification *)notification { 
    NSDictionary *options = [notification userInfo]; 
    // Your code here 
} 
+0

Merci. Puis-je utiliser cette méthode pour implémenter la notification push ios? Le didacticiel suggère qu'il doit être implémenté dans le fichier AppDelegate – Jibus