How to convert C program to Objective C?

Discussion in 'iOS Programming' started by armyguy26, Jul 2, 2010.

  1. macrumors member

    Joined:
    Apr 8, 2010
    #1
    Hi Everybody,
    How would you convert a C program to an Objective C program? Thanks.
     
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Objective-C is a superset of C. So, depending on what your code does, you may not need to do much conversion.
     
  3. thread starter macrumors member

    Joined:
    Apr 8, 2010
    #3

    What type of conversions would you need to make?
     
  4. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    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?
     
  5. macrumors 603

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #5
    Step 1: rename *.c files to *.m
    Step 2: ?
    Step 3: profit?
     
  6. thread starter macrumors member

    Joined:
    Apr 8, 2010
    #6

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

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    What kind of UI does these programs have? Command-line input or what?
     
  8. thread starter macrumors member

    Joined:
    Apr 8, 2010
    #8
    Command-line input
     
  9. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #9
    Well, that part will need to be converted.
     
  10. thread starter macrumors member

    Joined:
    Apr 8, 2010
    #10
    So how do I convert it?
     
  11. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #11
    You can't do CLI apps on the iPhone. You'd need to use UIKit and write a GUI.
     
  12. thread starter macrumors member

    Joined:
    Apr 8, 2010
    #12
    ok
     

Share This Page