2

I am trying to use Ben Gottliebs Twitter-OAuth-iPhone within an iOS5 app that uses ARC. I already flagged the files with -fno-objc-arc. But now I get a lot of errors. I don't know where to start. Without ARC the framework seems to work just fine. Any help would be appreciated.

Edit: it seems that is has something to do with SecKeychainItemRef I can not find the answer here: https://stackoverflow.com/questions/3675522/how-to-use-mgtwitterengine-for-iphone

Community
  • 1
  • 1
Christian Loncle
  • 1,584
  • 3
  • 20
  • 30
  • Have you solved this problem. Can you share your solution ? – Illep Jan 06 '12 at 18:16
  • @Chrizzz, can u help me.... i also stuck same problem last 3-4 days..now i realize i wasting a lot of time in it.. Do u have any compatible sample code in which twitter will supporting both versions iOS 4 and iOS 5? – Tirth May 18 '12 at 05:04
  • @iHungry I am sorry. But fortunately, according to current stats, already 80% of the users have iOS5 – Christian Loncle Jun 06 '12 at 09:20

3 Answers3

6

I hope is not considered bad etiquette to recommend my own project, but I believe it's relevant to this question, so...

I just published a new OAuth library to GitHub that's fully ARC compatible. It comes with a working demo that implements the whole Twitter OAuth flow and allows you to post a tweet. You can find it here: RSOAuthEngine.

Rodrigo Sieiro
  • 595
  • 1
  • 4
  • 12
  • I tried running this application, but it didn't work. First it said that `` is not available and after adding it says `' missing. What should i do ? – Illep Jan 06 '12 at 17:06
  • 1
    @Illep I believe this is related to a wrong compiler directive in MKNetworkKit. I'm going to double check it and create a new issue if that's the case, but for now, if you're compiling only for iOS, remove the files "NSAlert+MKNetworkKitAdditions.*" from your project and it should work. – Rodrigo Sieiro Jan 18 '12 at 19:38
  • Instead of calling a xib file (after clicking on tweet bar button), is there any way i could add the content of the xib file programatically ? (as in write code to initialize the webview, label etc) ? `- (void)twitterEngine:(RSTwitterEngine *)engine needsToOpenURL:(NSURL *)url { self.webView = [[WebViewController alloc] initWithURL:url]; self.webView.delegate = self; [self presentModalViewController:self.webView animated:YES]; }` ViewDidLoad is called after initWithURL is called, so where should i create the content of the xib (label, webview etc) programatically ? – Illep Jan 19 '12 at 16:02
  • I have integrated twitter successively and i could also tweet with it. I need to know how could i logout from the twitter account ? I can't find a way to log out, so could you tell me how can i do it ? – Illep Jan 25 '12 at 15:34
  • @Illep in the demo app, just slide your finger through the black bar and it will log you off. But that's just a demo of how to implement it, you can do it however you want :) – Rodrigo Sieiro Jan 26 '12 at 01:04
2

You might want to consider using the official Twitter API that's available with iOS 5. Here's a post on how to use it: http://www.peterfriese.de/the-accounts-and-twitter-framework-on-ios-5/

Peter Friese
  • 6,709
  • 31
  • 43
  • Sure, thats an option. But It gives me less flexibility. Like sending a tweet in the background. And it is not support for iOS4 devices although i wrote my code with ARC – Christian Loncle Nov 19 '11 at 20:40
0

You could just tell the compiler not to use ARC on the files included in that library.

ios5 ARC what is the compiler flag to exclude a file from ARC?

Community
  • 1
  • 1
James Hall
  • 6,469
  • 6
  • 27
  • 28