开发者

Custom UIView delegate nightmare

开发者 https://www.devze.com 2023-03-05 00:46 出处:网络
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 {

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

精彩评论

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