• 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
private methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

private methods?


  • Subject: private methods?
  • From: Todd Gureckis <email@hidden>
  • Date: Fri, 19 Oct 2001 01:38:55 -0500

hello,

sorry if this is a very basic question, but i can't seem to find an clear answer to this anywhere online.

I am creating an class that needs quite a few internal methods. These methods need not be available to users of the class however. I would however like these methods to share the same variable space as standard interface methods. something like private member functions in c++.

i feel that his must be possible, but i am not sure of the syntax for obj-c.

if the above is unclear: basically I want to know where i can put the method declarations and where to put the method definitions for functions that is are in the public interface but still has access to the private variables of the class.

then my next question is how to call such a function from within a public method. i don't know how obj-c would handle this but, it seems that placing the message

[self myPrivateMethod];

in the middle of a public method like - (void)init would violate the "privateness" of the myPrivateMethod.(??)

thanks for any guidance,
todd


  • Follow-Ups:
    • Re: private methods?
      • From: Ondra Cada <email@hidden>
    • Re: private methods?
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Re: display special characters
  • Next by Date: Re: Pointers to methods (or functions, for that matter)
  • Previous by thread: Narrowing in on NSTableView problem..
  • Next by thread: Re: private methods?
  • Index(es):
    • Date
    • Thread