Skip to content
Browse files

Merge pull request #4 from fillito/pull-requests/nsstrings_at_max_min…

…_ids

maxId and minId should be NSStrings
  • Loading branch information...
2 parents 50bb7f4 + 46ab3fa commit ea5b47dc1c94d274969b9e16f83869bd7a866e9e @stuartkhall committed Jan 16, 2013
Showing with 23 additions and 24 deletions.
  1. +9 −9 Instagram/InstagramClient.h
  2. +14 −15 Instagram/InstagramClient.m
View
18 Instagram/InstagramClient.h 100644 → 100755
@@ -22,28 +22,28 @@
// Searches for users
- (void)searchUsers:(NSString*)query // e.g. 'Bob'
- limit:(int)count
+ limit:(NSInteger)count
success:(void (^)(NSArray* users))success
failure:(void (^)(NSError* error, NSInteger statusCode))failure;
// Get the current user's feed
-- (void)getUserFeed:(int)count
- minId:(int)minId // -1 for start
- maxId:(int)maxId // -1 for no upper limit
+- (void)getUserFeed:(NSInteger)count
+ minId:(NSString *)minId // -1 for start
+ maxId:(NSString *)maxId // -1 for no upper limit
success:(void (^)(NSArray* media))success
failure:(void (^)(NSError* error, NSInteger statusCode))failure;
// Get a user's media
- (void)getUserMedia:(NSString*)userId // Can be 'self' for the current user
- count:(int)count
- minId:(int)minId // -1 for start
- maxId:(int)maxId // -1 for no upper limit
+ count:(NSInteger)count
+ minId:(NSString *)minId // -1 for start
+ maxId:(NSString *)maxId // -1 for no upper limit
success:(void (^)(NSArray* media))success
failure:(void (^)(NSError* error, NSInteger statusCode))failure;
// Get the current user's likes
-- (void)getUserLikes:(int)count
- maxId:(int)maxId // -1 for no upper limit
+- (void)getUserLikes:(NSInteger)count
+ maxId:(NSString *)maxId // -1 for no upper limit
success:(void (^)(NSArray* media))success
failure:(void (^)(NSError* error, NSInteger statusCode))failure;
View
29 Instagram/InstagramClient.m 100644 → 100755
@@ -49,7 +49,6 @@ - (void)getPath:(NSString*)path
failure:(void (^)(NSError* error, NSInteger statusCode))failure {
// Add our token to the parameters
[parameters setObject:token forKey:@"access_token"];
-
// Fire off the request
[self getPath:path
parameters:parameters
@@ -88,7 +87,7 @@ - (void)getUser:(NSString*)userId
}
- (void)searchUsers:(NSString*)query
- limit:(int)count
+ limit:(NSInteger)count
success:(void (^)(NSArray* users))success
failure:(void (^)(NSError* error, NSInteger statusCode))failure {
// Fire the get request
@@ -101,15 +100,15 @@ - (void)searchUsers:(NSString*)query
}
// Get the current users feed
-- (void)getUserFeed:(int)count
- minId:(int)minId
- maxId:(int)maxId
+- (void)getUserFeed:(NSInteger)count
+ minId:(NSString *)minId // nil for start
+ maxId:(NSString *)maxId // nil for no upper limit
success:(void (^)(NSArray* media))success
failure:(void (^)(NSError* error, NSInteger statusCode))failure {
// Setup the parameters
NSMutableDictionary* parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:count], @"count", nil];
- if (minId > 0) [parameters setObject:[NSNumber numberWithInt:minId] forKey:@"minId"];
- if (maxId > 0) [parameters setObject:[NSNumber numberWithInt:maxId] forKey:@"maxId"];
+ if (minId) [parameters setObject:minId forKey:@"min_id"];
+ if (maxId) [parameters setObject:maxId forKey:@"max_id"];
// Fire the get request
[self getPath:@"users/self/feed"
@@ -122,15 +121,15 @@ - (void)getUserFeed:(int)count
// Get a user's media
- (void)getUserMedia:(NSString*)userId // Can be 'self' for the current user
- count:(int)count
- minId:(int)minId // -1 for start
- maxId:(int)maxId // -1 for no upper limit
+ count:(NSInteger)count
+ minId:(NSString *)minId // nil for start
+ maxId:(NSString *)maxId // nil for no upper limit
success:(void (^)(NSArray* media))success
failure:(void (^)(NSError* error, NSInteger statusCode))failure {
// Setup the parameters
NSMutableDictionary* parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:count], @"count", nil];
- if (minId > 0) [parameters setObject:[NSNumber numberWithInt:minId] forKey:@"minId"];
- if (maxId > 0) [parameters setObject:[NSNumber numberWithInt:maxId] forKey:@"maxId"];
+ if (minId) [parameters setObject:minId forKey:@"min_id"];
+ if (maxId) [parameters setObject:maxId forKey:@"max_id"];
// Fire the get request
[self getPath:[NSString stringWithFormat:@"users/%@/media/recent", userId]
@@ -142,13 +141,13 @@ - (void)getUserMedia:(NSString*)userId // Can be 'self' for the current user
}
// Get the current user's likes
-- (void)getUserLikes:(int)count
- maxId:(int)maxId // -1 for no upper limit
+- (void)getUserLikes:(NSInteger)count
+ maxId:(NSString *)maxId // nil for no upper limit
success:(void (^)(NSArray* media))success
failure:(void (^)(NSError* error, NSInteger statusCode))failure {
// Setup the parameters
NSMutableDictionary* parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:count], @"count", nil];
- if (maxId > 0) [parameters setObject:[NSNumber numberWithInt:maxId] forKey:@"maxId"];
+ if (maxId) [parameters setObject:maxId forKey:@"max_id"];
// Fire the get request
[self getPath:@"users/self/media/liked"

0 comments on commit ea5b47d

Please sign in to comment.
Something went wrong with that request. Please try again.