iOS5 - twitter问题的sharekit

4 iphone twitter objective-c uikeyboard ios5

我只在iOS5的sharekit中遇到键盘问题.而是将文本内容发布到twitter.

在此输入图像描述.我已经附上我面临问题的屏幕截图1.取消按钮不起作用2.Keyboard没有消失.

如果有人解决了这个问题,请帮助我.

Ale*_*nte 5

编辑:

修复问题#254 - IOS 5取消按钮修复问题 https://github.com/ideashower/ShareKit/issues/254.

在iOS 5中,模态呈现的视图控制器具有nil parentViewController,而演示者则呈现ViewController.使用parentViewController更改了关闭视图的尝试,以检查iOS 5选择器,并在可用时使用它.

所以获取最新的ShareKit.

编辑2:

如果设备有iOS 5,我建议使用TWTweetComposeViewController.

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];
            }
Run Code Online (Sandbox Code Playgroud)

添加你的h文件

#if defined(__IPHONE_5_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_5_0
#import <Twitter/Twitter.h>
#import <Accounts/Accounts.h>
#endif
Run Code Online (Sandbox Code Playgroud)

并将Twitter框架和帐户添加为可选库.