Cannot post to twitter via Twitter-OAuth-iPhone in a NSThread -
i started using ben gottlieb's twitter-oauth-iphone class post status updates in app. have done so, when executed on application's main thread. but, when throw in "nsthread detachnewthreadselector" post never makes twitter. processes fine , proper [connection identifier], results never make on twitter. idea how can run in thread without bringing main thread?
code added tweet method
-(void)tweet{ if([_engine isauthorized]){ [_engine sendupdate:@"tweeting"]; } }
doesn't work:
[nsthread detachnewthreadselector:@selector(tweet) totarget:self withobject:nil];
does work (from main app):
[self tweet];
does work (from within thread):
[self performselectoronmainthread:@selector(tweet) withobject:nil waituntildone:no];
Comments
Post a Comment