• 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: C to Objective-C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C to Objective-C


  • Subject: Re: C to Objective-C
  • From: Manfred Lippert <email@hidden>
  • Date: Fri, 4 Oct 2002 19:44:51 +0200

How do I write this C call in Cocoa?

Wrong question. C is a programming language, Cocoa is a framework (class library).

How should I write it in Objective-C?

This a better question. ;-) C and Obj-C are both programming languages.
But you do not need to rewrite your C code, because Obj-C _is_ actually C. Just with a few "little" extensions ...
C is a subset of Obj-C.

I've tried - (void)verticesX:(float)xVert[] Y:yVert[] T:(int)TOTAL;

You tried to make an Obj-C method (or selector or whatever you call it) from the C function. This makes no sense without having a class to write the method for.
To use it in a class you have to rethink your whole problem to solve it in a object oriented way instead of a function oriented way.

Regards,
Mani
_______________________________________________
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: 
 >C to Objective-C (From: Jon <email@hidden>)

  • Prev by Date: NSPrintInfo and updateChangeCount problems
  • Next by Date: Re: C to Objective-C
  • Previous by thread: Re: C to Objective-C
  • Next by thread: Fwd: C to Objective-C
  • Index(es):
    • Date
    • Thread