呈现视图控制器时出错

时间:2013-10-12 09:09:28

标签: iphone ios objective-c

我在尝试呈现视图控制器时遇到此错误。我实际上是在ios 4.3 simulator上测试这个项目。其他模拟器它工作正常。这是非弧项目。 ios 4.3及以后版本支持。

request on uploadmanager:<NSMutableURLRequest http://www.livebinders.com/filetree/ipad>
2013-10-12 14:00:54.690 LiveBinders[1703:13b03] -[UploadManagerViewController presentViewController:animated:]: unrecognized selector sent to instance 0x6605a30
2013-10-12 14:00:54.695 LiveBinders[1703:13b03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UploadManagerViewController presentViewController:animated:]: unrecognized selector sent to instance 0x6605a30'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x01ca85a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x017bc313 objc_exception_throw + 44
    2   CoreFoundation                      0x01caa0bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x01c19966 ___forwarding___ + 966
    4   CoreFoundation                      0x01c19522 _CF_forwarding_prep_0 + 50
    5   LiveBinders                         0x0003baa8 -[UploadManagerViewController openEvernote] + 248
    6   LiveBinders                         0x00068e4b -[TableVC tableView:didSelectRowAtIndexPath:] + 171
    7   UIKit                               0x00b97b68 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
    8   UIKit                               0x00b8db05 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 219
    9   Foundation                          0x012a779e __NSFireDelayedPerform + 441
    10  CoreFoundation                      0x01c898c3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
    11  CoreFoundation                      0x01c8ae74 __CFRunLoopDoTimer + 1220
    12  CoreFoundation                      0x01be72c9 __CFRunLoopRun + 1817
    13  CoreFoundation                      0x01be6840 CFRunLoopRunSpecific + 208
    14  CoreFoundation                      0x01be6761 CFRunLoopRunInMode + 97
    15  GraphicsServices                    0x01dfc1c4 GSEventRunModal + 217
    16  GraphicsServices                    0x01dfc289 GSEventRun + 115
    17  UIKit                               0x00b2ec93 UIApplicationMain + 1160
    18  LiveBinders                         0x0000285d main + 93
    19  LiveBinders                         0x000027b5 start + 53

           <----- calling this method on presenting new view controller ---->

-(void)openEvernote
{        
    self.dropboxShareLink = NULL;
    self.dropBoxFileName = NULL;

    EverNoteVC *everNoteVC = [[EverNoteVC alloc]initWithNibName:@"EverNoteView" bundle:nil];
    everNoteVC.delegate = (id)self;

    if (popoverController.isPopoverVisible) {
        [popoverController dismissPopoverAnimated:NO];
    }

    [self presentViewController:everNoteVC animated:YES ];

    [everNoteVC release];
}

1 个答案:

答案 0 :(得分:1)

在5.0之前的iOS版本中,

presentViewController不可用。

尝试

[self presentModalViewController:everNoteVC animated:YES];

代替。