开发者

init not being called on PDFPage subclass?

I have a custom PDFDocument class where I have subclassed - (Class)pageClass and return the Class method of my custom PDFPage. Then in my PDFPage class I have created an implementation for init like so:

开发者_运维技巧
- (id)init
{
    self = [super init];
    if (self) {
        NSLog(@"Custom PDFClass initiated");
    }

return self;
}

and it is not being called when I open a PDF document. I have checked the result of - (PDFPage *)pageAtIndex:(NSUInteger)index and it is returning an instance of my custom class. What am I doing wrong?


PDFPage objects are usually created with initWithDocument or initWithImage, if you would like to do something at initialization, you should probably override both.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜