racheltho / Twitter-App

a simple Swift app to read and compose tweets using the Twitter API and OAuth login flow
4 stars 1 forks source link

Crasher Fix #1

Open sandofsky opened 9 years ago

sandofsky commented 9 years ago

From 715280580339ef84eb8c843c37a3a44c8b6b03c1 Mon Sep 17 00:00:00 2001 From: Ben Sandofsky ben@sandofsky.com Date: Fri, 20 Feb 2015 16:03:51 -0800 Subject: [PATCH] Fix compiler crash.


Twitter-App/TwitterClient.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Twitter-App/TwitterClient.swift b/Twitter-App/TwitterClient.swift index 34c3f29..b146948 100644 --- a/Twitter-App/TwitterClient.swift +++ b/Twitter-App/TwitterClient.swift @@ -12,7 +12,8 @@ import UIKit

let twitterBaseURL = NSURL(string: "https://api.twitter.com")

+private let twitterConsumerKey = NSBundle.mainBundle().objectForInfoDictionaryKey("CONSUMER_KEY") as NSString +private let twitterConsumerSecret = NSBundle.mainBundle().objectForInfoDictionaryKey("CONSUMER_SECRET") as NSString

class TwitterClient: BDBOAuth1RequestOperationManager {

@@ -20,8 +21,6 @@ class TwitterClient: BDBOAuth1RequestOperationManager { var loginCompletion: ((user: User?, error: NSError?) -> ())?

 class var sharedInstance: TwitterClient {
racheltho commented 9 years ago

The project now builds, but it fails to get the request token. I toggled back and forth with hardcoding the keys several times, and each time I could get the request token when the keys were hardcoded, and failed to get the request token when reading the keys from the NSBundle.