• 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: Compile warnings according to method order
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compile warnings according to method order


  • Subject: Re: Compile warnings according to method order
  • From: "Sean McBride" <email@hidden>
  • Date: Fri, 10 Aug 2007 11:39:45 -0400
  • Organization: Rogue Research

On 8/10/07 9:57 AM, Martin Kyte said:

>I thought in my simple understanding methods could go in any order.
>warnings look like this and the application indeed does not respond
>as it should
>
>Building target "RaiseMan" of project "RaiseMan" with configuration
>"Debug" -- (3 warnings)
>
>  'MyDocument' may not respond to '-stopObservingPerson:'
>  'MyDocument' may not respond to '-startObservingPerson:'
>  'MyDocument' may not respond to '-startObservingPerson:'

That's just the compiler being stupid, as Wincent described.

I think it is best to order methods in your .m file so this doesn't
happen.  Sometimes though, you can't, and in that case you could do as
Wincent described and declare the methods in your .h file, but this
breaks the interface/implementation separation, which is very bad imho.
Instead, at the top of your .m file, do this:

// Private methods to be used only by this class, put here to prevent
compiler warning
@interface MyClass(MyClassPrivate)
- (void)startObservingPerson:(Person *)person;
- (void)stopObservingPerson:(Person *)person;
@end

hth,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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: 
 >Compile warnings according to method order (From: Martin Kyte <email@hidden>)

  • Prev by Date: Re: User Shutdown or Logout
  • Next by Date: Re: [FIXED] calling scrollPoint: on table view from separate thread locks up app
  • Previous by thread: Re: Compile warnings according to method order
  • Next by thread: Re: Compile warnings according to method order
  • Index(es):
    • Date
    • Thread