嗨我正在開發一個應用程序,我已經通過使用這些Twitter-Oath-iPhone集成了Twitter。 這些庫在較低版本上工作正常,然後ios5如何在ios5中使用twitter。我不知道Twitter中有沒有改變API或蘋果在ios5中做出任何改變。請幫我解決這個問題。Twitter intregation沒有響應在(IOS 5)
回答
嘗試通過更換這個功能在"SA_OAuthTwitterEngine.m"
- (SA_OAuthTwitterEngine *) initOAuthWithDelegate: (NSObject *) delegate {
if (self = (id) [super initWithDelegate: delegate]) {
self.requestTokenURL = [NSURL URLWithString: @"http://twitter.com/oauth/request_token"];
self.accessTokenURL = [NSURL URLWithString: @"http://twitter.com/oauth/access_token"];
self.authorizeURL = [NSURL URLWithString: @"http://twitter.com/oauth/authorize"];
}
return self;
}
替代該代碼使用這一個
0的這一個解決我的問題........
Twitter integration for iOS 5 Tutorial:
一個在iOS 5中的激動人心的新功能是Twitter的整合。照片,YouTube,Safari和地圖都完全集成在一起。根據Twitter首席執行官的說法,大多數iOS 5用戶都是Twitter用戶(根據Twitter首席執行官的說法,Twitter每日註冊人數增加了三倍),讓用戶發佈關於您的應用的推文信息可以幫助他們應對更多人。在這個iDevBlogADay文章中,我想編寫一個將你的應用程序與Twitter集成的教程。
您使用的IOS 5 API以及工作"SA_OAuthTwitterEngine.m"
類
只有輕微的變化"SA_OAuthTwitterEngine.m"
類
- (SA_OAuthTwitterEngine *) initOAuthWithDelegate: (NSObject *) delegate
{
if (self = (id) [super initWithDelegate: delegate]) {
self.requestTokenURL = [NSURL URLWithString: @"https://twitter.com/oauth/request_token"];
self.accessTokenURL = [NSURL URLWithString: @"https://twitter.com/oauth/access_token"];
self.authorizeURL = [NSURL URLWithString: @"https://twitter.com/oauth/authorize"];
}
return self;
}
替換該功能對於Twitter的整合在iOS 5中它很容易,因爲新框架添加到ios 5起,只需按照下列步驟操作: 1. add twitter.framework 2. follow from twitter official site
在ios-5中有一個非常簡單的方法用於整合twitter,只需添加Twitter框架並使用此代碼即可。鏈接如下。
您也可以使用此代碼與iOS5的Twiiter的內在框架..... 剛剛從你的編譯庫 添加Twitter.framework
,然後只需要導入波紋管頭文件在你viewcontroller.h文件
#import <Twitter/TWTweetComposeViewController.h>
afetr,當你想分享你在Twitter上的消息只是用波紋管代碼 在viewcontroller.m文件再次只需要導入
#import <Twitter/TWTweetComposeViewController.h>
.....
- (IBAction)shareOnTwitter:(id)sender {
TWTweetComposeViewController *twitter = [[TWTweetComposeViewController alloc] init];
[twitter setInitialText:@"It's really that simple!"];
[twitter addImage:[UIImage imageNamed:@"yourimage.jpg"]];//if required
[twitter addURL:[NSURL URLWithString:@"your url link"]];//if required
[self presentViewController:twitter animated:YES completion:nil];
twitter.completionHandler = ^(TWTweetComposeViewControllerResult res) {
if(res == TWTweetComposeViewControllerResultDone)
{
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Succes!" message:@"Your Tweet was posted succesfully" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}else if(res == TWTweetComposeViewControllerResultCancelled)
{
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Canceled" message:@"Your Tweet was not posted" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}
[self dismissModalViewControllerAnimated:YES];
};
}
願這幫助你 這個代碼可以在模擬器B時無法正常工作一段時間所以在設備測試.....
- 1. iOS 5 Twitter API
- 2. 在Laravel 5中沒有Ajax響應
- 3. iOS UITextField在UIScrollView沒有響應
- 4. IOS - 動畫沒有響應
- 5. iOS UITaprecognizer沒有響應
- 6. iOS 5 WeeApp小部件沒有響應觸摸
- 7. Twitter Bootstrap菜單沒有響應觸摸
- 8. UITextField在iOS 7.1上沒有響應
- 9. popoverContentSize在iOS中沒有響應8
- 10. PhoneGap的應用工程在iOS 6中,但沒有的iOS 5
- 11. iOS JSON Twitter響應,轉換爲可變
- 12. 在沒有iOS 5設備的情況下測試iOS 5應用程序
- 13. ios 5 twitter初始登錄
- 14. iOS 5 twitter的使用
- 15. 集成Twitter如IOS - 5
- 16. iOS 8 UISplitViewController委託沒有響應
- 17. iOS - UIViews沒有響應觸摸事件
- 18. PhoneGap 1.1.0和iOS 5.0 FileWriter沒有響應
- 19. iOS嵌套的UIScrollViews沒有響應
- 20. 硒在沒有響應的頁面上沒有響應
- 21. 升級的iOS 5 SDK響應奇怪
- 22. 導航菜單在Drupal中使用Twitter Bootstrap時沒有響應
- 23. 沒有響應
- 24. 沒有響應
- 25. KeyListener沒有響應
- 26. 嘗試登錄在iOS應用中,沒有JSON響應
- 27. Twitter for iOS 5導致應用崩潰在presentViewController上:call
- 28. 從我的iOS 5應用程序打開Twitter應用程序
- 29. iOS 5 - 在應用程序購買沒有獲得產品
- 30. Spring security + Struts 1.2 intregation