0

一直在打我的头......我正在尝试使用 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'*******

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

这是我的代码:

视图控制器.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

细节视图控制器.m

#import "DetailViewController.h"

@implementation DetailViewController

@end

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

4

2 回答 2

1

确保您的“编译源”设置包含 UIViewController+MJPopupViewController.m 文件。

于 2013-07-18T08:56:34.577 回答
0

卡恩的建议奏效了。谢谢!!

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

非常感谢大家:)

于 2013-07-18T18:45:12.280 回答