• 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
[OT] Re: C language in obj-c
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OT] Re: C language in obj-c


  • Subject: [OT] Re: C language in obj-c
  • From: Alastair Houghton <email@hidden>
  • Date: Wed, 29 Apr 2009 12:04:35 +0100

On 29 Apr 2009, at 11:36, fawad shafi wrote:

thanks for this useful info.
is it possible?
existing code that (possibly written in C) that we can easily port over to obj-c with minimum effort.

You don't need to "port" C code to ObjC. ObjC is just C with some simple extensions. Similarly, ObjC++ is just C++ with the same simple extensions.


The only problems you might have are things like non-portable assumptions in your code (e.g. structure layouts, byte ordering if you're targeting PPC machines as well as Intel, inline assembler) or places where your code isn't properly standards compliant. Exactly how much trouble you have depends on how portable the original code was.

Just include the source files in your Xcode project, then hit Build. If you have errors at that point, you'll need to fix them. You'll also need to test quite carefully if this code is coming from another platform.

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >C language in obj-c (From: fawad shafi <email@hidden>)
 >Re: C language in obj-c (From: Alastair Houghton <email@hidden>)
 >Re: C language in obj-c (From: Alastair Houghton <email@hidden>)
 >RE: C language in obj-c (From: fawad shafi <email@hidden>)

  • Prev by Date: Re: NSRunLoop vs. NSThread sleep
  • Next by Date: It doesn't work without the NSLog()... Why?
  • Previous by thread: RE: C language in obj-c
  • Next by thread: Re: C language in obj-c
  • Index(es):
    • Date
    • Thread