Application Will Enter Foreground Notification and memory

Roy Marmelstein picture Roy Marmelstein · Apr 13, 2011 · Viewed 7.8k times · Source

I'm adding my View Controller as a listener to UIApplicationWillEnterForegroundNotification in my viewDidLoad function (as recommended on previous questions here):

if(&UIApplicationWillEnterForegroundNotification != nil)
    {
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myFunc) name:UIApplicationWillEnterForegroundNotification object:nil];
    }
    }

The problem is that when debugging the application through Instruments it appears this line of code is extremely memory consuming. Any thoughts as to why and how to make it more effective?

Answer