merge before the storm
|
|
@ -1,11 +1,11 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'AFNetworking'
|
||||
s.version = '1.0RC1'
|
||||
s.version = '0.10.0'
|
||||
s.license = 'MIT'
|
||||
s.summary = 'A delightful iOS and OS X networking framework'
|
||||
s.homepage = 'https://github.com/AFNetworking/AFNetworking'
|
||||
s.authors = {'Mattt Thompson' => 'm@mattt.me', 'Scott Raymond' => 'sco@gowalla.com'}
|
||||
s.source = { :git => 'https://github.com/AFNetworking/AFNetworking.git', :tag => '1.0RC1' }
|
||||
s.source = { :git => 'https://github.com/AFNetworking/AFNetworking.git', :tag => '0.10.0' }
|
||||
s.source_files = 'AFNetworking'
|
||||
s.clean_paths = ['iOS Example', 'Mac Example', 'AFNetworking.xcworkspace']
|
||||
s.framework = 'SystemConfiguration'
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:iOS Example/AFNetworking iOS Example.xcodeproj">
|
||||
location = "group:Example/AFNetworking iOS Example.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Mac Example/AFNetworking Mac Example.xcodeproj">
|
||||
location = "group:Example/AFNetworking Mac Example.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
|
|||
|
|
@ -454,6 +454,10 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
|||
[request setHTTPMethod:method];
|
||||
[request setAllHTTPHeaderFields:self.defaultHeaders];
|
||||
|
||||
if ([method isEqualToString:@"GET"] || [method isEqualToString:@"HEAD"]) {
|
||||
[request setHTTPShouldUsePipelining:YES];
|
||||
}
|
||||
|
||||
if (parameters) {
|
||||
if ([method isEqualToString:@"GET"] || [method isEqualToString:@"HEAD"] || [method isEqualToString:@"DELETE"]) {
|
||||
url = [NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:[path rangeOfString:@"?"].location == NSNotFound ? @"?%@" : @"&%@", AFQueryStringFromParametersWithEncoding(parameters, self.stringEncoding)]];
|
||||
|
|
@ -488,6 +492,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
|||
NSMutableURLRequest *request = [self requestWithMethod:method path:path parameters:nil];
|
||||
__block AFMultipartFormData *formData = [[[AFMultipartFormData alloc] initWithURLRequest:request stringEncoding:self.stringEncoding] autorelease];
|
||||
|
||||
if (parameters) {
|
||||
for (AFQueryStringComponent *component in AFQueryStringComponentsFromKeyAndValue(nil, parameters)) {
|
||||
NSData *data = nil;
|
||||
if ([component.value isKindOfClass:[NSData class]]) {
|
||||
|
|
@ -500,6 +505,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
|||
[formData appendPartWithFormData:data name:[component.key description]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (block) {
|
||||
block(formData);
|
||||
|
|
@ -873,6 +879,7 @@ static inline NSString * AFMultipartFormFinalBoundary() {
|
|||
if ([data length] == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ([self.outputStream hasSpaceAvailable]) {
|
||||
const uint8_t *dataBuffer = (uint8_t *) [data bytes];
|
||||
[self.outputStream write:&dataBuffer[0] maxLength:[data length]];
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ static id AFStaticClassValueImplementation(id self, SEL _cmd) {
|
|||
}
|
||||
|
||||
+ (BOOL)canProcessRequest:(NSURLRequest *)request {
|
||||
if (![[self class] isEqual:[AFHTTPRequestOperation class]]) {
|
||||
if ([[self class] isEqual:[AFHTTPRequestOperation class]]) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,13 +23,12 @@
|
|||
#import "AFNetworkActivityIndicatorManager.h"
|
||||
|
||||
#import "AFHTTPRequestOperation.h"
|
||||
#import <libkern/OSAtomic.h>
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.25;
|
||||
|
||||
@interface AFNetworkActivityIndicatorManager ()
|
||||
@property (readwrite, nonatomic, assign) NSInteger activityCount;
|
||||
@property (readwrite, atomic, assign) NSInteger activityCount;
|
||||
@property (readwrite, nonatomic, retain) NSTimer *activityIndicatorVisibilityTimer;
|
||||
@property (readonly, getter = isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;
|
||||
|
||||
|
|
@ -97,25 +96,31 @@ static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.25;
|
|||
}
|
||||
|
||||
// Not exposed, but used if activityCount is set via KVC.
|
||||
- (NSInteger)activityCount {
|
||||
return _activityCount;
|
||||
}
|
||||
|
||||
- (void)setActivityCount:(NSInteger)activityCount {
|
||||
__sync_swap(&_activityCount, activityCount);
|
||||
@synchronized(self) {
|
||||
_activityCount = activityCount;
|
||||
}
|
||||
[self updateNetworkActivityIndicatorVisibilityDelayed];
|
||||
}
|
||||
|
||||
- (void)incrementActivityCount {
|
||||
[self willChangeValueForKey:@"activityCount"];
|
||||
OSAtomicIncrement32((int32_t*)&_activityCount);
|
||||
@synchronized(self) {
|
||||
_activityCount++;
|
||||
}
|
||||
[self didChangeValueForKey:@"activityCount"];
|
||||
[self updateNetworkActivityIndicatorVisibilityDelayed];
|
||||
}
|
||||
|
||||
- (void)decrementActivityCount {
|
||||
[self willChangeValueForKey:@"activityCount"];
|
||||
bool success;
|
||||
do {
|
||||
int32_t currentCount = _activityCount;
|
||||
success = OSAtomicCompareAndSwap32(currentCount, MIN(currentCount - 1, currentCount), &_activityCount);
|
||||
} while(!success);
|
||||
@synchronized(self) {
|
||||
_activityCount--;
|
||||
}
|
||||
[self didChangeValueForKey:@"activityCount"];
|
||||
[self updateNetworkActivityIndicatorVisibilityDelayed];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,40 +34,41 @@
|
|||
@interface UIImageView (AFNetworking)
|
||||
|
||||
/**
|
||||
Creates and enqueues an image request operation, which asynchronously downloads the image from the specified URL, and sets it the request is finished. If the image is cached locally, the image is set immediately, otherwise, the image is set once the request is finished.
|
||||
Creates and enqueues an image request operation, which asynchronously downloads the image from the specified URL, and sets it the request is finished. Any previous image request for the receiver will be cancelled. If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
|
||||
|
||||
@discussion By default, url requests have a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set to use HTTP pipelining, and not handle cookies. To configure url requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
|
||||
@discussion By default, URL requests have a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set to use HTTP pipelining, and not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
|
||||
|
||||
@param url The URL used for the image request.
|
||||
*/
|
||||
- (void)setImageWithURL:(NSURL *)url;
|
||||
|
||||
/**
|
||||
Creates and enqueues an image request operation, which asynchronously downloads the image from the specified URL. If the image is cached locally, the image is set immediately. Otherwise, the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
|
||||
Creates and enqueues an image request operation, which asynchronously downloads the image from the specified URL. Any previous image request for the receiver will be cancelled. If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
|
||||
|
||||
@param url The URL used for the image request.
|
||||
@param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
|
||||
|
||||
@discussion By default, url requests have a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set to use HTTP pipelining, and not handle cookies. To configure url requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
|
||||
@discussion By default, URL requests have a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set to use HTTP pipelining, and not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
|
||||
*/
|
||||
- (void)setImageWithURL:(NSURL *)url
|
||||
placeholderImage:(UIImage *)placeholderImage;
|
||||
|
||||
/**
|
||||
Creates and enqueues an image request operation, which asynchronously downloads the image with the specified url request object. If the image is cached locally, the image is set immediately. Otherwise, the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
|
||||
Creates and enqueues an image request operation, which asynchronously downloads the image with the specified URL request object. Any previous image request for the receiver will be cancelled. If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
|
||||
|
||||
@param urlRequest The url request used for the image request.
|
||||
@param urlRequest The URL request used for the image request.
|
||||
@param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
|
||||
@param success A block to be executed when the image request operation finishes successfully, with a status code in the 2xx range, and with an acceptable content type (e.g. `image/png`). This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the request and response parameters will be `nil`.
|
||||
@param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
|
||||
|
||||
@discussion By default, url requests have a cache policy of `NSURLRequestUseProtocolCachePolicy` and a timeout interval of 30 seconds, and are set to use HTTP pipelining, and not handle cookies. To configure url requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
|
||||
*/
|
||||
- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
|
||||
placeholderImage:(UIImage *)placeholderImage
|
||||
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
|
||||
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure;
|
||||
|
||||
/**
|
||||
Cancels any executing image request operation for the receiver, if one exists.
|
||||
*/
|
||||
- (void)cancelImageRequestOperation;
|
||||
|
||||
@end
|
||||
|
|
|
|||
65
CHANGES
|
|
@ -1,3 +1,68 @@
|
|||
= 0.10.0 / 2012-06-26
|
||||
|
||||
* Add Twitter Mac Example application (Mattt Thompson)
|
||||
|
||||
* Add note in README about how to set `-fno-objc-arc` flag for multiple files
|
||||
at once (Pål Brattberg)
|
||||
|
||||
* Add note in README about 64-bit architecture requirement (@rmuginov, Mattt
|
||||
Thompson)
|
||||
|
||||
* Add note in `AFNetworkActivityIndicatorManager` about not having to manually
|
||||
manage animation state (Mattt Thompson)
|
||||
|
||||
* Add missing block parameter name for `imageProcessingBlock` (Francois
|
||||
Lambert)
|
||||
|
||||
* Add NextiveJson to list of supported JSON libraries (Mattt Thompson)
|
||||
|
||||
* Restore iOS 4.0 compatibility with `addAcceptableStatusCodes:` and
|
||||
`addAcceptableContentTypes:` (Zachary Waldowski)
|
||||
|
||||
* Update `AFHTTPClient` to use HTTP pipelining for `GET` and `HEAD` requests by
|
||||
default (Mattt Thompson)
|
||||
|
||||
* Remove @private ivar declaration in headers (Peter Steinberger, Mattt
|
||||
Thompson)
|
||||
|
||||
* Fix potential premature deallocation of _skippedCharacterSet (Tom Wanielista,
|
||||
Mattt Thompson)
|
||||
|
||||
* Fix potential issue in `setOutputStream` by closing any existing
|
||||
`outputStream` (Mattt Thompson)
|
||||
|
||||
* Fix filename in AFHTTPClient header (Steven Fisher)
|
||||
|
||||
* Fix documentation for UIImageView+AFNetworking (Mattt Thompson)
|
||||
|
||||
* Fix HTTP multipart form format, which caused issues with Tornado web server
|
||||
(Matt Chen)
|
||||
|
||||
* Fix `AFHTTPClient` to not append empty data into multipart form data (Jon
|
||||
Parise)
|
||||
|
||||
* Fix URL encoding normalization to not conditionally escape percent-encoded
|
||||
strings (João Prado Maia, Kendall Helmstetter Gelner, @cysp, Mattt Thompson)
|
||||
|
||||
* Fix `AFHTTPClient` documentation reference of
|
||||
`HTTPRequestOperationWithRequest:success:failure` (Shane Vitarana)
|
||||
|
||||
* Add `AFURLRequestOperation -setRedirectResponseBlock:` (Kevin Harwood)
|
||||
|
||||
* Fix `AFURLConnectionOperation` compilation error by conditionally importing
|
||||
UIKit framework (Steven Fisher)
|
||||
|
||||
* Fix issue where image processing block is not called correctly with success
|
||||
block in `AFImageRequestOperation` (Sergey Gavrilyuk)
|
||||
|
||||
* Fix leaked dispatch group in batch operations (@andyegorov, Mattt Thompson)
|
||||
|
||||
* Fix support for non-LLVM compilers in `AFNetworkActivityIndicatorManager`
|
||||
(Abraham Vegh, Bill Williams, Mattt Thompson)
|
||||
|
||||
* Fix AFHTTPClient to not add unnecessary data when constructing multipart form
|
||||
request with nil parameters (Taeho Kim)
|
||||
|
||||
= 1.0RC1 / 2012-04-25
|
||||
|
||||
* Add `AFHTTPRequestOperation +addAcceptableStatusCodes /
|
||||
|
|
|
|||
355
Example/AFNetworking Mac Example.xcodeproj/project.pbxproj
Normal file
|
|
@ -0,0 +1,355 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
F8129C001591061B009BFE23 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8129BFF1591061B009BFE23 /* Cocoa.framework */; };
|
||||
F8129C321591073C009BFE23 /* AFTwitterAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C251591073C009BFE23 /* AFTwitterAPIClient.m */; };
|
||||
F8129C341591073C009BFE23 /* Tweet.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C2B1591073C009BFE23 /* Tweet.m */; };
|
||||
F8129C351591073C009BFE23 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C2D1591073C009BFE23 /* User.m */; };
|
||||
F8129C631591090B009BFE23 /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C4F1591090B009BFE23 /* AFHTTPClient.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F8129C641591090B009BFE23 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C511591090B009BFE23 /* AFHTTPRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F8129C651591090B009BFE23 /* AFImageRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C531591090B009BFE23 /* AFImageRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F8129C661591090B009BFE23 /* AFJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C551591090B009BFE23 /* AFJSONRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F8129C671591090B009BFE23 /* AFJSONUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C571591090B009BFE23 /* AFJSONUtilities.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F8129C681591090B009BFE23 /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C591591090B009BFE23 /* AFNetworkActivityIndicatorManager.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F8129C691591090B009BFE23 /* AFPropertyListRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C5C1591090B009BFE23 /* AFPropertyListRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F8129C6A1591090B009BFE23 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C5E1591090B009BFE23 /* AFURLConnectionOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F8129C6B1591090B009BFE23 /* AFXMLRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C601591090B009BFE23 /* AFXMLRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F8129C6C1591090B009BFE23 /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C621591090B009BFE23 /* UIImageView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F8129C6F15910B15009BFE23 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C6E15910B15009BFE23 /* main.m */; };
|
||||
F8129C7115910B3E009BFE23 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8129C7015910B3E009BFE23 /* MainMenu.xib */; };
|
||||
F8129C7715910C40009BFE23 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C7515910C40009BFE23 /* AppDelegate.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
F8129BFB1591061B009BFE23 /* AFNetworking Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AFNetworking Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F8129BFF1591061B009BFE23 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
F8129C021591061B009BFE23 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
F8129C031591061B009BFE23 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
|
||||
F8129C041591061B009BFE23 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
F8129C251591073C009BFE23 /* AFTwitterAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFTwitterAPIClient.m; path = Classes/AFTwitterAPIClient.m; sourceTree = SOURCE_ROOT; };
|
||||
F8129C2A1591073C009BFE23 /* Tweet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tweet.h; sourceTree = "<group>"; };
|
||||
F8129C2B1591073C009BFE23 /* Tweet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Tweet.m; sourceTree = "<group>"; };
|
||||
F8129C2C1591073C009BFE23 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = "<group>"; };
|
||||
F8129C2D1591073C009BFE23 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = "<group>"; };
|
||||
F8129C311591073C009BFE23 /* AFTwitterAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFTwitterAPIClient.h; path = Classes/AFTwitterAPIClient.h; sourceTree = SOURCE_ROOT; };
|
||||
F8129C4E1591090B009BFE23 /* AFHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFHTTPClient.h; path = ../AFNetworking/AFHTTPClient.h; sourceTree = "<group>"; };
|
||||
F8129C4F1591090B009BFE23 /* AFHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFHTTPClient.m; path = ../AFNetworking/AFHTTPClient.m; sourceTree = "<group>"; };
|
||||
F8129C501591090B009BFE23 /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFHTTPRequestOperation.h; path = ../AFNetworking/AFHTTPRequestOperation.h; sourceTree = "<group>"; };
|
||||
F8129C511591090B009BFE23 /* AFHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFHTTPRequestOperation.m; path = ../AFNetworking/AFHTTPRequestOperation.m; sourceTree = "<group>"; };
|
||||
F8129C521591090B009BFE23 /* AFImageRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFImageRequestOperation.h; path = ../AFNetworking/AFImageRequestOperation.h; sourceTree = "<group>"; };
|
||||
F8129C531591090B009BFE23 /* AFImageRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFImageRequestOperation.m; path = ../AFNetworking/AFImageRequestOperation.m; sourceTree = "<group>"; };
|
||||
F8129C541591090B009BFE23 /* AFJSONRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFJSONRequestOperation.h; path = ../AFNetworking/AFJSONRequestOperation.h; sourceTree = "<group>"; };
|
||||
F8129C551591090B009BFE23 /* AFJSONRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFJSONRequestOperation.m; path = ../AFNetworking/AFJSONRequestOperation.m; sourceTree = "<group>"; };
|
||||
F8129C561591090B009BFE23 /* AFJSONUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFJSONUtilities.h; path = ../AFNetworking/AFJSONUtilities.h; sourceTree = "<group>"; };
|
||||
F8129C571591090B009BFE23 /* AFJSONUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFJSONUtilities.m; path = ../AFNetworking/AFJSONUtilities.m; sourceTree = "<group>"; };
|
||||
F8129C581591090B009BFE23 /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFNetworkActivityIndicatorManager.h; path = ../AFNetworking/AFNetworkActivityIndicatorManager.h; sourceTree = "<group>"; };
|
||||
F8129C591591090B009BFE23 /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFNetworkActivityIndicatorManager.m; path = ../AFNetworking/AFNetworkActivityIndicatorManager.m; sourceTree = "<group>"; };
|
||||
F8129C5A1591090B009BFE23 /* AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFNetworking.h; path = ../AFNetworking/AFNetworking.h; sourceTree = "<group>"; };
|
||||
F8129C5B1591090B009BFE23 /* AFPropertyListRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFPropertyListRequestOperation.h; path = ../AFNetworking/AFPropertyListRequestOperation.h; sourceTree = "<group>"; };
|
||||
F8129C5C1591090B009BFE23 /* AFPropertyListRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFPropertyListRequestOperation.m; path = ../AFNetworking/AFPropertyListRequestOperation.m; sourceTree = "<group>"; };
|
||||
F8129C5D1591090B009BFE23 /* AFURLConnectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFURLConnectionOperation.h; path = ../AFNetworking/AFURLConnectionOperation.h; sourceTree = "<group>"; };
|
||||
F8129C5E1591090B009BFE23 /* AFURLConnectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFURLConnectionOperation.m; path = ../AFNetworking/AFURLConnectionOperation.m; sourceTree = "<group>"; };
|
||||
F8129C5F1591090B009BFE23 /* AFXMLRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFXMLRequestOperation.h; path = ../AFNetworking/AFXMLRequestOperation.h; sourceTree = "<group>"; };
|
||||
F8129C601591090B009BFE23 /* AFXMLRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFXMLRequestOperation.m; path = ../AFNetworking/AFXMLRequestOperation.m; sourceTree = "<group>"; };
|
||||
F8129C611591090B009BFE23 /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImageView+AFNetworking.h"; path = "../AFNetworking/UIImageView+AFNetworking.h"; sourceTree = "<group>"; };
|
||||
F8129C621591090B009BFE23 /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+AFNetworking.m"; path = "../AFNetworking/UIImageView+AFNetworking.m"; sourceTree = "<group>"; };
|
||||
F8129C6E15910B15009BFE23 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; };
|
||||
F8129C7015910B3E009BFE23 /* MainMenu.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = SOURCE_ROOT; };
|
||||
F8129C7515910C40009BFE23 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; };
|
||||
F8129C7615910C40009BFE23 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
F8129BF81591061B009BFE23 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F8129C001591061B009BFE23 /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
F8129BF01591061B009BFE23 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8129C051591061B009BFE23 /* Classes */,
|
||||
F8129C4C15910901009BFE23 /* Vendor */,
|
||||
F8129BFE1591061B009BFE23 /* Frameworks */,
|
||||
F8129BFC1591061B009BFE23 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8129BFC1591061B009BFE23 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8129BFB1591061B009BFE23 /* AFNetworking Example.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8129BFE1591061B009BFE23 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8129BFF1591061B009BFE23 /* Cocoa.framework */,
|
||||
F8129C011591061B009BFE23 /* Other Frameworks */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8129C011591061B009BFE23 /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8129C021591061B009BFE23 /* AppKit.framework */,
|
||||
F8129C031591061B009BFE23 /* CoreData.framework */,
|
||||
F8129C041591061B009BFE23 /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8129C051591061B009BFE23 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8129C311591073C009BFE23 /* AFTwitterAPIClient.h */,
|
||||
F8129C251591073C009BFE23 /* AFTwitterAPIClient.m */,
|
||||
F8129C291591073C009BFE23 /* Models */,
|
||||
F8129C061591061B009BFE23 /* Supporting Files */,
|
||||
);
|
||||
name = Classes;
|
||||
path = "AFNetworking-Mac-Example";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8129C061591061B009BFE23 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8129C7615910C40009BFE23 /* AppDelegate.h */,
|
||||
F8129C7515910C40009BFE23 /* AppDelegate.m */,
|
||||
F8129C6E15910B15009BFE23 /* main.m */,
|
||||
F8129C7015910B3E009BFE23 /* MainMenu.xib */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8129C291591073C009BFE23 /* Models */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8129C2A1591073C009BFE23 /* Tweet.h */,
|
||||
F8129C2B1591073C009BFE23 /* Tweet.m */,
|
||||
F8129C2C1591073C009BFE23 /* User.h */,
|
||||
F8129C2D1591073C009BFE23 /* User.m */,
|
||||
);
|
||||
name = Models;
|
||||
path = Classes/Models;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
F8129C4C15910901009BFE23 /* Vendor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8129C4E1591090B009BFE23 /* AFHTTPClient.h */,
|
||||
F8129C4F1591090B009BFE23 /* AFHTTPClient.m */,
|
||||
F8129C501591090B009BFE23 /* AFHTTPRequestOperation.h */,
|
||||
F8129C511591090B009BFE23 /* AFHTTPRequestOperation.m */,
|
||||
F8129C521591090B009BFE23 /* AFImageRequestOperation.h */,
|
||||
F8129C531591090B009BFE23 /* AFImageRequestOperation.m */,
|
||||
F8129C541591090B009BFE23 /* AFJSONRequestOperation.h */,
|
||||
F8129C551591090B009BFE23 /* AFJSONRequestOperation.m */,
|
||||
F8129C561591090B009BFE23 /* AFJSONUtilities.h */,
|
||||
F8129C571591090B009BFE23 /* AFJSONUtilities.m */,
|
||||
F8129C581591090B009BFE23 /* AFNetworkActivityIndicatorManager.h */,
|
||||
F8129C591591090B009BFE23 /* AFNetworkActivityIndicatorManager.m */,
|
||||
F8129C5A1591090B009BFE23 /* AFNetworking.h */,
|
||||
F8129C5B1591090B009BFE23 /* AFPropertyListRequestOperation.h */,
|
||||
F8129C5C1591090B009BFE23 /* AFPropertyListRequestOperation.m */,
|
||||
F8129C5D1591090B009BFE23 /* AFURLConnectionOperation.h */,
|
||||
F8129C5E1591090B009BFE23 /* AFURLConnectionOperation.m */,
|
||||
F8129C5F1591090B009BFE23 /* AFXMLRequestOperation.h */,
|
||||
F8129C601591090B009BFE23 /* AFXMLRequestOperation.m */,
|
||||
F8129C611591090B009BFE23 /* UIImageView+AFNetworking.h */,
|
||||
F8129C621591090B009BFE23 /* UIImageView+AFNetworking.m */,
|
||||
);
|
||||
name = Vendor;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
F8129BFA1591061B009BFE23 /* AFNetworking Example */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = F8129C191591061B009BFE23 /* Build configuration list for PBXNativeTarget "AFNetworking Example" */;
|
||||
buildPhases = (
|
||||
F8129BF71591061B009BFE23 /* Sources */,
|
||||
F8129BF81591061B009BFE23 /* Frameworks */,
|
||||
F8129BF91591061B009BFE23 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "AFNetworking Example";
|
||||
productName = "AFNetworking-Mac-Example";
|
||||
productReference = F8129BFB1591061B009BFE23 /* AFNetworking Example.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
F8129BF21591061B009BFE23 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0430;
|
||||
};
|
||||
buildConfigurationList = F8129BF51591061B009BFE23 /* Build configuration list for PBXProject "AFNetworking Mac Example" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = F8129BF01591061B009BFE23;
|
||||
productRefGroup = F8129BFC1591061B009BFE23 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
F8129BFA1591061B009BFE23 /* AFNetworking Example */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
F8129BF91591061B009BFE23 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F8129C7115910B3E009BFE23 /* MainMenu.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
F8129BF71591061B009BFE23 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F8129C341591073C009BFE23 /* Tweet.m in Sources */,
|
||||
F8129C351591073C009BFE23 /* User.m in Sources */,
|
||||
F8129C321591073C009BFE23 /* AFTwitterAPIClient.m in Sources */,
|
||||
F8129C631591090B009BFE23 /* AFHTTPClient.m in Sources */,
|
||||
F8129C641591090B009BFE23 /* AFHTTPRequestOperation.m in Sources */,
|
||||
F8129C651591090B009BFE23 /* AFImageRequestOperation.m in Sources */,
|
||||
F8129C661591090B009BFE23 /* AFJSONRequestOperation.m in Sources */,
|
||||
F8129C671591090B009BFE23 /* AFJSONUtilities.m in Sources */,
|
||||
F8129C681591090B009BFE23 /* AFNetworkActivityIndicatorManager.m in Sources */,
|
||||
F8129C691591090B009BFE23 /* AFPropertyListRequestOperation.m in Sources */,
|
||||
F8129C6A1591090B009BFE23 /* AFURLConnectionOperation.m in Sources */,
|
||||
F8129C6B1591090B009BFE23 /* AFXMLRequestOperation.m in Sources */,
|
||||
F8129C6C1591090B009BFE23 /* UIImageView+AFNetworking.m in Sources */,
|
||||
F8129C6F15910B15009BFE23 /* main.m in Sources */,
|
||||
F8129C7715910C40009BFE23 /* AppDelegate.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
F8129C171591061B009BFE23 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F8129C181591061B009BFE23 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
F8129C1A1591061B009BFE23 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = Prefix.pch;
|
||||
INFOPLIST_FILE = "Mac-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F8129C1B1591061B009BFE23 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = Prefix.pch;
|
||||
INFOPLIST_FILE = "Mac-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
F8129BF51591061B009BFE23 /* Build configuration list for PBXProject "AFNetworking Mac Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F8129C171591061B009BFE23 /* Debug */,
|
||||
F8129C181591061B009BFE23 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
F8129C191591061B009BFE23 /* Build configuration list for PBXNativeTarget "AFNetworking Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F8129C1A1591061B009BFE23 /* Debug */,
|
||||
F8129C1B1591061B009BFE23 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = F8129BF21591061B009BFE23 /* Project object */;
|
||||
}
|
||||
7
Example/AFNetworking Mac Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:AFNetworking Mac Example.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -7,10 +7,10 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
F8129C7415910C37009BFE23 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8129C7215910C37009BFE23 /* AppDelegate.m */; };
|
||||
F8D0701B14310F4A00653FD3 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469E213957DF700DB05C8 /* SystemConfiguration.framework */; };
|
||||
F8D0701C14310F4F00653FD3 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469E013957DF100DB05C8 /* Security.framework */; };
|
||||
F8DA09E41396AC040057D0CC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F8DA09E31396AC040057D0CC /* main.m */; };
|
||||
F8DA09E81396AC220057D0CC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8DA09E71396AC220057D0CC /* AppDelegate.m */; };
|
||||
F8E469651395739D00DB05C8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469641395739D00DB05C8 /* UIKit.framework */; };
|
||||
F8E469671395739D00DB05C8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469661395739D00DB05C8 /* Foundation.framework */; };
|
||||
F8E469691395739D00DB05C8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469681395739D00DB05C8 /* CoreGraphics.framework */; };
|
||||
|
|
@ -39,15 +39,15 @@
|
|||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
F8129C3815910830009BFE23 /* Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = SOURCE_ROOT; };
|
||||
F8129C7215910C37009BFE23 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; };
|
||||
F8129C7315910C37009BFE23 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||
F8DA09E31396AC040057D0CC /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; };
|
||||
F8DA09E51396AC220057D0CC /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||
F8DA09E61396AC220057D0CC /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = SOURCE_ROOT; };
|
||||
F8DA09E71396AC220057D0CC /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; };
|
||||
F8E469601395739C00DB05C8 /* AFNetworking iOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AFNetworking iOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F8E469641395739D00DB05C8 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
F8E469661395739D00DB05C8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
F8E469681395739D00DB05C8 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
F8E4696C1395739D00DB05C8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F8E4696C1395739D00DB05C8 /* iOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "iOS-Info.plist"; sourceTree = "<group>"; };
|
||||
F8E469DE13957DD500DB05C8 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
|
||||
F8E469E013957DF100DB05C8 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
||||
F8E469E213957DF700DB05C8 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||
|
|
@ -188,10 +188,10 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
F8DA09E31396AC040057D0CC /* main.m */,
|
||||
F8DA09E61396AC220057D0CC /* Prefix.pch */,
|
||||
F8DA09E51396AC220057D0CC /* AppDelegate.h */,
|
||||
F8DA09E71396AC220057D0CC /* AppDelegate.m */,
|
||||
F8E4696C1395739D00DB05C8 /* Info.plist */,
|
||||
F8129C3815910830009BFE23 /* Prefix.pch */,
|
||||
F8129C7215910C37009BFE23 /* AppDelegate.m */,
|
||||
F8129C7315910C37009BFE23 /* AppDelegate.h */,
|
||||
F8E4696C1395739D00DB05C8 /* iOS-Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -324,7 +324,6 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F8DA09E41396AC040057D0CC /* main.m in Sources */,
|
||||
F8DA09E81396AC220057D0CC /* AppDelegate.m in Sources */,
|
||||
F8FA9491150EF8C100ED4EAD /* AFTwitterAPIClient.m in Sources */,
|
||||
F8FA9494150EF97E00ED4EAD /* Tweet.m in Sources */,
|
||||
F8FA9497150EF98800ED4EAD /* User.m in Sources */,
|
||||
|
|
@ -340,6 +339,7 @@
|
|||
F8FA94B9150EFEC100ED4EAD /* AFXMLRequestOperation.m in Sources */,
|
||||
F8FA94BA150EFEC100ED4EAD /* UIImageView+AFNetworking.m in Sources */,
|
||||
F8FA94C1150F019100ED4EAD /* TweetTableViewCell.m in Sources */,
|
||||
F8129C7415910C37009BFE23 /* AppDelegate.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
@ -391,7 +391,7 @@
|
|||
GCC_WARN_SHADOW = YES;
|
||||
GCC_WARN_SIGN_COMPARE = YES;
|
||||
GCC_WARN_UNUSED_PARAMETER = NO;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INFOPLIST_FILE = "iOS-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
|
|
@ -410,7 +410,7 @@
|
|||
GCC_WARN_SHADOW = YES;
|
||||
GCC_WARN_SIGN_COMPARE = YES;
|
||||
GCC_WARN_UNUSED_PARAMETER = NO;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INFOPLIST_FILE = "iOS-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
7
Example/AFNetworking iOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:AFNetworking iOS Example.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -20,6 +20,10 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import <Availability.h>
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface AppDelegate : NSObject <UIApplicationDelegate> {
|
||||
|
|
@ -30,3 +34,17 @@
|
|||
@property (nonatomic, strong) UINavigationController *navigationController;
|
||||
|
||||
@end
|
||||
|
||||
#else
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||
|
||||
@property (strong) IBOutlet NSWindow *window;
|
||||
@property (weak) IBOutlet NSTableView *tableView;
|
||||
@property (strong) IBOutlet NSArrayController *tweetsArrayController;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
93
Example/AppDelegate.m
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
// AppDelegate.m
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
|
||||
#import "PublicTimelineViewController.h"
|
||||
|
||||
#import "AFNetworkActivityIndicatorManager.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
@synthesize window = _window;
|
||||
@synthesize navigationController = _navigationController;
|
||||
|
||||
- (BOOL)application:(UIApplication *)application
|
||||
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024 diskCapacity:1024 * 1024 * 5 diskPath:nil];
|
||||
[NSURLCache setSharedURLCache:URLCache];
|
||||
|
||||
[[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
|
||||
|
||||
UITableViewController *viewController = [[PublicTimelineViewController alloc] initWithStyle:UITableViewStylePlain];
|
||||
self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
|
||||
self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor];
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
self.window.backgroundColor = [UIColor whiteColor];
|
||||
self.window.rootViewController = self.navigationController;
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#else
|
||||
|
||||
#import "Tweet.h"
|
||||
#import "User.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
@synthesize window = _window;
|
||||
@synthesize tableView = _tableView;
|
||||
@synthesize tweetsArrayController = _tweetsArrayController;
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
|
||||
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024 diskCapacity:1024 * 1024 * 5 diskPath:nil];
|
||||
[NSURLCache setSharedURLCache:URLCache];
|
||||
|
||||
[self.window makeKeyAndOrderFront:self];
|
||||
|
||||
[Tweet publicTimelineTweetsWithBlock:^(NSArray *tweets) {
|
||||
self.tweetsArrayController.content = tweets;
|
||||
}];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:kUserProfileImageDidLoadNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
|
||||
[self.tableView reloadData];
|
||||
}];
|
||||
}
|
||||
|
||||
- (BOOL)applicationShouldHandleReopen:(NSApplication *)application
|
||||
hasVisibleWindows:(BOOL)flag
|
||||
{
|
||||
[self.window makeKeyAndOrderFront:self];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
|
@ -64,10 +64,11 @@
|
|||
block([NSArray arrayWithArray:mutableTweets]);
|
||||
}
|
||||
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
|
||||
[[[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Ok", nil] show];
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
[[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) message:[error localizedDescription] delegate:nil cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"OK", nil), nil] show];
|
||||
#else
|
||||
[[NSAlert alertWithMessageText:NSLocalizedString(@"Error", nil) defaultButton:NSLocalizedString(@"OK", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:[error localizedDescription]] runModal];
|
||||
#endif
|
||||
if (block) {
|
||||
block(nil);
|
||||
}
|
||||
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
extern NSString * const kUserProfileImageDidLoadNotification;
|
||||
|
||||
@interface User : NSObject
|
||||
|
||||
@property (readonly) NSUInteger userID;
|
||||
|
|
@ -30,4 +32,8 @@
|
|||
|
||||
- (id)initWithAttributes:(NSDictionary *)attributes;
|
||||
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
@property (nonatomic, strong) NSImage *profileImage;
|
||||
#endif
|
||||
|
||||
@end
|
||||
95
Example/Classes/Models/User.m
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
// User.m
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "User.h"
|
||||
#import "AFImageRequestOperation.h"
|
||||
|
||||
NSString * const kUserProfileImageDidLoadNotification = @"com.alamofire.user.profile-image.loaded";
|
||||
|
||||
@interface User ()
|
||||
+ (NSOperationQueue *)sharedProfileImageRequestOperationQueue;
|
||||
@end
|
||||
|
||||
@implementation User {
|
||||
@private
|
||||
__strong NSString *_profileImageURLString;
|
||||
__strong AFImageRequestOperation *_profileImageRequestOperation;
|
||||
}
|
||||
|
||||
@synthesize userID = _userID;
|
||||
@synthesize username = _username;
|
||||
|
||||
- (id)initWithAttributes:(NSDictionary *)attributes {
|
||||
self = [super init];
|
||||
if (!self) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
_userID = [[attributes valueForKeyPath:@"id"] integerValue];
|
||||
_username = [attributes valueForKeyPath:@"screen_name"];
|
||||
_profileImageURLString = [attributes valueForKeyPath:@"profile_image_url_https"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSURL *)profileImageURL {
|
||||
return [NSURL URLWithString:_profileImageURLString];
|
||||
}
|
||||
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
|
||||
@synthesize profileImage = _profileImage;
|
||||
|
||||
+ (NSOperationQueue *)sharedProfileImageRequestOperationQueue {
|
||||
static NSOperationQueue *_sharedProfileImageRequestOperationQueue = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
_sharedProfileImageRequestOperationQueue = [[NSOperationQueue alloc] init];
|
||||
[_sharedProfileImageRequestOperationQueue setMaxConcurrentOperationCount:8];
|
||||
});
|
||||
|
||||
return _sharedProfileImageRequestOperationQueue;
|
||||
}
|
||||
|
||||
- (NSImage *)profileImage {
|
||||
if (!_profileImage && !_profileImageRequestOperation) {
|
||||
_profileImageRequestOperation = [AFImageRequestOperation imageRequestOperationWithRequest:[NSURLRequest requestWithURL:self.profileImageURL] success:^(NSImage *image) {
|
||||
self.profileImage = image;
|
||||
|
||||
_profileImageRequestOperation = nil;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kUserProfileImageDidLoadNotification object:self userInfo:nil];
|
||||
}];
|
||||
|
||||
[_profileImageRequestOperation setCacheResponseBlock:^NSCachedURLResponse *(NSURLConnection *connection, NSCachedURLResponse *cachedResponse) {
|
||||
return [[NSCachedURLResponse alloc] initWithResponse:cachedResponse.response data:cachedResponse.data userInfo:cachedResponse.userInfo storagePolicy:NSURLCacheStorageAllowed];
|
||||
}];
|
||||
|
||||
[[[self class] sharedProfileImageRequestOperationQueue] addOperation:_profileImageRequestOperation];
|
||||
}
|
||||
|
||||
return _profileImage;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
|
@ -22,12 +22,10 @@
|
|||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2011 Gowalla. All rights reserved.</string>
|
||||
<string>Copyright © 2012年 Mattt Thompson. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
2069
Example/MainMenu.xib
Normal file
17
Example/Prefix.pch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#import <Availability.h>
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
#ifndef __IPHONE_3_0
|
||||
#warning "This project uses features only available in iPhone SDK 3.0 and later."
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <SystemConfiguration/SystemConfiguration.h>
|
||||
#endif
|
||||
#else
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
#endif
|
||||
4587
Example/en.lproj/MainMenu.xib
Normal file
|
|
@ -1,5 +1,4 @@
|
|||
// main.m
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
|
@ -20,6 +19,7 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
|
@ -28,3 +28,10 @@ int main(int argc, char *argv[]) {
|
|||
return retVal;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,420 +0,0 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
F8689A9C14CC9F780087F357 /* AFJSONUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = F8689A9B14CC9F780087F357 /* AFJSONUtilities.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F87A159F1444926300318955 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F87A159E1444926300318955 /* AFURLConnectionOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F87A15A21444926A00318955 /* AFXMLRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F87A15A11444926900318955 /* AFXMLRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F87A15A51444927300318955 /* AFPropertyListRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F87A15A41444927300318955 /* AFPropertyListRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F87A15CD1444A30800318955 /* AFGowallaAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F87A15C61444A30800318955 /* AFGowallaAPIClient.m */; };
|
||||
F87A15CE1444A30800318955 /* NearbySpotsController.m in Sources */ = {isa = PBXBuildFile; fileRef = F87A15C91444A30800318955 /* NearbySpotsController.m */; };
|
||||
F87A15CF1444A30800318955 /* Spot.m in Sources */ = {isa = PBXBuildFile; fileRef = F87A15CC1444A30800318955 /* Spot.m */; };
|
||||
F87A15D11444A3EB00318955 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F87A15D01444A3EB00318955 /* CoreLocation.framework */; };
|
||||
F87A15DD1444A86600318955 /* placeholder-stamp.png in Resources */ = {isa = PBXBuildFile; fileRef = F87A15DB1444A86600318955 /* placeholder-stamp.png */; };
|
||||
F897DE78142CFEDC000DDD35 /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F897DE6A142CFEDC000DDD35 /* AFHTTPClient.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F897DE79142CFEDC000DDD35 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F897DE6C142CFEDC000DDD35 /* AFHTTPRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F897DE7B142CFEDC000DDD35 /* AFImageRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F897DE70142CFEDC000DDD35 /* AFImageRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F897DE7C142CFEDC000DDD35 /* AFJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F897DE72142CFEDC000DDD35 /* AFJSONRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
F8A27AC7142CFE1300F5E0D6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8A27AB2142CFE1300F5E0D6 /* AppDelegate.m */; };
|
||||
F8A27AC8142CFE1300F5E0D6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F8A27AB3142CFE1300F5E0D6 /* main.m */; };
|
||||
F8A27AC9142CFE1300F5E0D6 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = F8A27AB9142CFE1300F5E0D6 /* Credits.rtf */; };
|
||||
F8A27ACA142CFE1300F5E0D6 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8A27ABB142CFE1300F5E0D6 /* MainMenu.xib */; };
|
||||
F8A27ACB142CFE1300F5E0D6 /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = F8A27AC0142CFE1300F5E0D6 /* JSONKit.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-checker"; }; };
|
||||
F8CEEB6F142CEC6E00247B03 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8CEEB6E142CEC6E00247B03 /* Cocoa.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
F8323C901455B4FE00190CCB /* AFJSONUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFJSONUtilities.h; sourceTree = "<group>"; };
|
||||
F8689A9B14CC9F780087F357 /* AFJSONUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFJSONUtilities.m; sourceTree = "<group>"; };
|
||||
F87A159D1444926300318955 /* AFURLConnectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLConnectionOperation.h; sourceTree = "<group>"; };
|
||||
F87A159E1444926300318955 /* AFURLConnectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLConnectionOperation.m; sourceTree = "<group>"; };
|
||||
F87A15A01444926900318955 /* AFXMLRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFXMLRequestOperation.h; sourceTree = "<group>"; };
|
||||
F87A15A11444926900318955 /* AFXMLRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLRequestOperation.m; sourceTree = "<group>"; };
|
||||
F87A15A31444927300318955 /* AFPropertyListRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFPropertyListRequestOperation.h; sourceTree = "<group>"; };
|
||||
F87A15A41444927300318955 /* AFPropertyListRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFPropertyListRequestOperation.m; sourceTree = "<group>"; };
|
||||
F87A15C51444A30800318955 /* AFGowallaAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFGowallaAPIClient.h; sourceTree = "<group>"; };
|
||||
F87A15C61444A30800318955 /* AFGowallaAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFGowallaAPIClient.m; sourceTree = "<group>"; };
|
||||
F87A15C81444A30800318955 /* NearbySpotsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NearbySpotsController.h; sourceTree = "<group>"; };
|
||||
F87A15C91444A30800318955 /* NearbySpotsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NearbySpotsController.m; sourceTree = "<group>"; };
|
||||
F87A15CB1444A30800318955 /* Spot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Spot.h; sourceTree = "<group>"; };
|
||||
F87A15CC1444A30800318955 /* Spot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Spot.m; sourceTree = "<group>"; };
|
||||
F87A15D01444A3EB00318955 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
|
||||
F87A15DB1444A86600318955 /* placeholder-stamp.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "placeholder-stamp.png"; sourceTree = "<group>"; };
|
||||
F897DE69142CFEDC000DDD35 /* AFHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPClient.h; sourceTree = "<group>"; };
|
||||
F897DE6A142CFEDC000DDD35 /* AFHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPClient.m; sourceTree = "<group>"; };
|
||||
F897DE6B142CFEDC000DDD35 /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPRequestOperation.h; sourceTree = "<group>"; };
|
||||
F897DE6C142CFEDC000DDD35 /* AFHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPRequestOperation.m; sourceTree = "<group>"; };
|
||||
F897DE6F142CFEDC000DDD35 /* AFImageRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFImageRequestOperation.h; sourceTree = "<group>"; };
|
||||
F897DE70142CFEDC000DDD35 /* AFImageRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFImageRequestOperation.m; sourceTree = "<group>"; };
|
||||
F897DE71142CFEDC000DDD35 /* AFJSONRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFJSONRequestOperation.h; sourceTree = "<group>"; };
|
||||
F897DE72142CFEDC000DDD35 /* AFJSONRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFJSONRequestOperation.m; sourceTree = "<group>"; };
|
||||
F897DE75142CFEDC000DDD35 /* AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworking.h; sourceTree = "<group>"; };
|
||||
F8A27AB1142CFE1300F5E0D6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F8A27AB2142CFE1300F5E0D6 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
F8A27AB3142CFE1300F5E0D6 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
F8A27ABA142CFE1300F5E0D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = Credits.rtf; sourceTree = "<group>"; };
|
||||
F8A27ABC142CFE1300F5E0D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = MainMenu.xib; sourceTree = "<group>"; };
|
||||
F8A27ABF142CFE1300F5E0D6 /* JSONKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONKit.h; sourceTree = "<group>"; };
|
||||
F8A27AC0142CFE1300F5E0D6 /* JSONKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONKit.m; sourceTree = "<group>"; };
|
||||
F8A27AC4142CFE1300F5E0D6 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = "<group>"; };
|
||||
F8A27AC5142CFE1300F5E0D6 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
F8CEEB6A142CEC6E00247B03 /* AFNetworking Mac Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AFNetworking Mac Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F8CEEB6E142CEC6E00247B03 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
F8CEEB71142CEC6E00247B03 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
F8CEEB72142CEC6E00247B03 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
|
||||
F8CEEB73142CEC6E00247B03 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
F8CEEB67142CEC6E00247B03 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F87A15D11444A3EB00318955 /* CoreLocation.framework in Frameworks */,
|
||||
F8CEEB6F142CEC6E00247B03 /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
F87A15C41444A30800318955 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F87A15C51444A30800318955 /* AFGowallaAPIClient.h */,
|
||||
F87A15C61444A30800318955 /* AFGowallaAPIClient.m */,
|
||||
F87A15C71444A30800318955 /* Controllers */,
|
||||
F87A15CA1444A30800318955 /* Models */,
|
||||
);
|
||||
path = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F87A15C71444A30800318955 /* Controllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F87A15C81444A30800318955 /* NearbySpotsController.h */,
|
||||
F87A15C91444A30800318955 /* NearbySpotsController.m */,
|
||||
);
|
||||
path = Controllers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F87A15CA1444A30800318955 /* Models */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F87A15CB1444A30800318955 /* Spot.h */,
|
||||
F87A15CC1444A30800318955 /* Spot.m */,
|
||||
);
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F87A15DA1444A86600318955 /* Images */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F87A15DB1444A86600318955 /* placeholder-stamp.png */,
|
||||
);
|
||||
path = Images;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F897DE68142CFEDC000DDD35 /* AFNetworking */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F897DE75142CFEDC000DDD35 /* AFNetworking.h */,
|
||||
F87A159D1444926300318955 /* AFURLConnectionOperation.h */,
|
||||
F87A159E1444926300318955 /* AFURLConnectionOperation.m */,
|
||||
F897DE6B142CFEDC000DDD35 /* AFHTTPRequestOperation.h */,
|
||||
F897DE6C142CFEDC000DDD35 /* AFHTTPRequestOperation.m */,
|
||||
F897DE71142CFEDC000DDD35 /* AFJSONRequestOperation.h */,
|
||||
F897DE72142CFEDC000DDD35 /* AFJSONRequestOperation.m */,
|
||||
F87A15A01444926900318955 /* AFXMLRequestOperation.h */,
|
||||
F87A15A11444926900318955 /* AFXMLRequestOperation.m */,
|
||||
F87A15A31444927300318955 /* AFPropertyListRequestOperation.h */,
|
||||
F87A15A41444927300318955 /* AFPropertyListRequestOperation.m */,
|
||||
F897DE69142CFEDC000DDD35 /* AFHTTPClient.h */,
|
||||
F897DE6A142CFEDC000DDD35 /* AFHTTPClient.m */,
|
||||
F897DE6F142CFEDC000DDD35 /* AFImageRequestOperation.h */,
|
||||
F897DE70142CFEDC000DDD35 /* AFImageRequestOperation.m */,
|
||||
F8323C901455B4FE00190CCB /* AFJSONUtilities.h */,
|
||||
F8689A9B14CC9F780087F357 /* AFJSONUtilities.m */,
|
||||
);
|
||||
name = AFNetworking;
|
||||
path = ../../AFNetworking;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8A27ABD142CFE1300F5E0D6 /* Vendor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F897DE68142CFEDC000DDD35 /* AFNetworking */,
|
||||
F8A27ABE142CFE1300F5E0D6 /* JSONKit */,
|
||||
);
|
||||
path = Vendor;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8A27ABE142CFE1300F5E0D6 /* JSONKit */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8A27ABF142CFE1300F5E0D6 /* JSONKit.h */,
|
||||
F8A27AC0142CFE1300F5E0D6 /* JSONKit.m */,
|
||||
);
|
||||
path = JSONKit;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8A27ACD142CFE3000F5E0D6 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8A27AB3142CFE1300F5E0D6 /* main.m */,
|
||||
F8A27AB1142CFE1300F5E0D6 /* Info.plist */,
|
||||
F8A27AB2142CFE1300F5E0D6 /* AppDelegate.m */,
|
||||
F8A27AC4142CFE1300F5E0D6 /* Prefix.pch */,
|
||||
F8A27AC5142CFE1300F5E0D6 /* AppDelegate.h */,
|
||||
F8A27AB9142CFE1300F5E0D6 /* Credits.rtf */,
|
||||
F8A27ABB142CFE1300F5E0D6 /* MainMenu.xib */,
|
||||
F87A15DA1444A86600318955 /* Images */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8CEEB5F142CEC6E00247B03 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F87A15C41444A30800318955 /* Classes */,
|
||||
F8A27ACD142CFE3000F5E0D6 /* Supporting Files */,
|
||||
F8A27ABD142CFE1300F5E0D6 /* Vendor */,
|
||||
F8CEEB6D142CEC6E00247B03 /* Frameworks */,
|
||||
F8CEEB6B142CEC6E00247B03 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8CEEB6B142CEC6E00247B03 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8CEEB6A142CEC6E00247B03 /* AFNetworking Mac Example.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8CEEB6D142CEC6E00247B03 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F87A15D01444A3EB00318955 /* CoreLocation.framework */,
|
||||
F8CEEB6E142CEC6E00247B03 /* Cocoa.framework */,
|
||||
F8CEEB70142CEC6E00247B03 /* Other Frameworks */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8CEEB70142CEC6E00247B03 /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8CEEB71142CEC6E00247B03 /* AppKit.framework */,
|
||||
F8CEEB72142CEC6E00247B03 /* CoreData.framework */,
|
||||
F8CEEB73142CEC6E00247B03 /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
F8CEEB69142CEC6E00247B03 /* AFNetworking Mac Example */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = F8CEEB88142CEC6E00247B03 /* Build configuration list for PBXNativeTarget "AFNetworking Mac Example" */;
|
||||
buildPhases = (
|
||||
F8CEEB66142CEC6E00247B03 /* Sources */,
|
||||
F8CEEB67142CEC6E00247B03 /* Frameworks */,
|
||||
F8CEEB68142CEC6E00247B03 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "AFNetworking Mac Example";
|
||||
productName = "AFNetworking Mac Example";
|
||||
productReference = F8CEEB6A142CEC6E00247B03 /* AFNetworking Mac Example.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
F8CEEB61142CEC6E00247B03 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0420;
|
||||
ORGANIZATIONNAME = Gowalla;
|
||||
};
|
||||
buildConfigurationList = F8CEEB64142CEC6E00247B03 /* Build configuration list for PBXProject "AFNetworking Mac Example" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = F8CEEB5F142CEC6E00247B03;
|
||||
productRefGroup = F8CEEB6B142CEC6E00247B03 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
F8CEEB69142CEC6E00247B03 /* AFNetworking Mac Example */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
F8CEEB68142CEC6E00247B03 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F8A27AC9142CFE1300F5E0D6 /* Credits.rtf in Resources */,
|
||||
F8A27ACA142CFE1300F5E0D6 /* MainMenu.xib in Resources */,
|
||||
F87A15DD1444A86600318955 /* placeholder-stamp.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
F8CEEB66142CEC6E00247B03 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F8A27AC7142CFE1300F5E0D6 /* AppDelegate.m in Sources */,
|
||||
F8A27AC8142CFE1300F5E0D6 /* main.m in Sources */,
|
||||
F8A27ACB142CFE1300F5E0D6 /* JSONKit.m in Sources */,
|
||||
F87A159F1444926300318955 /* AFURLConnectionOperation.m in Sources */,
|
||||
F897DE78142CFEDC000DDD35 /* AFHTTPClient.m in Sources */,
|
||||
F897DE79142CFEDC000DDD35 /* AFHTTPRequestOperation.m in Sources */,
|
||||
F897DE7B142CFEDC000DDD35 /* AFImageRequestOperation.m in Sources */,
|
||||
F897DE7C142CFEDC000DDD35 /* AFJSONRequestOperation.m in Sources */,
|
||||
F87A15A21444926A00318955 /* AFXMLRequestOperation.m in Sources */,
|
||||
F87A15A51444927300318955 /* AFPropertyListRequestOperation.m in Sources */,
|
||||
F8689A9C14CC9F780087F357 /* AFJSONUtilities.m in Sources */,
|
||||
F87A15CD1444A30800318955 /* AFGowallaAPIClient.m in Sources */,
|
||||
F87A15CE1444A30800318955 /* NearbySpotsController.m in Sources */,
|
||||
F87A15CF1444A30800318955 /* Spot.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
F8A27AB9142CFE1300F5E0D6 /* Credits.rtf */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
F8A27ABA142CFE1300F5E0D6 /* en */,
|
||||
);
|
||||
name = Credits.rtf;
|
||||
path = en.lproj;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8A27ABB142CFE1300F5E0D6 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
F8A27ABC142CFE1300F5E0D6 /* en */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
path = en.lproj;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
F8CEEB86142CEC6E00247B03 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F8CEEB87142CEC6E00247B03 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
F8CEEB89142CEC6E00247B03 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = Prefix.pch;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F8CEEB8A142CEC6E00247B03 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = Prefix.pch;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
F8CEEB64142CEC6E00247B03 /* Build configuration list for PBXProject "AFNetworking Mac Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F8CEEB86142CEC6E00247B03 /* Debug */,
|
||||
F8CEEB87142CEC6E00247B03 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
F8CEEB88142CEC6E00247B03 /* Build configuration list for PBXNativeTarget "AFNetworking Mac Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F8CEEB89142CEC6E00247B03 /* Debug */,
|
||||
F8CEEB8A142CEC6E00247B03 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = F8CEEB61142CEC6E00247B03 /* Project object */;
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F8CEEB69142CEC6E00247B03"
|
||||
BuildableName = "AFNetworking Mac Example.app"
|
||||
BlueprintName = "AFNetworking Mac Example"
|
||||
ReferencedContainer = "container:AFNetworking Mac Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F8CEEB69142CEC6E00247B03"
|
||||
BuildableName = "AFNetworking Mac Example.app"
|
||||
BlueprintName = "AFNetworking Mac Example"
|
||||
ReferencedContainer = "container:AFNetworking Mac Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F8CEEB69142CEC6E00247B03"
|
||||
BuildableName = "AFNetworking Mac Example.app"
|
||||
BlueprintName = "AFNetworking Mac Example"
|
||||
ReferencedContainer = "container:AFNetworking Mac Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>AFNetworking Mac Example.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>F8CEEB69142CEC6E00247B03</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
// AppDelegate.h
|
||||
//
|
||||
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate> {
|
||||
NSWindow *_window;
|
||||
}
|
||||
|
||||
@property (strong) IBOutlet NSWindow *window;
|
||||
|
||||
@end
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
// AppDelegate.m
|
||||
//
|
||||
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
@synthesize window = _window;
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
// AFGowallaAPI.h
|
||||
//
|
||||
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "AFHTTPClient.h"
|
||||
|
||||
extern NSString * const kAFGowallaClientID;
|
||||
extern NSString * const kAFGowallaBaseURLString;
|
||||
|
||||
@interface AFGowallaAPIClient : AFHTTPClient
|
||||
+ (AFGowallaAPIClient *)sharedClient;
|
||||
@end
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
// AFGowallaAPI.m
|
||||
//
|
||||
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "AFGowallaAPIClient.h"
|
||||
|
||||
#import "AFJSONRequestOperation.h"
|
||||
|
||||
// Replace this with your own API Key, available at http://api.gowalla.com/api/keys/
|
||||
NSString * const kAFGowallaClientID = @"e7ccb7d3d2414eb2af4663fc91eb2793";
|
||||
|
||||
NSString * const kAFGowallaBaseURLString = @"https://api.gowalla.com/";
|
||||
|
||||
@implementation AFGowallaAPIClient
|
||||
|
||||
+ (AFGowallaAPIClient *)sharedClient {
|
||||
static AFGowallaAPIClient *_sharedClient = nil;
|
||||
static dispatch_once_t oncePredicate;
|
||||
dispatch_once(&oncePredicate, ^{
|
||||
_sharedClient = [[self alloc] initWithBaseURL:[NSURL URLWithString:kAFGowallaBaseURLString]];
|
||||
});
|
||||
|
||||
return _sharedClient;
|
||||
}
|
||||
|
||||
- (id)initWithBaseURL:(NSURL *)url {
|
||||
self = [super initWithBaseURL:url];
|
||||
if (!self) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
[self registerHTTPOperationClass:[AFJSONRequestOperation class]];
|
||||
|
||||
// Accept HTTP Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
|
||||
[self setDefaultHeader:@"Accept" value:@"application/json"];
|
||||
|
||||
// X-Gowalla-API-Key HTTP Header; see http://api.gowalla.com/api/docs
|
||||
[self setDefaultHeader:@"X-Gowalla-API-Key" value:kAFGowallaClientID];
|
||||
|
||||
// X-Gowalla-API-Version HTTP Header; see http://api.gowalla.com/api/docs
|
||||
[self setDefaultHeader:@"X-Gowalla-API-Version" value:@"1"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
// NearbySpotsViewController.h
|
||||
//
|
||||
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <CoreLocation/CoreLocation.h>
|
||||
|
||||
@interface NearbySpotsController : NSObject <CLLocationManagerDelegate>
|
||||
|
||||
@property (strong) NSArray *nearbySpots;
|
||||
|
||||
@end
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
// NearbySpotsViewController.m
|
||||
//
|
||||
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "NearbySpotsController.h"
|
||||
|
||||
#import "Spot.h"
|
||||
|
||||
@interface NearbySpotsController ()
|
||||
@property (strong) CLLocationManager *locationManager;
|
||||
|
||||
- (void)loadSpotsForLocation:(CLLocation *)location;
|
||||
@end
|
||||
|
||||
@implementation NearbySpotsController
|
||||
@synthesize nearbySpots = _nearbySpots;
|
||||
@synthesize locationManager = _locationManager;
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (!self) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
self.nearbySpots = [NSArray array];
|
||||
|
||||
self.locationManager = [[CLLocationManager alloc] init];
|
||||
self.locationManager.delegate = self;
|
||||
self.locationManager.distanceFilter = 80.0;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)awakeFromNib {
|
||||
// Load from a fixed location, in case location services are disabled or unavailable
|
||||
CLLocation *austin = [[CLLocation alloc] initWithLatitude:30.2669444 longitude:-97.7427778];
|
||||
[self loadSpotsForLocation:austin];
|
||||
|
||||
[self.locationManager startUpdatingLocation];
|
||||
}
|
||||
|
||||
- (void)loadSpotsForLocation:(CLLocation *)location {
|
||||
[Spot spotsWithURLString:@"/spots" near:location parameters:[NSDictionary dictionaryWithObject:@"128" forKey:@"per_page"] block:^(NSArray *records) {
|
||||
self.nearbySpots = [records sortedArrayUsingComparator:^ NSComparisonResult(id obj1, id obj2) {
|
||||
CLLocationDistance d1 = [[(Spot *)obj1 location] distanceFromLocation:location];
|
||||
CLLocationDistance d2 = [[(Spot *)obj2 location] distanceFromLocation:location];
|
||||
|
||||
if (d1 < d2) {
|
||||
return NSOrderedAscending;
|
||||
} else if (d1 > d2) {
|
||||
return NSOrderedDescending;
|
||||
} else {
|
||||
return NSOrderedSame;
|
||||
}
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - CLLocationManagerDelegate
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
|
||||
[self loadSpotsForLocation:newLocation];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
// Spot.h
|
||||
//
|
||||
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreLocation/CoreLocation.h>
|
||||
|
||||
@interface Spot : NSObject {
|
||||
@private
|
||||
NSString *_name;
|
||||
NSURL *_imageURL;
|
||||
NSNumber *_latitude;
|
||||
NSNumber *_longitude;
|
||||
}
|
||||
|
||||
@property (strong) NSString *name;
|
||||
@property (strong) NSURL *imageURL;
|
||||
@property (strong) NSNumber *latitude;
|
||||
@property (strong) NSNumber *longitude;
|
||||
@property (readonly) CLLocation *location;
|
||||
|
||||
- (id)initWithAttributes:(NSDictionary *)attributes;
|
||||
+ (void)spotsWithURLString:(NSString *)urlString near:(CLLocation *)location parameters:(NSDictionary *)parameters block:(void (^)(NSArray *records))block;
|
||||
|
||||
@end
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
// Spot.m
|
||||
//
|
||||
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "Spot.h"
|
||||
|
||||
#import "AFGowallaAPIClient.h"
|
||||
|
||||
@implementation Spot
|
||||
@synthesize name = _name;
|
||||
@synthesize imageURL = _imageURL;
|
||||
@synthesize latitude = _latitude;
|
||||
@synthesize longitude = _longitude;
|
||||
@dynamic location;
|
||||
|
||||
- (id)initWithAttributes:(NSDictionary *)attributes {
|
||||
self = [super init];
|
||||
if (!self) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
self.name = [attributes valueForKeyPath:@"name"];
|
||||
self.imageURL = [NSURL URLWithString:[attributes valueForKeyPath:@"image_url"]];
|
||||
self.latitude = [attributes valueForKeyPath:@"lat"];
|
||||
self.longitude = [attributes valueForKeyPath:@"lng"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (CLLocation *)location {
|
||||
return [[CLLocation alloc] initWithLatitude:[self.latitude doubleValue] longitude:[self.longitude doubleValue]];
|
||||
}
|
||||
|
||||
+ (void)spotsWithURLString:(NSString *)urlString near:(CLLocation *)location parameters:(NSDictionary *)parameters block:(void (^)(NSArray *records))block {
|
||||
NSDictionary *mutableParameters = [NSMutableDictionary dictionaryWithDictionary:parameters];
|
||||
if (location) {
|
||||
[mutableParameters setValue:[NSString stringWithFormat:@"%1.7f", location.coordinate.latitude] forKey:@"lat"];
|
||||
[mutableParameters setValue:[NSString stringWithFormat:@"%1.7f", location.coordinate.longitude] forKey:@"lng"];
|
||||
}
|
||||
|
||||
[[AFGowallaAPIClient sharedClient] getPath:urlString parameters:mutableParameters success:^(__unused AFHTTPRequestOperation *operation, id JSON) {
|
||||
NSMutableArray *mutableRecords = [NSMutableArray array];
|
||||
for (NSDictionary *attributes in [JSON valueForKeyPath:@"spots"]) {
|
||||
@autoreleasepool {
|
||||
Spot *spot = [[Spot alloc] initWithAttributes:attributes];
|
||||
[mutableRecords addObject:spot];
|
||||
}
|
||||
}
|
||||
|
||||
if (block) {
|
||||
block([NSArray arrayWithArray:mutableRecords]);
|
||||
}
|
||||
} failure:^(__unused AFHTTPRequestOperation *operation, NSError *error) {
|
||||
if (block) {
|
||||
block([NSArray array]);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
Before Width: | Height: | Size: 3.9 KiB |
|
|
@ -1,7 +0,0 @@
|
|||
//
|
||||
// Prefix header for all source files of the 'AFNetworking Mac Example' target in the 'AFNetworking Mac Example' project
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
251
Mac Example/Vendor/JSONKit/JSONKit.h
vendored
|
|
@ -1,251 +0,0 @@
|
|||
//
|
||||
// JSONKit.h
|
||||
// http://github.com/johnezang/JSONKit
|
||||
// Dual licensed under either the terms of the BSD License, or alternatively
|
||||
// under the terms of the Apache License, Version 2.0, as specified below.
|
||||
//
|
||||
|
||||
/*
|
||||
Copyright (c) 2011, John Engelhart
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the Zang Industries nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright 2011 John Engelhart
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <limits.h>
|
||||
#include <TargetConditionals.h>
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSError.h>
|
||||
#import <Foundation/NSObjCRuntime.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#endif // __OBJC__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// For Mac OS X < 10.5.
|
||||
#ifndef NSINTEGER_DEFINED
|
||||
#define NSINTEGER_DEFINED
|
||||
#if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
|
||||
typedef long NSInteger;
|
||||
typedef unsigned long NSUInteger;
|
||||
#define NSIntegerMin LONG_MIN
|
||||
#define NSIntegerMax LONG_MAX
|
||||
#define NSUIntegerMax ULONG_MAX
|
||||
#else // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
|
||||
typedef int NSInteger;
|
||||
typedef unsigned int NSUInteger;
|
||||
#define NSIntegerMin INT_MIN
|
||||
#define NSIntegerMax INT_MAX
|
||||
#define NSUIntegerMax UINT_MAX
|
||||
#endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
|
||||
#endif // NSINTEGER_DEFINED
|
||||
|
||||
|
||||
#ifndef _JSONKIT_H_
|
||||
#define _JSONKIT_H_
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465)
|
||||
#define JK_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
|
||||
#else
|
||||
#define JK_DEPRECATED_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
#define JSONKIT_VERSION_MAJOR 1
|
||||
#define JSONKIT_VERSION_MINOR 4
|
||||
|
||||
typedef NSUInteger JKFlags;
|
||||
|
||||
/*
|
||||
JKParseOptionComments : Allow C style // and /_* ... *_/ (without a _, obviously) comments in JSON.
|
||||
JKParseOptionUnicodeNewlines : Allow Unicode recommended (?:\r\n|[\n\v\f\r\x85\p{Zl}\p{Zp}]) newlines.
|
||||
JKParseOptionLooseUnicode : Normally the decoder will stop with an error at any malformed Unicode.
|
||||
This option allows JSON with malformed Unicode to be parsed without reporting an error.
|
||||
Any malformed Unicode is replaced with \uFFFD, or "REPLACEMENT CHARACTER".
|
||||
*/
|
||||
|
||||
enum {
|
||||
JKParseOptionNone = 0,
|
||||
JKParseOptionStrict = 0,
|
||||
JKParseOptionComments = (1 << 0),
|
||||
JKParseOptionUnicodeNewlines = (1 << 1),
|
||||
JKParseOptionLooseUnicode = (1 << 2),
|
||||
JKParseOptionPermitTextAfterValidJSON = (1 << 3),
|
||||
JKParseOptionValidFlags = (JKParseOptionComments | JKParseOptionUnicodeNewlines | JKParseOptionLooseUnicode | JKParseOptionPermitTextAfterValidJSON),
|
||||
};
|
||||
typedef JKFlags JKParseOptionFlags;
|
||||
|
||||
enum {
|
||||
JKSerializeOptionNone = 0,
|
||||
JKSerializeOptionPretty = (1 << 0),
|
||||
JKSerializeOptionEscapeUnicode = (1 << 1),
|
||||
JKSerializeOptionEscapeForwardSlashes = (1 << 4),
|
||||
JKSerializeOptionValidFlags = (JKSerializeOptionPretty | JKSerializeOptionEscapeUnicode | JKSerializeOptionEscapeForwardSlashes),
|
||||
};
|
||||
typedef JKFlags JKSerializeOptionFlags;
|
||||
|
||||
#ifdef __OBJC__
|
||||
|
||||
typedef struct JKParseState JKParseState; // Opaque internal, private type.
|
||||
|
||||
// As a general rule of thumb, if you use a method that doesn't accept a JKParseOptionFlags argument, it defaults to JKParseOptionStrict
|
||||
|
||||
@interface JSONDecoder : NSObject {
|
||||
JKParseState *parseState;
|
||||
}
|
||||
+ (id)decoder;
|
||||
+ (id)decoderWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
|
||||
- (id)initWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
|
||||
- (void)clearCache;
|
||||
|
||||
// The parse... methods were deprecated in v1.4 in favor of the v1.4 objectWith... methods.
|
||||
- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithUTF8String:length: instead.
|
||||
- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length error:(NSError **)error JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithUTF8String:length:error: instead.
|
||||
// The NSData MUST be UTF8 encoded JSON.
|
||||
- (id)parseJSONData:(NSData *)jsonData JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithData: instead.
|
||||
- (id)parseJSONData:(NSData *)jsonData error:(NSError **)error JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithData:error: instead.
|
||||
|
||||
// Methods that return immutable collection objects.
|
||||
- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;
|
||||
- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;
|
||||
// The NSData MUST be UTF8 encoded JSON.
|
||||
- (id)objectWithData:(NSData *)jsonData;
|
||||
- (id)objectWithData:(NSData *)jsonData error:(NSError **)error;
|
||||
|
||||
// Methods that return mutable collection objects.
|
||||
- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;
|
||||
- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;
|
||||
// The NSData MUST be UTF8 encoded JSON.
|
||||
- (id)mutableObjectWithData:(NSData *)jsonData;
|
||||
- (id)mutableObjectWithData:(NSData *)jsonData error:(NSError **)error;
|
||||
|
||||
@end
|
||||
|
||||
////////////
|
||||
#pragma mark Deserializing methods
|
||||
////////////
|
||||
|
||||
@interface NSString (JSONKitDeserializing)
|
||||
- (id)objectFromJSONString;
|
||||
- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
|
||||
- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
|
||||
- (id)mutableObjectFromJSONString;
|
||||
- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
|
||||
- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
|
||||
@end
|
||||
|
||||
@interface NSData (JSONKitDeserializing)
|
||||
// The NSData MUST be UTF8 encoded JSON.
|
||||
- (id)objectFromJSONData;
|
||||
- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
|
||||
- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
|
||||
- (id)mutableObjectFromJSONData;
|
||||
- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
|
||||
- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
|
||||
@end
|
||||
|
||||
////////////
|
||||
#pragma mark Serializing methods
|
||||
////////////
|
||||
|
||||
@interface NSString (JSONKitSerializing)
|
||||
// Convenience methods for those that need to serialize the receiving NSString (i.e., instead of having to serialize a NSArray with a single NSString, you can "serialize to JSON" just the NSString).
|
||||
// Normally, a string that is serialized to JSON has quotation marks surrounding it, which you may or may not want when serializing a single string, and can be controlled with includeQuotes:
|
||||
// includeQuotes:YES `a "test"...` -> `"a \"test\"..."`
|
||||
// includeQuotes:NO `a "test"...` -> `a \"test\"...`
|
||||
- (NSData *)JSONData; // Invokes JSONDataWithOptions:JKSerializeOptionNone includeQuotes:YES
|
||||
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;
|
||||
- (NSString *)JSONString; // Invokes JSONStringWithOptions:JKSerializeOptionNone includeQuotes:YES
|
||||
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;
|
||||
@end
|
||||
|
||||
@interface NSArray (JSONKitSerializing)
|
||||
- (NSData *)JSONData;
|
||||
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
|
||||
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
|
||||
- (NSString *)JSONString;
|
||||
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
|
||||
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
|
||||
@end
|
||||
|
||||
@interface NSDictionary (JSONKitSerializing)
|
||||
- (NSData *)JSONData;
|
||||
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
|
||||
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
|
||||
- (NSString *)JSONString;
|
||||
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
|
||||
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
|
||||
@end
|
||||
|
||||
#ifdef __BLOCKS__
|
||||
|
||||
@interface NSArray (JSONKitSerializingBlockAdditions)
|
||||
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
|
||||
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
|
||||
@end
|
||||
|
||||
@interface NSDictionary (JSONKitSerializingBlockAdditions)
|
||||
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
|
||||
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __OBJC__
|
||||
|
||||
#endif // _JSONKIT_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
3011
Mac Example/Vendor/JSONKit/JSONKit.m
vendored
83
Mac Example/Vendor/TTT/TTTLocationFormatter.h
vendored
|
|
@ -1,83 +0,0 @@
|
|||
// TTTLocationFormatter.h
|
||||
//
|
||||
// Copyright (c) 2011 Mattt Thompson (http://mattt.me)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreLocation/CoreLocation.h>
|
||||
|
||||
typedef enum {
|
||||
TTTNorthDirection,
|
||||
TTTNortheastDirection,
|
||||
TTTEastDirection,
|
||||
TTTSoutheastDirection,
|
||||
TTTSouthDirection,
|
||||
TTTSouthwestDirection,
|
||||
TTTWestDirection,
|
||||
TTTNorthwestDirection,
|
||||
} TTTLocationCardinalDirection;
|
||||
|
||||
extern TTTLocationCardinalDirection TTTLocationCardinalDirectionFromBearing(CLLocationDegrees bearing);
|
||||
|
||||
typedef enum {
|
||||
TTTCoordinateLatLngOrder = 0,
|
||||
TTTCoordinateLngLatOrder,
|
||||
} TTTLocationFormatterCoordinateOrder;
|
||||
|
||||
typedef enum {
|
||||
TTTBearingWordStyle = 0,
|
||||
TTTBearingAbbreviationWordStyle,
|
||||
TTTBearingNumericStyle,
|
||||
} TTTLocationFormatterBearingStyle;
|
||||
|
||||
typedef enum {
|
||||
TTTMetricSystem = 0,
|
||||
TTTImperialSystem,
|
||||
} TTTLocationUnitSystem;
|
||||
|
||||
@interface TTTLocationFormatter : NSFormatter {
|
||||
TTTLocationFormatterCoordinateOrder _coordinateOrder;
|
||||
TTTLocationFormatterBearingStyle _bearingStyle;
|
||||
TTTLocationUnitSystem _unitSystem;
|
||||
NSNumberFormatter *_numberFormatter;
|
||||
}
|
||||
|
||||
@property (readonly, nonatomic, retain) NSNumberFormatter *numberFormatter;
|
||||
|
||||
- (NSString *)stringFromCoordinate:(CLLocationCoordinate2D)coordinate;
|
||||
- (NSString *)stringFromLocation:(CLLocation *)location;
|
||||
- (NSString *)stringFromDistance:(CLLocationDistance)distance;
|
||||
- (NSString *)stringFromBearing:(CLLocationDegrees)bearing;
|
||||
- (NSString *)stringFromSpeed:(CLLocationSpeed)speed;
|
||||
- (NSString *)stringFromDistanceFromLocation:(CLLocation *)originLocation toLocation:(CLLocation *)destinationLocation;
|
||||
- (NSString *)stringFromBearingFromLocation:(CLLocation *)originLocation toLocation:(CLLocation *)destinationLocation;
|
||||
- (NSString *)stringFromDistanceAndBearingFromLocation:(CLLocation *)originLocation toLocation:(CLLocation *)destinationLocation;
|
||||
- (NSString *)stringFromVelocityFromLocation:(CLLocation *)originLocation toLocation:(CLLocation *)destinationLocation atSpeed:(CLLocationSpeed)speed;
|
||||
|
||||
- (TTTLocationFormatterCoordinateOrder)coordinateOrder;
|
||||
- (void)setCoordinateOrder:(TTTLocationFormatterCoordinateOrder)coordinateOrder;
|
||||
|
||||
- (TTTLocationFormatterBearingStyle)bearingStyle;
|
||||
- (void)setBearingStyle:(TTTLocationFormatterBearingStyle)bearingStyle;
|
||||
|
||||
- (TTTLocationUnitSystem)unitSystem;
|
||||
- (void)setUnitSystem:(TTTLocationUnitSystem)unitSystem;
|
||||
|
||||
@end
|
||||
299
Mac Example/Vendor/TTT/TTTLocationFormatter.m
vendored
|
|
@ -1,299 +0,0 @@
|
|||
// TTTLocationFormatter.m
|
||||
//
|
||||
// Copyright (c) 2011 Mattt Thompson (http://mattt.me)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "TTTLocationFormatter.h"
|
||||
|
||||
static double const kTTTMetersToKilometersCoefficient = 0.001;
|
||||
static double const kTTTMetersToFeetCoefficient = 3.2808399;
|
||||
static double const kTTTMetersToYardsCoefficient = 1.0936133;
|
||||
static double const kTTTMetersToMilesCoefficient = 0.000621371192;
|
||||
|
||||
static inline double CLLocationDistanceToKilometers(CLLocationDistance distance) {
|
||||
return distance * kTTTMetersToKilometersCoefficient;
|
||||
}
|
||||
|
||||
static inline double CLLocationDistanceToFeet(CLLocationDistance distance) {
|
||||
return distance * kTTTMetersToFeetCoefficient;
|
||||
}
|
||||
|
||||
static inline double CLLocationDistanceToYards(CLLocationDistance distance) {
|
||||
return distance * kTTTMetersToYardsCoefficient;
|
||||
}
|
||||
|
||||
static inline double CLLocationDistanceToMiles(CLLocationDistance distance) {
|
||||
return distance * kTTTMetersToMilesCoefficient;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
static inline double DEG2RAD(double degrees) {
|
||||
return degrees * M_PI / 180;
|
||||
}
|
||||
|
||||
static inline double RAD2DEG(double radians) {
|
||||
return radians * 180 / M_PI;
|
||||
}
|
||||
|
||||
static inline CLLocationDegrees CLLocationDegreesBearingBetweenCoordinates(CLLocationCoordinate2D originCoordinate, CLLocationCoordinate2D destinationCoordinate) {
|
||||
double lat1 = DEG2RAD(originCoordinate.latitude);
|
||||
double lon1 = DEG2RAD(originCoordinate.longitude);
|
||||
double lat2 = DEG2RAD(destinationCoordinate.latitude);
|
||||
double lon2 = DEG2RAD(destinationCoordinate.longitude);
|
||||
|
||||
double dLon = lon2 - lon1;
|
||||
double y = sin(dLon) * cos(lat2);
|
||||
double x = cos(lat1) * sin(lat2) - sin(lat1) * cos(lat2) * cos(dLon);
|
||||
double bearing = atan2(y, x) + (2 * M_PI);
|
||||
|
||||
// `atan2` works on a range of -π to 0 to π, so add on 2π and perform a modulo check
|
||||
if (bearing > (2 * M_PI)) {
|
||||
bearing = bearing - (2 * M_PI);
|
||||
}
|
||||
|
||||
return RAD2DEG(bearing);
|
||||
}
|
||||
|
||||
TTTLocationCardinalDirection TTTLocationCardinalDirectionFromBearing(CLLocationDegrees bearing) {
|
||||
if(bearing > 337.5) {
|
||||
return TTTNorthDirection;
|
||||
} else if(bearing > 292.5) {
|
||||
return TTTNorthwestDirection;
|
||||
} else if(bearing > 247.5) {
|
||||
return TTTWestDirection;
|
||||
} else if(bearing > 202.5) {
|
||||
return TTTSouthwestDirection;
|
||||
} else if(bearing > 157.5) {
|
||||
return TTTSouthDirection;
|
||||
} else if(bearing > 112.5) {
|
||||
return TTTSoutheastDirection;
|
||||
} else if(bearing > 67.5) {
|
||||
return TTTEastDirection;
|
||||
} else if(bearing > 22.5) {
|
||||
return TTTNortheastDirection;
|
||||
} else {
|
||||
return TTTNorthDirection;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
static double const kTTTMetersPerSecondToKilometersPerHourCoefficient = 3.6;
|
||||
static double const kTTTMetersPerSecondToFeetPerSecondCoefficient = 3.2808399;
|
||||
static double const kTTTMetersPerSecondToMilesPerHourCoefficient = 2.23693629;
|
||||
|
||||
static inline double CLLocationSpeedToKilometersPerHour(CLLocationSpeed speed) {
|
||||
return speed * kTTTMetersPerSecondToKilometersPerHourCoefficient;
|
||||
}
|
||||
|
||||
static inline double CLLocationSpeedToFeetPerSecond(CLLocationSpeed speed) {
|
||||
return speed * kTTTMetersPerSecondToFeetPerSecondCoefficient;
|
||||
}
|
||||
|
||||
static inline double CLLocationSpeedToMilesPerHour(CLLocationSpeed speed) {
|
||||
return speed * kTTTMetersPerSecondToMilesPerHourCoefficient;
|
||||
}
|
||||
|
||||
|
||||
@interface TTTLocationFormatter ()
|
||||
@property (readwrite, nonatomic, assign) TTTLocationFormatterCoordinateOrder coordinateOrder;
|
||||
@property (readwrite, nonatomic, assign) TTTLocationFormatterBearingStyle bearingStyle;
|
||||
@property (readwrite, nonatomic, assign) TTTLocationUnitSystem unitSystem;
|
||||
@property (readwrite, nonatomic, retain) NSNumberFormatter *numberFormatter;
|
||||
@end
|
||||
|
||||
@implementation TTTLocationFormatter
|
||||
@synthesize coordinateOrder = _coordinateOrder;
|
||||
@synthesize bearingStyle = _bearingStyle;
|
||||
@synthesize unitSystem = _unitSystem;
|
||||
@synthesize numberFormatter = _numberFormatter;
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (!self) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
self.coordinateOrder = TTTCoordinateLatLngOrder;
|
||||
self.bearingStyle = TTTBearingWordStyle;
|
||||
self.unitSystem = TTTMetricSystem;
|
||||
|
||||
self.numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
|
||||
[self.numberFormatter setLocale:[NSLocale currentLocale]];
|
||||
[self.numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
|
||||
[self.numberFormatter setMaximumSignificantDigits:2];
|
||||
[self.numberFormatter setUsesSignificantDigits:YES];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)stringFromCoordinate:(CLLocationCoordinate2D)coordinate {
|
||||
return [NSString stringWithFormat:NSLocalizedString(@"(%@, %@)", @"Coordinate format"), [self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:coordinate.latitude]], [self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:coordinate.longitude]], nil];
|
||||
}
|
||||
|
||||
- (NSString *)stringFromLocation:(CLLocation *)location {
|
||||
return [self stringFromCoordinate:location.coordinate];
|
||||
}
|
||||
|
||||
- (NSString *)stringFromDistance:(CLLocationDistance)distance {
|
||||
NSString *distanceString = nil;
|
||||
NSString *unitString = nil;
|
||||
|
||||
switch (self.unitSystem) {
|
||||
case TTTMetricSystem: {
|
||||
double kilometerDistance = CLLocationDistanceToKilometers(distance);
|
||||
if (kilometerDistance > 1) {
|
||||
distanceString = [self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:kilometerDistance]];
|
||||
unitString = NSLocalizedString(@"km", @"Kilometer Unit");
|
||||
} else {
|
||||
double meterDistance = distance;
|
||||
distanceString = [self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:meterDistance]];
|
||||
unitString = NSLocalizedString(@"m", @"Meter Unit");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case TTTImperialSystem: {
|
||||
double feetDistance = CLLocationDistanceToFeet(distance);
|
||||
if (feetDistance < 300) {
|
||||
distanceString = [self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:feetDistance]];
|
||||
unitString = NSLocalizedString(@"ft", @"Feet Unit");
|
||||
} else {
|
||||
double yardDistance = CLLocationDistanceToYards(distance);
|
||||
if (yardDistance < 500) {
|
||||
distanceString = [self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:yardDistance]];
|
||||
unitString = NSLocalizedString(@"yds", @"Yard Unit");
|
||||
} else {
|
||||
double milesDistance = CLLocationDistanceToMiles(distance);
|
||||
distanceString = [self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:milesDistance]];
|
||||
unitString = (milesDistance > 1.0 && milesDistance < 1.1) ? NSLocalizedString(@"mile", @"Mile Unit (Singular)") : NSLocalizedString(@"miles", @"Mile Unit (Plural)");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return [NSString stringWithFormat:NSLocalizedString(@"%@ %@", @"#{Distance} #{Unit}"), distanceString, unitString];
|
||||
}
|
||||
|
||||
- (NSString *)stringFromBearing:(CLLocationDegrees)bearing {
|
||||
switch (self.bearingStyle) {
|
||||
case TTTBearingWordStyle:
|
||||
switch (TTTLocationCardinalDirectionFromBearing(bearing)) {
|
||||
case TTTNorthDirection:
|
||||
return NSLocalizedString(@"North", @"North Direction");
|
||||
case TTTNortheastDirection:
|
||||
return NSLocalizedString(@"Northeast", @"Northeast Direction");
|
||||
case TTTEastDirection:
|
||||
return NSLocalizedString(@"East", @"East Direction");
|
||||
case TTTSoutheastDirection:
|
||||
return NSLocalizedString(@"Southeast", @"Southeast Direction");
|
||||
case TTTSouthDirection:
|
||||
return NSLocalizedString(@"South", @"South Direction");
|
||||
case TTTSouthwestDirection:
|
||||
return NSLocalizedString(@"Southwest", @"Southwest Direction");
|
||||
case TTTWestDirection:
|
||||
return NSLocalizedString(@"West", @"West Direction");
|
||||
case TTTNorthwestDirection:
|
||||
return NSLocalizedString(@"Northwest", @"Northwest Direction");
|
||||
}
|
||||
break;
|
||||
case TTTBearingAbbreviationWordStyle:
|
||||
switch (TTTLocationCardinalDirectionFromBearing(bearing)) {
|
||||
case TTTNorthDirection:
|
||||
return NSLocalizedString(@"N", @"North Direction Abbreviation");
|
||||
case TTTNortheastDirection:
|
||||
return NSLocalizedString(@"NE", @"Northeast Direction Abbreviation");
|
||||
case TTTEastDirection:
|
||||
return NSLocalizedString(@"E", @"East Direction Abbreviation");
|
||||
case TTTSoutheastDirection:
|
||||
return NSLocalizedString(@"SE", @"Southeast Direction Abbreviation");
|
||||
case TTTSouthDirection:
|
||||
return NSLocalizedString(@"S", @"South Direction Abbreviation");
|
||||
case TTTSouthwestDirection:
|
||||
return NSLocalizedString(@"SW", @"Southwest Direction Abbreviation");
|
||||
case TTTWestDirection:
|
||||
return NSLocalizedString(@"W", @"West Direction Abbreviation");
|
||||
case TTTNorthwestDirection:
|
||||
return NSLocalizedString(@"NW", @"Northwest Direction Abbreviation");
|
||||
}
|
||||
break;
|
||||
case TTTBearingNumericStyle:
|
||||
return [[self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:bearing]] stringByAppendingString:NSLocalizedString(@"°", @"Degrees Symbol")];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *)stringFromSpeed:(CLLocationSpeed)speed {
|
||||
NSString *speedString = nil;
|
||||
NSString *unitString = nil;
|
||||
|
||||
switch (self.unitSystem) {
|
||||
case TTTMetricSystem: {
|
||||
double metersPerSecondSpeed = speed;
|
||||
double kilometersPerHourSpeed = CLLocationSpeedToKilometersPerHour(speed);
|
||||
|
||||
if (kilometersPerHourSpeed > 1) {
|
||||
speedString = [self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:kilometersPerHourSpeed]];
|
||||
unitString = NSLocalizedString(@"km/h", @"Kilometers Per Hour Unit");
|
||||
} else {
|
||||
speedString = [self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:metersPerSecondSpeed]];
|
||||
unitString = NSLocalizedString(@"m/s", @"Meters Per Second Unit");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case TTTImperialSystem: {
|
||||
double feetPerSecondSpeed = CLLocationSpeedToFeetPerSecond(speed);
|
||||
double milesPerHourSpeed = CLLocationSpeedToMilesPerHour(speed);
|
||||
|
||||
if (milesPerHourSpeed > 1) {
|
||||
speedString = [self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:milesPerHourSpeed]];
|
||||
unitString = NSLocalizedString(@"mph", @"Miles Per Hour Unit");
|
||||
} else {
|
||||
speedString = [self.numberFormatter stringFromNumber:[NSNumber numberWithDouble:feetPerSecondSpeed]];
|
||||
unitString = NSLocalizedString(@"ft/s", @"Feet Per Second Unit");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return [NSString stringWithFormat:NSLocalizedString(@"%@ %@", @"#{Speed} #{Unit}"), speedString, unitString];
|
||||
}
|
||||
|
||||
- (NSString *)stringFromDistanceFromLocation:(CLLocation *)originLocation toLocation:(CLLocation *)destinationLocation {
|
||||
return [self stringFromDistance:[destinationLocation distanceFromLocation:originLocation]];
|
||||
}
|
||||
|
||||
- (NSString *)stringFromBearingFromLocation:(CLLocation *)originLocation toLocation:(CLLocation *)destinationLocation {
|
||||
return [self stringFromBearing:CLLocationDegreesBearingBetweenCoordinates(originLocation.coordinate, destinationLocation.coordinate)];
|
||||
}
|
||||
|
||||
- (NSString *)stringFromDistanceAndBearingFromLocation:(CLLocation *)originLocation toLocation:(CLLocation *)destinationLocation {
|
||||
return [NSString stringWithFormat:NSLocalizedString(@"%@ %@", @"#{Dimensional Quantity} #{Direction}"), [self stringFromDistanceFromLocation:originLocation toLocation:destinationLocation], [self stringFromBearingFromLocation:originLocation toLocation:destinationLocation]];
|
||||
}
|
||||
|
||||
- (NSString *)stringFromVelocityFromLocation:(CLLocation *)originLocation toLocation:(CLLocation *)destinationLocation atSpeed:(CLLocationSpeed)speed {
|
||||
return [NSString stringWithFormat:NSLocalizedString(@"%@ %@", @"#{Dimensional Quantity} #{Direction}"), [self stringFromSpeed:speed], [self stringFromBearingFromLocation:originLocation toLocation:destinationLocation]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
{\rtf1\ansi\ansicpg1252\cocoartf1138
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid1\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}}
|
||||
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
|
||||
\vieww9600\viewh8400\viewkind0
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
|
||||
\f0\b\fs24 \cf0 AFNetworking Creators\
|
||||
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\pardirnatural
|
||||
\ls1\ilvl0
|
||||
\b0 \cf0 {\listtext \uc0\u8259 }Mattt Thompson\
|
||||
{\listtext \uc0\u8259 }Scott Raymond}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
// main.m
|
||||
//
|
||||
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
||||
15
README.md
|
|
@ -162,24 +162,21 @@ If you are including AFNetworking in a project that uses [Automatic Reference Co
|
|||
|
||||
AFNetworking was created by [Scott Raymond](https://github.com/sco/) and [Mattt Thompson](https://github.com/mattt/) in the development of [Gowalla for iPhone](http://en.wikipedia.org/wiki/Gowalla).
|
||||
|
||||
[TTTLocationFormatter](https://github.com/mattt/FormatterKit/tree/master/TTTLocationFormatter), used in the example project, is part of [FormatterKit](https://github.com/mattt/FormatterKit), created by [Mattt Thompson](https://github.com/mattt/).
|
||||
|
||||
AFNetworking's logo was designed by [Alan Defibaugh](http://www.alandefibaugh.com/).
|
||||
|
||||
And most of all, thanks to AFNetworking's [growing list of contributors](https://github.com/AFNetworking/AFNetworking/contributors).
|
||||
|
||||
## Contact
|
||||
|
||||
Mattt Thompson
|
||||
Follow AFNetworking on Twitter ([@AFNetworking](https://twitter.com/AFNetworking))
|
||||
|
||||
- http://github.com/mattt
|
||||
- http://twitter.com/mattt
|
||||
- m@mattt.me
|
||||
### Creators
|
||||
|
||||
Scott Raymond
|
||||
[Mattt Thompson](http://github.com/mattt)
|
||||
[@mattt](https://twitter.com/mattt)
|
||||
|
||||
- http://github.com/sco
|
||||
- http://twitter.com/sco
|
||||
[Scott Raymond](http://github.com/sco)
|
||||
[@sco](https://twitter.com/sco)
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
|||
|
|
@ -1,75 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F8E4695F1395739C00DB05C8"
|
||||
BuildableName = "AFNetworking iOS Example.app"
|
||||
BlueprintName = "AFNetworking iOS Example"
|
||||
ReferencedContainer = "container:AFNetworking iOS Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F8E4695F1395739C00DB05C8"
|
||||
BuildableName = "AFNetworking iOS Example.app"
|
||||
BlueprintName = "AFNetworking iOS Example"
|
||||
ReferencedContainer = "container:AFNetworking iOS Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F8E4695F1395739C00DB05C8"
|
||||
BuildableName = "AFNetworking iOS Example.app"
|
||||
BlueprintName = "AFNetworking iOS Example"
|
||||
ReferencedContainer = "container:AFNetworking iOS Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>AFNetworking iOS Example.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>F8E4695F1395739C00DB05C8</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
// AppDelegate.m
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import "PublicTimelineViewController.h"
|
||||
|
||||
#import "AFNetworkActivityIndicatorManager.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
@synthesize window = _window;
|
||||
@synthesize navigationController = _navigationController;
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024 diskCapacity:1024 * 1024 * 5 diskPath:nil];
|
||||
[NSURLCache setSharedURLCache:URLCache];
|
||||
|
||||
[[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
|
||||
|
||||
UITableViewController *viewController = [[PublicTimelineViewController alloc] initWithStyle:UITableViewStylePlain];
|
||||
self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
|
||||
self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor];
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
self.window.backgroundColor = [UIColor whiteColor];
|
||||
self.window.rootViewController = self.navigationController;
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
// User.m
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "User.h"
|
||||
|
||||
@implementation User {
|
||||
@private
|
||||
NSUInteger _userID;
|
||||
__strong NSString *_username;
|
||||
__strong NSString *_profileImageURLString;
|
||||
}
|
||||
|
||||
@synthesize userID = _userID;
|
||||
@synthesize username = _username;
|
||||
|
||||
- (id)initWithAttributes:(NSDictionary *)attributes {
|
||||
self = [super init];
|
||||
if (!self) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
_userID = [[attributes valueForKeyPath:@"id"] integerValue];
|
||||
_username = [attributes valueForKeyPath:@"screen_name"];
|
||||
_profileImageURLString = [attributes valueForKeyPath:@"profile_image_url_https"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSURL *)profileImageURL {
|
||||
return [NSURL URLWithString:_profileImageURLString];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
#import <Availability.h>
|
||||
|
||||
#ifndef __IPHONE_3_0
|
||||
#warning "This project uses features only available in iPhone SDK 3.0 and later."
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <SystemConfiguration/SystemConfiguration.h>
|
||||
#endif
|
||||