Re: initWithObject Confusion
Re: initWithObject Confusion
- Subject: Re: initWithObject Confusion
- From: Kyle Sluder <email@hidden>
- Date: Thu, 8 Apr 2010 14:10:25 -0700
On Thu, Apr 8, 2010 at 2:05 PM, John Nairn <email@hidden> wrote:
> 1. Why would the initWithObject: compile in the first place? (perhaps
> because one of my custom classes defines an initWithObject: method)
Correct. +alloc is typed to return id, which the compiler won't warn
about if it has ever seen the method you're sending defined on any
class.
> 2. Even if it compiles, how can it run in Snow Leopard when there is no
> initWithObject: selector for NSArray (or at least according to the NSArray
> docmentation there isn't one)?
Have you checked your console output? Or there might be a private
-initWithObject: method and you happened to get lucky.
--Kyle Sluder
_______________________________________________
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