• 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: Debugging insight needed for NSKeyedUnarchiver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging insight needed for NSKeyedUnarchiver


  • Subject: Re: Debugging insight needed for NSKeyedUnarchiver
  • From: Graham Cox <email@hidden>
  • Date: Mon, 03 Mar 2014 23:34:24 +1100

On 3 Mar 2014, at 9:56 pm, email@hidden wrote:

> It is hard to argue with the statement that you must return self from initWithCoder:.


Well, except what is self? It's perfectly legitimate in an init method to write self = <whatever or nil>. ***that's why you always check if( self ){....} after calling super in all init methods, including -initWithCoder:.***

Documenting that you must return self means nothing - you always return self from an init method. What it does not state (and perhaps should) is that unlike other init methods, self may not be reassigned or set to nil.

> Have you considered using:
>
> - (id)awakeAfterUsingCoder:(NSCoder *)aDecoder

Yes, indeed that's what I am doing. It seems to work and it certainly fixes my problem.

But if there are some rules which need to be made clearer here (rather than just my own understanding), then it still might be worth flushing them out so I can file a bug on the documentation at least.

--Graham



_______________________________________________

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: 
 >Re: Debugging insight needed for NSKeyedUnarchiver (From: email@hidden)
 >Re: Debugging insight needed for NSKeyedUnarchiver (From: Graham Cox <email@hidden>)
 >Re: Debugging insight needed for NSKeyedUnarchiver (From: Graham Cox <email@hidden>)
 >Re: Debugging insight needed for NSKeyedUnarchiver (From: Quincey Morris <email@hidden>)
 >Re: Debugging insight needed for NSKeyedUnarchiver (From: Graham Cox <email@hidden>)
 >Re: Debugging insight needed for NSKeyedUnarchiver (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: Debugging insight needed for NSKeyedUnarchiver
  • Next by Date: Re: NSOperation Dispatch Thread Soft Limit
  • Previous by thread: Re: Debugging insight needed for NSKeyedUnarchiver
  • Next by thread: Re: Debugging insight needed for NSKeyedUnarchiver
  • Index(es):
    • Date
    • Thread