• 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
ObjC procedure vs C procedure within Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ObjC procedure vs C procedure within Cocoa


  • Subject: ObjC procedure vs C procedure within Cocoa
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Fri, 10 Feb 2006 15:55:50 -0800

I have a simple question, from viewing a Quartz example code written with Cocoa.


There a 'C' procedure signature:

void doAlphaRects(CGContextRef context) {...}

mixed with ObjC procedures like:

- (void)drawRect:(NSRect)rect {
...
	doAlphaRects(context);   // This calls the 'C' procedure.
}

==========

My question: why mix when you can use ObjC vs C:

- (void) doAlphaRects(...) {....}

called by:

[self doAlphaRects:context]; ?


Is there an advantage to mix 'C' constructs or is it just style preference?


That is,

void doAlphaRects(CGContextRef context){} vs -(void) doAlphaRects (...){}


Ric.

_______________________________________________
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


  • Follow-Ups:
    • Re: ObjC procedure vs C procedure within Cocoa
      • From: Sherm Pendley <email@hidden>
    • Re: ObjC procedure vs C procedure within Cocoa
      • From: email@hidden
  • Prev by Date: Converting HIPoints to CGPoints/NSPoints in global space?
  • Next by Date: Re: ObjC procedure vs C procedure within Cocoa
  • Previous by thread: Re: Converting HIPoints to CGPoints/NSPoints in global space?
  • Next by thread: Re: ObjC procedure vs C procedure within Cocoa
  • Index(es):
    • Date
    • Thread