[ViewController presentPopupViewController:animationType:]:无法识别的选择器

时间:2013-07-18 06:53:31

标签: ios

一直在讨论这个...我正在尝试使用MJViewPopupViewController并继续收到以下错误:

****-[ViewController presentPopupViewController:animationType:]: unrecognized selector sent to instance 0x8016a30
2013-07-17 23:35:20.091 DesiTest[1055:c07] ****** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ViewController presentPopupViewController:animationType:]: unrecognized selector sent to instance 0x8016a30'*******

为了保持简单,我尝试设置一个只有一个按钮的小测试应用程序,单击时会显示包含带标签的UIView的DetailViewController(非常简单)

这是我的代码:

ViewController.m

#import "ViewController.h"
#import "UIViewController+MJPopupViewController.h"
#import "DetailViewController.h"


@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)openView: (id) sender
{
    DetailViewController *dView = [[DetailViewController alloc]initWithNibName:@"DetailViewController" bundle:nil];
    [self presentPopupViewController:dView animationType:MJPopupViewAnimationFade];

}

@end

DetailViewController.m

#import "DetailViewController.h"

@implementation DetailViewController

@end

我真的很感激任何帮助。顺便说一句:我在XCode 4.6.3上。在此先感谢。

2 个答案:

答案 0 :(得分:1)

确保“Compile Sources”设置包含UIViewController + MJPopupViewController.m文件。

答案 1 :(得分:0)

Cahn的建议奏效了。谢谢!!

我添加了UIViewController + MJPopupViewController.m并且它给了我编译错误,然后我还添加了“MJPopupBackgroundView.m”文件。

非常感谢大家:)