diff --git a/iCadeTest/iCade/iCadeReaderView.m b/iCadeTest/iCade/iCadeReaderView.m index 019b70c..e2e70c8 100644 --- a/iCadeTest/iCade/iCadeReaderView.m +++ b/iCadeTest/iCade/iCadeReaderView.m @@ -40,14 +40,16 @@ - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; inputView = [[UIView alloc] initWithFrame:CGRectZero]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil]; + if (&UIApplicationDidEnterBackgroundNotification) + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; return self; } - (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil]; + if (&UIApplicationDidEnterBackgroundNotification) + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil]; [super dealloc]; }