forked from pumptheory/SAPI-Cocoa-SDK
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored to use multiple result classes
- Loading branch information
Showing
16 changed files
with
187 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// SAPIListingResult.h | ||
// Sensis SAPI | ||
// | ||
// Created by Mark Aufflick on 22/03/12. | ||
// Copyright (c) 2012 Pumptheory Pty Ltd. All rights reserved. | ||
// | ||
|
||
#import "SAPIResult.h" | ||
|
||
@interface SAPIListingResult : SAPIResult | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// SAPIListingResult.m | ||
// Sensis SAPI | ||
// | ||
// Created by Mark Aufflick on 22/03/12. | ||
// Copyright (c) 2012 Pumptheory Pty Ltd. All rights reserved. | ||
// | ||
|
||
#import "SAPIListingResult.h" | ||
|
||
@implementation SAPIListingResult | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// SAPISearchResult.h | ||
// Sensis SAPI | ||
// | ||
// Created by Mark Aufflick on 22/03/12. | ||
// Copyright (c) 2012 Pumptheory Pty Ltd. All rights reserved. | ||
// | ||
|
||
#import "SAPIResult.h" | ||
|
||
@interface SAPISearchResult : SAPIResult | ||
|
||
@property (retain) NSArray * results; // This is currently an array of NSDictionaries. | ||
// In the future it will become an array of custom objects (which will respond to "objectForKey:" to maintain compatibility) | ||
|
||
@property NSUInteger count; | ||
@property NSUInteger totalResults; | ||
@property NSUInteger currentPage; | ||
@property NSUInteger totalPages; | ||
@property (retain) NSString * executedQuery; | ||
@property (retain) NSString * originalQuery; | ||
@property (retain) NSDate * date; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// SAPISearchResult.m | ||
// Sensis SAPI | ||
// | ||
// Created by Mark Aufflick on 22/03/12. | ||
// Copyright (c) 2012 Pumptheory Pty Ltd. All rights reserved. | ||
// | ||
|
||
#import "SAPISearchResult.h" | ||
|
||
#import "SAPIISO8601DateFormatter.h" | ||
|
||
@implementation SAPISearchResult | ||
|
||
@synthesize results; | ||
@synthesize count; | ||
@synthesize totalResults; | ||
@synthesize currentPage; | ||
@synthesize totalPages; | ||
@synthesize executedQuery; | ||
@synthesize originalQuery; | ||
@synthesize date; | ||
|
||
- (void)setValue:(id)value forKey:(NSString *)key | ||
{ | ||
if ([key isEqualToString:@"date"] && [value isKindOfClass:[NSString class]]) | ||
{ | ||
SAPIISO8601DateFormatter * formatter = [[SAPIISO8601DateFormatter alloc] init]; | ||
self.date = [formatter dateFromString:value]; | ||
[formatter release]; | ||
} | ||
else | ||
{ | ||
[super setValue:value forKey:key]; | ||
} | ||
} | ||
|
||
@end |
Oops, something went wrong.