Permalink
Browse files

[UINavigator] Use a weak_import decl to avoid warnings with multitask…

…ing.

By declaring the string constant UIApplicationDidEnterBackgroundNotification
with weak_import we can avoid having to use a hard-coded string.

Thanks to davidmorford for the heads up.
http://github.com/Three20/Three20/commit/2607677769203c82a3adec73db84912d66e6411d#comments
  • Loading branch information...
jverkoey committed Jul 23, 2010
1 parent 811d75f commit d9712db594d1b11d0e5bd5cc1f332535e6587957
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/Three20UINavigator/Sources/TTBaseNavigator.m
@@ -44,6 +44,9 @@
static NSString* kNavigatorHistoryTimeKey = @"TTNavigatorHistoryTime";
static NSString* kNavigatorHistoryImportantKey = @"TTNavigatorHistoryImportant";
UIKIT_EXTERN NSString *const UIApplicationDidEnterBackgroundNotification __attribute__((weak_import));
UIKIT_EXTERN NSString *const UIApplicationWillEnterForegroundNotification __attribute__((weak_import));
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -71,10 +74,9 @@ - (id)init {
selector:@selector(applicationWillLeaveForeground:)
name:UIApplicationWillTerminateNotification
object:nil];
// XXX the notification name is a string because the symbol is unavailable pre-OS 4.0
[center addObserver:self
selector:@selector(applicationWillLeaveForeground:)
name:@"UIApplicationDidEnterBackgroundNotification"
name:UIApplicationDidEnterBackgroundNotification
object:nil];
}
return self;

0 comments on commit d9712db

Please sign in to comment.