Ios 我的ViewController的视图未显示

Ios 我的ViewController的视图未显示,ios,objective-c,uiviewcontroller,uibutton,Ios,Objective C,Uiviewcontroller,Uibutton,我有一个带有自定义派生单元格的表视图控制器。当有人单击单元格中的按钮(下面的编辑按钮)时,我想加载不同的视图控制器以显示弹出对话框 我创建了一个xib和视图控制器,并以这种方式加载了新的VC,但是新VC对象中的所有内容都为零,并且新的VC没有出现 然后,我尝试使用initWithDefaultText:origin:initializer以编程方式创建视图,但它仍然没有出现,但成员小部件现在是有效的 我错过什么了吗 MyListTableViewCell.h @interface MyListT

我有一个带有自定义派生单元格的表视图控制器。当有人单击单元格中的按钮(下面的编辑按钮)时,我想加载不同的视图控制器以显示弹出对话框

我创建了一个xib和视图控制器,并以这种方式加载了新的VC,但是新VC对象中的所有内容都为零,并且新的VC没有出现

然后,我尝试使用initWithDefaultText:origin:initializer以编程方式创建视图,但它仍然没有出现,但成员小部件现在是有效的

我错过什么了吗

MyListTableViewCell.h
@interface MyListTableViewCell : UITableViewCell <MyEditQueryDelegate>
...
MyEditQueryViewController.h
#import <UIKit/UIKit.h>
#import "MyEditQueryDelegate.h"

@interface MyEditQueryViewController : UIViewController

@property (nonatomic, strong) id<MyEditQueryDelegate> delegate;
@property (nonatomic, strong) IBOutlet UITextField* textField;
@property (nonatomic, strong) IBOutlet UIView* editView;
@property (nonatomic, strong) IBOutlet UIButton* cancelButton;
@property (nonatomic, strong) IBOutlet UIButton* saveButton;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil;
- (id)initWithDefaultText:(NSString*)defaultText orign:(CGPoint)origin;

- (IBAction)cancelTapped:(id)sender;
- (IBAction)saveTapped:(id)sender;
@end

当你调用控制器presentViewController时,控制器的价值是什么?@PhillipMills是的……我就是那个笨蛋。我从未设置控制器属性。我仍然不习惯在nil上调用消息而不出错的想法。抢手货在cellForRowAtIndexpath中为按钮添加操作,并在操作方法中显示视图控制器。希望它能起作用。
#import <UIKit/UIKit.h>
#import "MyEditQueryDelegate.h"

@interface MyEditQueryViewController : UIViewController

@property (nonatomic, strong) id<MyEditQueryDelegate> delegate;
@property (nonatomic, strong) IBOutlet UITextField* textField;
@property (nonatomic, strong) IBOutlet UIView* editView;
@property (nonatomic, strong) IBOutlet UIButton* cancelButton;
@property (nonatomic, strong) IBOutlet UIButton* saveButton;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil;
- (id)initWithDefaultText:(NSString*)defaultText orign:(CGPoint)origin;

- (IBAction)cancelTapped:(id)sender;
- (IBAction)saveTapped:(id)sender;
@end
@implementation MyEditQueryViewController 
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    NSLog(@"initWithNibName:bundle:");
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self)
    {
    }

    return self;
}

- (id)initWithDefaultText:(NSString*)defaultText orign:(CGPoint)origin
{
    NSLog(@"initWithDefaultText:origin:");
    self = [super initWithNibName: nil bundle:nil];
    if (self)
    {
        CGRect screenRect = [[UIScreen mainScreen] bounds];
        self.view = [[UIView alloc] initWithFrame:screenRect];

        UIImage* smokeGlass = [UIImage imageNamed:@"SmokeGlass.png"];
        UIImageView* background = [[UIImageView alloc] initWithImage:smokeGlass];
        [self.view addSubview:background];

        CGRect editViewFrame = CGRectMake(0.0, origin.y, screenRect.size.width, 122.0);
        _editView = [[UIView alloc] initWithFrame:editViewFrame];
        [self.view addSubview: _editView];

        CGRect textViewFrame = CGRectMake(20.0, 20.0, 280.0, 30.0);
        _textField = [[UITextField alloc] initWithFrame: textViewFrame];
        _textField.text = defaultText;
        [_editView addSubview: _textField];

        CGRect cancelButtonFrame = CGRectMake(20.0, 72.0, 50.0, 30.0);
        _cancelButton = [[UIButton alloc] initWithFrame:cancelButtonFrame];
        _cancelButton.titleLabel.text = @"Cancel";
        [_cancelButton addTarget:self action:@selector(cancelTapped:)
                forControlEvents:UIControlEventTouchUpInside];
        [_editView addSubview: _cancelButton];

        CGRect saveButtonFrame = CGRectMake(266.0, 72.0, 34.0, 30.0);
        _saveButton = [[UIButton alloc] initWithFrame:saveButtonFrame];
        _saveButton.titleLabel.text = @"Save";
        [_saveButton addTarget:self action:@selector(saveTapped:)
              forControlEvents:UIControlEventTouchUpInside];
        [_editView addSubview: _saveButton];
    }

    return self;
}