• 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: How to write a "function" in Cocoa?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to write a "function" in Cocoa?


  • Subject: Re: How to write a "function" in Cocoa?
  • From: Scott Anguish <email@hidden>
  • Date: Sat, 4 Nov 2006 02:35:40 -0500


On Nov 4, 2006, at 2:31 AM, Joel Norvell wrote:

Dear Cocoa-dev People,

I've had to implement identical functions in unrelated classes to manipulate
NSRects. These functions also use Cocoa objects. Doing a Category doesn't
seem feasible here since NSRect is not a class. How can I factor these
functions into a file like MyRectUtilities.h? Is there example code that does
this? (I've looked around but haven't found anything.)


Thanks,
Joel

P.S. I'm calling them "functions" since they don't use/need "self".


it's no different than doing it in C (since Obj-C is just a superset).

You'll need to declare them, write them, and import the appropriate header when you want to use them.

_______________________________________________
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: 
 >How to write a "function" in Cocoa? (From: Joel Norvell <email@hidden>)

  • Prev by Date: How to write a "function" in Cocoa?
  • Next by Date: Re: How to write a "function" in Cocoa?
  • Previous by thread: How to write a "function" in Cocoa?
  • Next by thread: Re: How to write a "function" in Cocoa?
  • Index(es):
    • Date
    • Thread