Skip navigation.
 
mlRe: Newbie error
FROM : glenn andreas
DATE : Fri Jun 02 20:22:54 2006

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_removed>
  <http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate  | images, textures, 
fractals, art

Related mailsAuthorDate
mlNewbie error Graham Jun 1, 22:39
mlRe: Newbie error Andrei Tchijov Jun 1, 23:50
mlRe: Newbie error Shawn Erickson Jun 2, 00:11
mlRe: Newbie error Mike Abdullah Jun 2, 00:12
mlRe: Newbie error Joshua Pennington Jun 2, 00:35
mlRe: Re: Newbie error Graham Jun 2, 12:02
mlRe: Newbie error Lon Giese Jun 2, 13:41
mlRe: Newbie error Nir Soffer Jun 2, 14:19
mlRe: Newbie error Jerrod Fowkes Jun 2, 14:51
mlRe: Newbie error Michael Ash Jun 2, 17:42
mlRe: Newbie error Lon Giese Jun 2, 19:28
mlRe: Newbie error glenn andreas Jun 2, 20:22
mlRe: Newbie error Lon Giese Jun 2, 22:32
mlRe: Newbie error I. Savant Jun 2, 22:38