65 userInfo:nil |
65 userInfo:nil |
66 repeats:YES]; |
66 repeats:YES]; |
67 |
67 |
68 // add timer too runloop, otherwise it doesn't work |
68 // add timer too runloop, otherwise it doesn't work |
69 [[NSRunLoop currentRunLoop] addTimer:dimTimer forMode:NSDefaultRunLoopMode]; |
69 [[NSRunLoop currentRunLoop] addTimer:dimTimer forMode:NSDefaultRunLoopMode]; |
70 // listen for dismissal of the popover (see below)x |
70 |
71 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dismissPopover) name:@"dismissPopover" object:nil]; |
71 // listen for dismissal of the popover (see below) |
|
72 [[NSNotificationCenter defaultCenter] addObserver:self |
|
73 selector:@selector(dismissPopover) |
|
74 name:@"dismissPopover" |
|
75 object:nil]; |
72 // present the overlay after 2 seconds |
76 // present the overlay after 2 seconds |
73 [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(showMenuAfterwards) userInfo:nil repeats:NO]; |
77 [NSTimer scheduledTimerWithTimeInterval:2 |
|
78 target:self |
|
79 selector:@selector(showMenuAfterwards) |
|
80 userInfo:nil |
|
81 repeats:NO]; |
74 } |
82 } |
75 |
83 |
76 -(void) viewDidUnload { |
84 -(void) viewDidUnload { |
77 [dimTimer invalidate]; |
|
78 self.dimTimer = nil; |
|
79 self.popoverController = nil; |
85 self.popoverController = nil; |
80 self.popupMenu = nil; |
86 self.popupMenu = nil; |
81 [super viewDidUnload]; |
87 [super viewDidUnload]; |
82 } |
88 } |
83 |
89 |
84 -(void) dealloc { |
90 -(void) dealloc { |
|
91 [dimTimer invalidate]; |
85 [popupMenu release]; |
92 [popupMenu release]; |
86 [popoverController release]; |
93 [popoverController release]; |
87 // dimTimer is autoreleased |
94 // dimTimer is autoreleased |
88 [super dealloc]; |
95 [super dealloc]; |
89 } |
96 } |