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.
精彩评论