开发者

Custom UIView delegate nightmare

I am having a hell of a job trying to get a delegate setup on a custom view.

This is the init code:

- (id)initWithPageNumber:(int)page {

    self = [super init];

    if (self) {

        UpgradeContentView *v = [开发者_运维技巧[UpgradeContentView alloc] initWithPageNumber:page];

        [self setView:v];

        [v release];
    }

    return self;
}

then in viewDidLoad I have this:

- (void)viewDidLoad {

    [super viewDidLoad];

    [(UpgradeContentView *)self.view setDelegate:self];
}

which does not error and the program runs, but none of my delegate methods get called, I have placed NSLog calls and break points but the delegate seems not to be working.

I am doing this completely wrong?

Thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜