[UIButton retain]:消息发送到设备上的解除分配的实例但不在模拟器上

时间:2014-11-15 11:48:01

标签: ios uibutton retain

我在设备上有上述错误消息但在模拟器上没有 - 这里它正常播放。

这是我的代码:

- (void)loadView {
    NSLog(@"loadView");
    self.scrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
    self.scrollView.delegate = self;
    self.scrollView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"backgroundLeather.png"]];
    self.view = self.scrollView;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    NSLog(@"viewDidLoad is called");

    // add cancel / done button

    self.cancelButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [self.cancelButton addTarget:self
                            action:@selector(cancelButtonAction:)
                  forControlEvents:UIControlEventTouchUpInside];
    [self.cancelButton setTitle:@"Cancel" forState:UIControlStateNormal];
    self.cancelButton.frame = CGRectMake(200.0, 0.0, 100.0, 100.0);
    [self.scrollView addSubview:self.cancelButton];
}

并且EXC_BREAKPOINT发生在self.cancelButton.我有ZombiesEnabled,但除了按钮我看不到任何其他内容 - 我应该在哪里查看?

0 个答案:

没有答案