使用SLServiceTypeFacebook时从SLComposeViewController获取UITextView

时间:2013-05-08 00:29:39

标签: iphone ios objective-c ipad slcomposeviewcontroller

我正在尝试获取SLComposeViewController的UITextView,我该如何获取它?我尝试了以下但是它不起作用:

  [viewController presentViewController:facebookController
           animated:YES
           completion:^{
               for (UIView *viewLayer1 in facebookController.view.subviews) {
                   for (UIView *viewLayer2 in viewLayer1.subviews) {
                       if ([viewLayer2 isKindOfClass:[UIView class]]) {
                           for (UIView *viewLayer3 in viewLayer2.subviews) {
                               if ([viewLayer3 isKindOfClass:[UITextView class]]) {
                                   [(UITextView *)viewLayer3 setDelegate:self];

                               }
                           }
                       }
                   }
               }               }];

仅供参考,如果上面的代码为SLServiceTypeTwitter,则上述代码可以正常运行,但如果它是SLServiceTypeFacebook

则无效

1 个答案:

答案 0 :(得分:1)

看起来0x7fffffff设法在这个答案中得到它: https://stackoverflow.com/a/13737046/189804

请注意他的注意事项:“重要提示:请注意,只有放置在完成处理程序中,上述内容才有效。”