在打我的頭在這個...我想使用MJViewPopupViewController並不斷收到以下錯誤:[視圖控制器presentPopupViewController:將animationType:]:無法識別選擇
****-[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上。提前致謝。
您的視圖控制器是MJViewPopupViewController的子類嗎? – zbMax
嗨zbMax,沒有我的視圖控制器不是MJViewPopupViewController的子類。我只是按照作者的例子。 –
你可以給我一個鏈接到你創建這個地方嗎?我想看看。 – zbMax