在我的iPhone應用程序,iPhone:嘰嘰喳喳工作中的iOS4.3罰款,但在iOS5中不工作與Twitter + OAuth的
我已經實現了Twitter功能與Twitter + OAuth的庫。它在ios 4.3中正常工作,但它在ios 5中不起作用。然後,代碼可能會出現什麼問題。
我要澄清的是我的應用程序的部署目標爲4.3 ...
你有什麼想法?
在我的iPhone應用程序,iPhone:嘰嘰喳喳工作中的iOS4.3罰款,但在iOS5中不工作與Twitter + OAuth的
我已經實現了Twitter功能與Twitter + OAuth的庫。它在ios 4.3中正常工作,但它在ios 5中不起作用。然後,代碼可能會出現什麼問題。
我要澄清的是我的應用程序的部署目標爲4.3 ...
你有什麼想法?
我建議使用TWTweetComposeViewController如果設備的iOS 5
Class TWTweetComposeViewControllerClass = NSClassFromString(@"TWTweetComposeViewController");
if (TWTweetComposeViewControllerClass != nil) {
if([TWTweetComposeViewControllerClass respondsToSelector:@selector(canSendTweet)]) {
UIViewController *twitterViewController = [[TWTweetComposeViewControllerClass alloc] init];
[twitterViewController performSelector:@selector(setInitialText:)
withObject:NSLocalizedString(@"TwitterMessage", @"")];
[twitterViewController performSelector:@selector(addURL:)
withObject:url];
[twitterViewController performSelector:@selector(addImage:)
withObject:[UIImage imageNamed:@"yourImage.png"]];
[self.navigationController presentModalViewController:twitterViewController animated:YES];
[twitterViewController release];
}
} else {
[SHK flushOfflineQueue];
SHKItem *item = [SHKItem URL:url title:NSLocalizedString(@"TwitterMessage", @"")];
// Get the ShareKit action sheet
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
// Display the action sheet
[actionSheet showInView:[self.view superview].window];
}
添加在您的.h文件
#if defined(__IPHONE_5_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_5_0
#import <Twitter/Twitter.h>
#import <Accounts/Accounts.h>
#endif
中添加Twitter框架和賬戶作爲可選庫。
它工作絕對好........ – 2012-02-08 05:35:47
謝謝.....夥計們 – 2012-02-08 05:35:59
使用本linkhttp://stackoverflow.com/questions/9124521/iphone-twitter-sdk-integration-problems-with-ios-5-devices/9124813#9124813 – Deepesh 2012-02-07 14:17:52
據工作fine..thanks你的早期反應..真的很感謝.... – 2012-02-08 05:36:35
你可以點擊左邊的複選標記將此答案標記爲已接受的答案,在url上方 - 這是感謝Aript的最佳方式。 – Deepesh 2012-02-08 05:52:39