Re: Newbie error
Re: Newbie error
- Subject: Re: Newbie error
- From: glenn andreas <email@hidden>
- Date: Fri, 2 Jun 2006 13:22:54 -0500
On Jun 2, 2006, at 12:28 PM, Lon Giese wrote:
as the author clearly stated:
and the instance variable browser is defined as (NSBrowser *) for
this call:
browserDelegate = [[BrowserDelegate alloc] initWith:browser];
(I am pretty sure he meant to say 'method parameter', not 'instance
variable', because the class has no instance variable named
browser. just a little terminology mixup, no biggie) Which is
absolutely correct and should not cause a warning. And IMHO the way
the identifiers are named is not causing this problem.
My guess is that this is a problem that since "alloc" returns an id,
and it finds "initWith:" in several places in the user's code, in
different classes - which is why there are naming conventions for
things like this that it should be called "initWithBrowser". It ends
up picking a different initWith: method (one that doesn't take an
NSBrowser), and thus the warning.
If one were to do:
[(BrowserDelegate *)[BrowserDelegate alloc] initWith: browser];
the problem would go away (assuming this is the problem). The
correct solution, as mentioned previously, is to use more descriptive
method names.
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures,
fractals, art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden