Problems with Xcode and SDK

Discussion in 'iOS Programming' started by jacksongan, Aug 31, 2009.

  1. jacksongan macrumors member

    Joined:
    Aug 31, 2009
    #1
    I bought my first Mac last week, with the intention of learning Xcode and SDK, and eventually start writing applications for iphone. For the past 1 week, i have faced a lot of problems. First, i couldnt download the iphone SDK 3.0, the website keep asking me to log in (i have signed up the $99 developer program), only after trying for many times then i managed to download the SDK file (it was quite tricky though, you cant jus click on the link, you have to right click then open the link in new tab, very weird..).

    Then i thought the toughest part is finally over, yet when i clicked on the SDK, my Mac showed error message, "cannot mount, file not recognized". I tried to contact Apple and the answer given was their link was fine and they suggest i download again (btw, I am from Singapore), so i tried for the 4th time, ie, to download the SDK again. A screenshot of the error message has been emailed to Apple just now and i hope they can solve my problem, while i try to download for the 5th time, sigh...

    For the Xcode, i created some basic programs, very basic ones, yet when i build and run the program, only the Windows showed up, a "clean" window, without all the buttons / labels / hello world that i have created, what the hell is going on?

    I am quite upset with all these, and it seems like Windows is a better choice for me, at least i can achieve something, and not totally lost in this wild jungle of Xcode and SDK?

    Anyone care to advise what could be the source of the problems?

    Thanks.
     
  2. ritsard macrumors regular

    ritsard

    Joined:
    Jun 18, 2009
    Location:
    SF Bay Area, CA
    #2
    Have you done cocoa programming before? Did you setup your nibs and connected them properly?
     
  3. jacksongan thread starter macrumors member

    Joined:
    Aug 31, 2009
    #3
    nope i m new to Mac, hv been using PC for whole life. Care to share more info? I thought that since i followed all the instruction given in the book then i should get the desired results. Jus curious why i couldnt see any buttons/labels that i hv created on the running application.
     
  4. PhoneyDeveloper macrumors 68040

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    Um, you didn't do something right, would be my guess.

    What book?

    How did you create the buttons and labels? In IB? The usual problem is that some connection in IB isn't made that needs to be made.
     
  5. jacksongan thread starter macrumors member

    Joined:
    Aug 31, 2009
    #5
    It's a ebook "Become an Xcoder" from this website http://www.cocoalab.com/,

    well i opened the library then drag the buttons and labels onto the Window. I agree with u, it seems like some connection in IB isnt made, but i noticed the changes in Xcode, ie. the codes that added to the .h & .m due to the action i performed in IB, something is wrong. Maybe u can take a look at the sample GUI provided in that book. It's a simple 2 buttons and 1 label GUI.
     
  6. PhoneyDeveloper macrumors 68040

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    OK, I looked at the ebook. I assume that you're talking about the gui app in chap 8. There are some issues with the way they do things but it should work.

    You see the buttons and label in IB but when the app runs you see only an empty window? What happens if you choose Simulate Interface in IB? The window should appear with its contents but the connections shouldn't really work. IOW, the buttons and label should be there and you can click the buttons but they don't do anything else.

    Actually there's not that much that could go wrong that would prevent the subviews from being visible on that window. Maybe you could move the label to the very top left corner of the window in IB and see if it is visible when you run the app.
     
  7. jacksongan thread starter macrumors member

    Joined:
    Aug 31, 2009
    #7
    ok i will give it a try later. It has been problematic but i wil try to digest everything along the way cos apple apps rocks, thanks mate.
     
  8. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #8
    If all you are seeing is a clean, white window, I suspect the view you are adding the buttons and such to is not the view that is being displayed. What kind of project template did you use to create your project. Which view did you add the GUI objects to? Some more details about the structure and such of your project will help us to troubleshoot.
     
  9. jacksongan thread starter macrumors member

    Joined:
    Aug 31, 2009
    #9
    hi dejo,

    Well, these are wat i did

    1. create new project in xcode (cocoa application).
    2. double clicked the main.xib to bring up the IB, then,
    3. drag 2 buttons and 1 label from library to the "window" (the clean, white one).
    4. create a object by dragging object into the main.xib, then assigned actions and outlets to it, then.
    5. ctrl drag those buttons to the object and from object to the label.
    6. add setintvalue to .m files, then build and run.
    7. And.... a clean and white window popped up. haha.

    Please advise.

    Thanks.
     
  10. PhoneyDeveloper macrumors 68040

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #10
    If you did steps 1,2,3 and then build and run then you should see the buttons and label.

    When you say you dragged the controls to the 'clean white' window that might be the problem. The correct window has as its title 'Window' not MainMenu.xib. When I try this the MainMenu.xib window is grey, not white. The white window has other stuff in it like File's Owner, First Responder etc.
     
  11. jacksongan thread starter macrumors member

    Joined:
    Aug 31, 2009
    #11
    hi there, share wif u some good news, i managed to solved all the problems mentioned above. And i m now using the SDK 3.0 to create apps, reali happy about that.

    thank u for ur advice,, cheers!
     
  12. PhoneyDeveloper macrumors 68040

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #12
    Imagine my delight. So what was the solution?
     
  13. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #13
    And you're sure you want to be creating a Cocoa application when you are coding for iPhone? Don't you want to use one of the iPhone OS Application templates instead?
     
  14. jacksongan thread starter macrumors member

    Joined:
    Aug 31, 2009
    #14
    no, creating cocoa application is jus to try out since i m new to Mac. In fact i hv started using Iphone OS template in the SDK 3.0, can't wait to upload my apps!
     
  15. jacksongan thread starter macrumors member

    Joined:
    Aug 31, 2009
    #15
    the solution for the buttons & label to show up is as simple as "saving" the file in the IB, which i did not do, whereas for installation of SDK3.0, i need to uninstall my existing Xcode first, then everything will be fine. Apple never mentioned about this, even their technician also not aware, which was unprofessional in my opinion.
     
  16. PhoneyDeveloper macrumors 68040

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #16
    Just some friendly advice.

    The iPhone OS and iPhone SDK and iPhone development tools are in a state of rapid flux. Things change rapidly, daily, and without notice. Often enough they go in directions that you'd rather they didn't. Everything has bugs. New releases fix some old bugs and introduce some new ones. The people at Apple either don't know what's going on or they won't tell you what's going on. The lawyers seem to be in charge.

    If you can't live with this then you will be very unhappy. As opposed to the rest of us who are just mildly unhappy.
     
  17. jacksongan thread starter macrumors member

    Joined:
    Aug 31, 2009
    #17
    it's fine with me, my only concern is to create some useful apps and make some money along the way, :)
     

Share This Page