PDA

View Full Version : How to convert C program to Objective C?




armyguy26
Jul 2, 2010, 10:22 PM
Hi Everybody,
How would you convert a C program to an Objective C program? Thanks.



dejo
Jul 2, 2010, 10:31 PM
Objective-C is a superset of C. So, depending on what your code does, you may not need to do much conversion.

armyguy26
Jul 2, 2010, 10:41 PM
Objective-C is a superset of C. So, depending on what your code does, you may not need to do much conversion.


What type of conversions would you need to make?

dejo
Jul 2, 2010, 11:47 PM
Wirelessly posted (Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16)

Objective-C is a superset of C. So, depending on what your code does, you may not need to do much conversion.


What type of conversions would you need to make?

What does the program do?

firewood
Jul 3, 2010, 12:08 AM
How would you convert a C program to an Objective C program? Thanks.

Step 1: rename *.c files to *.m
Step 2: ?
Step 3: profit?

armyguy26
Jul 3, 2010, 10:54 AM
Wirelessly posted (Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16)



What does the program do?


One is a blackjack one and another one is a ask the nerd program.

dejo
Jul 3, 2010, 11:06 AM
What kind of UI does these programs have? Command-line input or what?

armyguy26
Jul 3, 2010, 11:34 AM
What kind of UI does these programs have? Command-line input or what?

Command-line input

dejo
Jul 3, 2010, 11:37 AM
Command-line input
Well, that part will need to be converted.

armyguy26
Jul 3, 2010, 12:34 PM
Well, that part will need to be converted.

So how do I convert it?

kainjow
Jul 3, 2010, 01:28 PM
You can't do CLI apps on the iPhone. You'd need to use UIKit and write a GUI.

armyguy26
Jul 5, 2010, 01:19 PM
You can't do CLI apps on the iPhone. You'd need to use UIKit and write a GUI.

ok