Skip navigation
This discussion is archived

New to Xcode

3047 Views 7 Replies Latest reply: Sep 7, 2009 4:13 AM by Tron55555 RSS
Davide Vitelaru Calculating status...
Currently Being Moderated
Sep 1, 2009 11:32 AM
Hello guys,
i have just received my Mac, and i already want to know how to build software for it because i am a very passionate programmer. The fact is that i downloaded and installed Xcode and looked for tutorials everywhere, but i can not find a tutorial that fits my Xcode version (3.1 i think), or that could help me a bit. I can use the Interface builder very well by now, the fact is that, comparing to Microsoft Visual Studio, i do not know how to handle "press button" events or similar stuff. I mean, i can not code a thing in Xcode, i can only build the interface. From what i learned by now i guess i will have to learn objective-C, this wouldn't be a problem if i could find out how to "connect" the buttons to the code just like i used to in Visual Studio.
Can anyone give me some small tips about using Xcode? I can learn the programming language myself later. I promise i will make a tutorial on this later on (as i always do).

Thank You!

P.S. Sorry for my english, i am not a native speaker.
PowerBook G4, Mac OS X (10.5.5)
  • xnav Level 5 Level 5 (6,625 points)
    Currently Being Moderated
    Sep 1, 2009 11:48 AM (in response to Davide Vitelaru)
    I found [this|http://web.mac.com/elvis.dowson/Tutorial/Xcode3.0_Tutorials/Entries/2008/3/7_Handling_buttonevents.html] and [this|http://technorati.com/videos/youtube.com%2Fwatch%3Fv%3Dy2MSvZT3zWU] useful to get started.
    Mac Pro 2x3GHz Dual, Mac OS X (10.6), BlueTooth Kybd/Mouse, BootCamp WinXP, LinkSys WRT54G, iPhone, TV
  • Tron55555 Level 2 Level 2 (180 points)
    Currently Being Moderated
    Sep 6, 2009 1:41 AM (in response to Davide Vitelaru)
    I know you've marked this thread as answered, but I read your post and I could really relate to your questions, so I figured I'd throw a little bit out there.

    i have just received my Mac, and i already want to know how to build software for it because i am a very passionate programmer. The fact is that i downloaded and installed Xcode and looked for tutorials everywhere, but i can not find a tutorial that fits my Xcode version (3.1 i think), or that could help me a bit.


    We have a lot in common in this regard. I'm by no means an expert here, but I've recently had to learn to take programming from Windows (Visual Studio) to the Mac, and I've run into some of the same problems. I bought a book by Wrox called Mac OS X Programming, and while the versions of Xcode and Interface Builder used in it are an older version, I still have found the book very helpful. I've shopped around for other similar books and, unfortunately, most seem to be a bit behind as far as the version of Xcode used.

    I can use the Interface builder very well by now, the fact is that, comparing to Microsoft Visual Studio, i do not know how to handle "press button" events or similar stuff. I mean, i can not code a thing in Xcode, i can only build the interface.


    Yep, the first time I opened Xcode I was an absolute mess (still am) -- I had no idea what to do with it. So, what I ended up doing was downloading some trials of other programming apps on the Mac. First I messed around with X-develop, which is basically a Mac version of Visual Studio. It works identically (it's brings .net to the Mac), and I was buildings apps in no time. Then I went to RealBasic, which was also a good program. However, I don't recommend them for two reasons. One, they are very expensive if you want the non-trial version. Two, I think it's much more beneficial to learn to program the "real" way (so to speak) on the Mac, meaning with Xcode and Interface Builder -- it takes time, but from my experience with it (which actually isn't very much), it just seems like a better way to do things (plus I think it's how Mac intends for you to develop). However, downloading the trials of apps like RealBasic and X-Develop and messing around with them a little can help you transition from Windows to Mac programming and make the whole getting used to Xcode/Interface Builder part a little easier, so that might be worth looking into.

    From what i learned by now i guess i will have to learn objective-C, this wouldn't be a problem if i could find out how to "connect" the buttons to the code just like i used to in Visual Studio.


    Yes, Mac programming is mostly done in C and Objective-C from what I understand. Objective-C is a superset of C, meaning it has everything C has and more (the "more" in this case is object-oriented support mainly I think). C++ is also a superset of C, just a different one, and if you look into the different Xcode projects, you'll find that Mac does support C++, but I think Objective-C is how they really want you to develop (the reason for this is that, although Objective-C was originally used on the NeXTSTEP OS, it has been heavily integrated into Mac OS X development, whereas C++ has not). Again, this is all from my understanding on the subject, but like I said, I'm a novice Mac developer myself, so take anything I say with a grain of salt. By the way, you can also develop Java on the Mac apparently, but I don't know anything about that.

    Here's my recommendation. You're talking about wanting to know how to connect the Xcode component of you program (the code itself) with the Interface Builder component (the GUI). This isn't something I'm very versed in myself, but, yes, from what I understand, you will need to learn Objective-C. I highly recommend buying a book on it. I find that referencing them in combination with the help you'll find here is the best way to learn, but everyone learns differently, so do what works for you. As I was saying, my recommendation is to start off with command-line applications (you probably knew them as console applications back on Windows). With these, you don't need to worry about Interface Builder at all, as everything is done in Xcode (including the execution). With this type of app you can code completely in C and hone in on not just your C skills, but on your Xcode skills as well, then, when the time comes, you can transfer that knowledge to Objective-C and what not. Right now, I think you'll find that if you try to go about programming apps with GUIs and what not without a basic understanding of C, you are probably going to have some trouble -- but I could be wrong. Anyways, if you want to try out the command-line app, open Xcode and go to File > New Project, then under the Command Line Utility section (not the Application section), select Standard Tool -- this is the project type that uses C. Command-Line apps aren't as much fun, but you mentioned that you "can't code a thing in Xcode," and I promise you, after learning the basics of coding with C in command-apps, that will all change.

    Sorry for the long post, but I hope you found something helpful in it. If you have any more questions, like I said I'm no expert, but I'll be glad to answer them if I can. Best of luck with your programming endeavors!

    P.S. -- Your English is great, I didn't notice a thing.
    MacBook, Mac OS X (10.5.8)
  • Tron55555 Level 2 Level 2 (180 points)
    Currently Being Moderated
    Sep 6, 2009 11:30 PM (in response to Davide Vitelaru)
    Thank you very much, that was a useful post. I did not know that .NET could run under mac and now i am searching for X-Develop (**, i can not find it anywhere for OSX), also i found some very very good documentation from Apple for XCode, but it is a bit confusing cause they are using the same name for a lot of stuff (the application in the tutorial is a currency converter, and they are using "converter" to name a lot of stuff and i lost my way there), but i learned to use outlets and actions, too bad the application could not be compiled because of errors ("cannot assign variables of this type" or something like that).


    So, i have a few more questions: Can i use C# to program under X-Develop? This is all i know by now, and i am only planning to do some tiny, simple but useful applications for the Mac that i previously made on Windows (like a password manager, i really need one, text-files are not that safe) so i do not think i need to know more than that for now.


    Good, I'm glad you found it helpful. X-develop isn't easy to find -- I should have given you a link before. They seem to be phasing out X-develop and phasing in this CodeGuide program (both by Omnicore), which is very similar to X-develop, except as far as I can tell it only uses Java. They don't even list X-develop under their Tools section of their website any more, just CodeGuide, but you can still find it through Google. To make things easier for you though, just go to this site: http://www.omnicore.com/en/xdevelop.htm and click on the word "Try..." at the bottom. Once you do that, a new page will come up where you'll type in your name and e-mail address and select the "X-develop Professional 2.0 for Mac OS X" option from the drop down list (it's set to "for Windows" by default). Download the trial and get to work. The only problem is that, since it's a trial version, I'm not sure if it actually lets you build your apps (it might, but I won't swear to it), and unfortunately, the full version isn't cheap, but give it a try and see how it goes. And yes, X-develop lets you program in C#, Visual Basic, J#, and Java.

    As far as your error goes with Xcode, I'm afraid I don't know enough to help you out with that, and I wouldn't be doing you any favors if I tried, but hopefully someone else around here can pick up on that. If not, maybe consider starting a thread about that particular question. Anyways, I'm glad you found some good documentation, and thanks for posting that link.
    MacBook, Mac OS X (10.5.8)
  • Tron55555 Level 2 Level 2 (180 points)
    Currently Being Moderated
    Sep 7, 2009 4:13 AM (in response to Davide Vitelaru)
    Yeah I think that's a good choice. Like I said in my first post, I think Xcode/Interface Builder is how you are intended to develop on the Mac, so I think it's a good choice to stick with that and try to learn it.

    I don't really do chat, but I'll take your e-mails down. Feel free to e-mail me (I've been on discussion boards where it's considered bad form to post your e-mail address, so I won't post mine here, but if you want it then you can find it in my profile, and like I said, feel free to e-mail me). Take note, however, my inbox is a mess, so if you don't get a response try sending again (and again, and again, and again... hehe).
    MacBook, Mac OS X (10.5.8)

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.