Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Carbon iPhone Programming



On May 31, 2008, at 7:58 PM, David Dunham wrote:
Jim

The only difficulties that we faced with this approach was how to call Cocoa functions from C to trigger OpenGL context switching, since
changing all the .c extensions to .m was not an option.

My most recent cross-platform framework (not for iPhone) uses a small number of .mm files (Objective-C++), to help bridge the Cocoa side and the platform-agnostic C++. It's surprisingly easy to mix Objective-C and C++ in the same file.


The only problem is in header files -- while a .mm file can include something that uses both dialects, a .cpp file can't.

If you wish to have Xcode compile all your sources as Objective-C++, you can do that without renaming them. Search for the "Compile Source As" setting, and you can change the default "According to File Type" to C, Objective-C, C++, or Objective-C++.


Cheers,

--Dave

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Carbon iPhone Programming (From: David Dunham <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.