Skip to content

Commit

Permalink
Merge pull request rubymotion-community#105 from simon/patch-1
Browse files Browse the repository at this point in the history
Add App to notification center.
  • Loading branch information
mattetti committed Jul 17, 2012
2 parents 6dd6d56 + 4a19e38 commit 3d38816
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -240,22 +240,22 @@ Helper methods to give NSNotificationCenter a Ruby-like interface:

```ruby
def viewWillAppear(animated)
@foreground_observer = notification_center.observe UIApplicationWillEnterForegroundNotification do |notification|
@foreground_observer = App.notification_center.observe UIApplicationWillEnterForegroundNotification do |notification|
loadAndRefresh
end

@reload_observer = notification_center.observe ReloadNotification do |notification|
@reload_observer = App.notification_center.observe ReloadNotification do |notification|
loadAndRefresh
end
end

def viewWillDisappear(animated)
notification_center.unobserve @foreground_observer
notification_center.unobserve @reload_observer
App.notification_center.unobserve @foreground_observer
App.notification_center.unobserve @reload_observer
end

def reload
notification_center.post ReloadNotification
App.notification_center.post ReloadNotification
end
```

Expand Down

0 comments on commit 3d38816

Please sign in to comment.