简体   繁体   中英

Including C Program into OSX Application

I am working on a Mac OSX application in Xcode 4 that will read and display data from a program written by someone else in C. How can I put this code into my project? Do I have to create new Objective C files and then "rewrite" the C program into these ObjC files? Or can I simply include the C file in the project and reference it from other files? I have tried the latter and it didn't work, but I'm sure I was doing something wrong.

Thanks

You can do:

File->New File->Under "OS X" heading in Xcode, "C and C++" option has an option of adding a .h, .c, or .cpp file (all of which work with Objective-C).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM