crino / instagram-ios-sdk

Instagram SDK for iOS
http://www.followgram.me
228 stars 63 forks source link

Don't work delegate #25

Closed brightsider closed 10 years ago

brightsider commented 11 years ago

In my project don't work IGRequestDelegate.

In AppDelegate: self.instagram = [[Instagram alloc] initWithClientId:CLIENT_ID delegate:nil];

Authorization is ok, but when I'm using:

AppDelegate* appDelegate = (AppDelegate)[UIApplication sharedApplication].delegate; appDelegate.instagram.accessToken = [[NSUserDefaults standardUserDefaults] objectForKey:@"instagramAccessToken"]; NSMutableDictionary params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"users/self/feed", @"method", nil]; [appDelegate.instagram requestWithParams:params delegate:self];

In console i get next answer: URL: https://api.instagram.com/v1/users/self/feed?access_token=ACCESS_TOKEN

IGRequestDelegate use with

And it does not result.

ghost commented 10 years ago

i have the same problem, did you solve it? thank you

brightsider commented 10 years ago

No, I don't solve it :(

ghost commented 10 years ago

so have you changed the sdk? @crino please we need help XD

crino commented 10 years ago

at first look the code it's ok. debug the code adding break points in IGRequest and check if the connection methods are ok and if _delegate variable is set correctly

ghost commented 10 years ago

in getRequestWithParams the request.delegate is set to the right delegate, but when handleResponseData method is call, the _delegate is not valid. what's the problem? thanks

ghost commented 10 years ago

i have solve the problem. the problem was in IGRequest header file. Because @property(nonatomic, week) id delegate; is set to week, if you put it to strong the problem is fixed.

crino commented 10 years ago

delegate properties should be week.

you should find why the delegate is released in your code