Creating a Project
- Download XCode along with IPhone's SDK from Apple's website.
- Once installed and opened, click File -> New Project
- Pick the Application template under iPhone OS category
- Select 'View-based application' and click Choose
- At this point, it will ask for the Project name -> Save
Once, the Project file is created, it will display all the code files and resources associated with the project. There isn't much now but it is a fully functional application that of course, does nothing. Click on the 'Build & Go' to see the iPhone Simulator open up the application.
XIB files are where the user interface behind the Mac and iPhone application are stored. Double clicking on the MainWindow.xib file will open up the Interface Builder app. This lets the user create the user interfaces. Once the IB loads, it displays a mock iPhone view. The users can select an array of objects (buttons, text boxes and the whole lot of it) from the Tools Library. If the Tools library is not automatically loaded, click Tools -> Libary or (command - shift+command+L)
Interface design
- On the Tools Library, make sure Object is selected. And then, in the search box start typing 'text'.
- Select TextView and drag it on the mock iPhone area and place it. Double clicking, lets you change the text. Then type the infamous - "Hello World!!"
- Close the Interface Builder and select 'Build & Go' on XCode window.
That's the simple 'Hello World!" app on iPhone.
I plan to explore more on iPhone and Objective C and plan to have series of posts. Looking forward to learning more!