重新启动应用程序后无法查看

时间:2014-07-08 14:37:34

标签: ios objective-c ipad uiviewcontroller oauth

我正在使用的iOS(iPad)应用程序需要通过Twitter进行OAuth。

目前,我启动了Safari(使用STTwitter),用户登录Twitter并授权应用程序。然后我有一个回调,重新激活应用程序并传递令牌。

这可以按预期工作。

然而,当应用程序重新激活时,我想Segue到一个新的VC。但是由于某些原因,一旦应用程序重新启动,我无法手动调用任何Segues,它只会崩溃,抱怨请求的Segue不可用。

我能够使用对象很好地进行Segue。如果我绕过了标注代码以便应用程序不会关闭,那么Segue运行正常。

我猜测View Controller正在以某种方式从内存中卸载,即使它在应用程序恢复时仍然可见。

有什么想法吗?

由于

加雷

修改1 - 添加代码

这是被调用的代码。这实际上似乎是一个问题,在应用程序重新启动后所有代码都称为Seguays不起作用。但是打开连接到对象do。

- (void)UploadSuccess{

    [self.navigationController performSegueWithIdentifier:@"approveSeguay" sender:self];

}

在AppDelegate

中从此方法在View Controller中调用
- (void)postToTwitter:(NSString*)postText image:(UIImage*)image{

NSData *data = UIImageJPEGRepresentation(image, 0.5);

[_twitter postStatusUpdate:postText
            mediaDataArray:@[data]
         possiblySensitive:nil
         inReplyToStatusID:nil
                  latitude:nil
                 longitude:nil
                   placeID:nil
        displayCoordinates:nil
       uploadProgressBlock:^(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite) {

       } successBlock:^(NSDictionary *status) {

           ViewController * vc = [[ViewController alloc]init];
           [vc uploadSuccess];

       } errorBlock:^(NSError *error) {

           ViewController * vc = [[ViewController alloc]init];
           [vc uploadFail:error];

       }];



}

我也试过这个,也没有做任何事情:

- (void)UploadSuccess{

    UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"viewPhoto"];
    [self.navigationController pushViewController:controller animated:YES];

}

如果我设置断点,他们都会被击中,并且没有任何错误记录。

谢谢!

加雷

0 个答案:

没有答案