-
Notifications
You must be signed in to change notification settings - Fork 148
Description
I created a brand new projection Xcode 4.3.2
set type to iphone arc project
set project type to single view
in the controller:
in .h file
@Property (nonatomic, strong) OFFlickrAPIContext *context;
in .m file
-
(void) viewWillAppear:(BOOL)animated
{// Do any additional setup after loading the view, typically from a nib.
self.context = [[OFFlickrAPIContext alloc] initWithAPIKey:@"6903cd1cb6a4bc92e906b76d60c34f63"
sharedSecret:@"4055df0dfc06e60f"];OFFlickrAPIRequest *request = [[OFFlickrAPIRequest alloc] initWithAPIContext:_context];
// set the delegate, here we assume it's the controller that's creating the request object
[request setDelegate:self];NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity: 5];
[params setObject:@"2000-01-01 00:00:00" forKey:@"max_taken_date"];
[params setObject:@"47.60569" forKey:@"lat"];
[params setObject:@"-122.338561" forKey:@"lon"];
[params setObject:@"date_taken" forKey:@"date_taken"];[request callAPIMethodWithGET:@"flickr.photos.search"
}
run the app in simulator
=> app crash, in LFHTTPrequest::readStreamHasBytesAvailable on line 215
_delegate is pointing to a dead pointer