0

'-[MTviewFilesVC launchVF]:无法识别的选择器发送到实例 0x1e59fcd0'

我向一个类添加了一个方法,但调用它会创建“无法识别的选择器”运行时错误调用代码是:

self.viewFilesVCPtr = [[MTviewFilesVC alloc] init];
[self.viewFilesVCPtr launchVF];

例如,如果我替换了已经存在的 viewDidLoad,因此我认为调用代码没问题。我需要在 lanuchVF 的声明中添加其他内容以使其可见吗?

方法声明等是:

。H:

#import "DirectoryWatcher.h"

@interface MTviewFilesVC : UITableViewController   <QLPreviewControllerDataSource,
                                                    QLPreviewControllerDelegate,
                                                    DirectoryWatcherDelegate,
                                                    UIDocumentInteractionControllerDelegate>
-(IBAction)saveViewFiles;
- (void)launchVF;

@end

米:

@interface MTviewFilesVC ()

@property (nonatomic, strong) DirectoryWatcher *docWatcher;
@property (nonatomic, strong) NSMutableArray *documentURLs;
@property (nonatomic, strong) UIDocumentInteractionController *viewFileController;
-(void) launchVF;
@end

...

- (void)lanuchVF
{
    UIStoryboard *settingsStoryBoard = [UIStoryboard storyboardWithName:
                                        @"viewFiles" bundle:nil];
    UIViewController *initialViewFilesVC = [settingsStoryBoard instantiateInitialViewController];
    initialViewFilesVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:initialViewFilesVC animated:YES];

}
4

1 回答 1

4

您在 .m 中的方法名称有错字,lanuchVF而不是launchVF:-)

于 2013-05-26T00:26:53.620 回答