mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Closes gh-47. Initial implementation of OS X build integrating changes submitted by Felix Holmgren (https://github.com/Felixyz/RestKit).
* Factored out display of alerts into RKAlert interface that hides the differences between UIKit and OS X Cocoa. * Added macosx to supported platforms to enable build on OS X. * Configured project to use conditional architectures to enable building on OS X and iOS from the same targets. * Implemented a bare-bones OS X example app. * Create `rake build` task for building RestKit against iOS and OS X SDK for quick testing.
This commit is contained in:
@@ -6,7 +6,10 @@
|
||||
// Copyright 2010 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
||||
|
||||
#import "RKRequestQueue.h"
|
||||
#import "RKResponse.h"
|
||||
#import "RKNotifications.h"
|
||||
@@ -40,7 +43,7 @@ static const NSInteger kMaxConcurrentLoads = 5;
|
||||
_requests = [[NSMutableArray alloc] init];
|
||||
_suspended = NO;
|
||||
_totalLoading = 0;
|
||||
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(responseDidLoad:)
|
||||
name:RKResponseReceivedNotification
|
||||
@@ -49,6 +52,7 @@ static const NSInteger kMaxConcurrentLoads = 5;
|
||||
selector:@selector(responseDidLoad:)
|
||||
name:RKRequestFailedWithErrorNotification
|
||||
object:nil];
|
||||
#if TARGET_OS_IPHONE
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(willTransitionToBackground)
|
||||
name:UIApplicationDidEnterBackgroundNotification
|
||||
@@ -57,6 +61,7 @@ static const NSInteger kMaxConcurrentLoads = 5;
|
||||
selector:@selector(willTransitionToForeground)
|
||||
name:UIApplicationWillEnterForegroundNotification
|
||||
object:nil];
|
||||
#endif
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user