• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: PDFPage init methods not called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PDFPage init methods not called


  • Subject: Re: PDFPage init methods not called
  • From: "email@hidden" <email@hidden>
  • Date: Mon, 17 Feb 2014 11:42:38 +0000

On 14 Feb 2014, at 20:32, Antonio Nunes <email@hidden> wrote:

> On 14 Feb 2014, at 15:09, email@hidden wrote:
>
>> PDFPage has two declared initialiser methods:
>>
>> - init
>> - InitWithImage:(NSImage *)image
>>
>> When creating a PDFDocument with -initWithURL: neither of the above are called on my PDFPage subclass.
>>
>> A bit of digging reveals that what is called is the undocumented:
>>
>> - (id)initWithPageRef:(id)pageRef
>>
>> This seems peculiar. Will defining an override on -initWithPageRef: count as the use of private API?
>>
>> I suspect that this is just an oversight in the header.
>
> I would be highly surprised if using that method would not be considered use of private API. The two public init methods are useful when you want to create pages yourself. When opening a PDF document you’ll have to resort to other options to perform custom setup of pages. Is there a particular reason that you really need to be active during the init process?
Being active during the init stage is just the norm.
I personally haven’t encountered any other appkit class that doesn’t call a public initialiser as part of its initialisation.
Perhaps it is more common than I presume.

> I find that I can do whatever I need by iterating through a document’s pages shortly after loading the document. You could declare a method on your subclass, say “finishSetup”, and then call that on each page as you iterate throughout the pages once you have obtained the document from initWithURL:.
>
I think that I will override -initWithURL: in my PDFDocument subclass and do a manual initialisation there.

Thanks

Jonathan
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >PDFPage init methods not called (From: "email@hidden" <email@hidden>)
 >Re: PDFPage init methods not called (From: Antonio Nunes <email@hidden>)

  • Prev by Date: Re: ARC and autorelease pools
  • Next by Date: QTMovieLayer in IKImageBrowserCell
  • Previous by thread: Re: PDFPage init methods not called
  • Next by thread: Hooking up Help menu item
  • Index(es):
    • Date
    • Thread