I am trying to add a Twitter timeline to an iOS app. Twitter gives the official sample code here: https://dev.twitter.com/docs/ios/making-api-requests-slrequest
My problem: on line 70
if (timelineData) { NSLog(@"Timeline Response: %@\n", timelineData); }
Timeline data is successfully printed on the console. I tried to add
self.dict = timelineDate;
and
return self.dict;
at the end of the function, but actually it returns an empty dictionary. I noticed that the process is running in a different thread, so I tried
dispatch_async(dispatch_get_main_queue(), ^{ self.dict = timelineDate; };
but it still does not work. It can be very easy to solve, but I really can’t find any resources from either Apple or Twitter. Can anyone help?
source share