• 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: difference between a method and function?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: difference between a method and function?


  • Subject: Re: difference between a method and function?
  • From: Ben Dougall <email@hidden>
  • Date: Mon, 25 Aug 2003 14:32:40 +0100

On Sunday, August 24, 2003, at 10:52 pm, Alastair J.Houghton wrote:

2. Functions

+ Calls are slightly faster (unless you use an IMP).

that's what i suspected

- Don't have access to object member variables (unless written within the bounds of an @implementation clause, in which case they still don't have direct access [they need a pointer to the object]).

that's what i've just found out (a not accessible variable even though it's declared in the implementation so is accessible to all methods but not functions - needs variables passing to it)

i'm parsing data and keep needing to do the same things, like skipping the white space (which isn't the same white space as c defines) for example. at the moment i just repeat the 2 lines that do that. seems like over kill to make a skip white space method, and a function felt (without actually knowing, hence this question) more appropriate. looks like a function is more appropriate, apart from its blindness to global (within the object) variables.

thanks for the info.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: difference between a method and function? (From: "Alastair J.Houghton" <email@hidden>)

  • Prev by Date: Re: NSAttributedString
  • Next by Date: Re: difference between a method and function?
  • Previous by thread: Re: difference between a method and function?
  • Next by thread: Re: difference between a method and function?
  • Index(es):
    • Date
    • Thread