• 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: Newbie error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: Re: Newbie error (From: Graham <email@hidden>)
 >Re: Newbie error (From: Lon Giese <email@hidden>)
 >Re: Newbie error (From: "Michael Ash" <email@hidden>)
 >Re: Newbie error (From: Lon Giese <email@hidden>)

  • Prev by Date: Re: 2nd fullscreen window and keyboard input
  • Next by Date: Re: NSMatrix setCellClass: vs setPrototype:
  • Previous by thread: Re: Newbie error
  • Next by thread: Re: Newbie error
  • Index(es):
    • Date
    • Thread