• 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
C code in Object-C?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C code in Object-C?


  • Subject: C code in Object-C?
  • From: Hisaoki Nishida <email@hidden>
  • Date: Sun, 8 Jul 2001 18:26:18 -0400

I am working my way through the Learning Cocoa book, and encountered a code example that mixes C code in Object-C. All the other code so far has been Object-C syntax, but suddenly I see C code out of no where. I don't understand why the writer decided to do this. I don't see the need to use C code instead of Object-C here, unless the writer decided to just show it's possible to mix code. It's just confusing. I don't even know why standard C code would work with the compiler?
I'd appreciate any clarification regarding this matter.

Anyway, here's the example code at page 245:

//
Declare time-conversion functions

These functions provide computational services to clients of this class, converting time in seconds to hours and minutes (as required by the user interface) and back again to seconds (as stored by ToDoItem):

long ConvertTimeToSeconds(int hour, int minute, BOOL pm);
BOOL ConvertSecondsToTime(long secs, int *hour, int *minute);
//

Thanks for your help,

Hisaoki N.


  • Prev by Date: Interface Builder documentation
  • Next by Date: How to make a plugin?
  • Previous by thread: Re: Interface Builder documentation
  • Next by thread: Re: C code in Object-C?
  • Index(es):
    • Date
    • Thread