iPhone Tutorial by BetaWar – Part 2

Posted by Matthew Cawley under iPhone, Tutorials on Monday Mar 8, 2010

Swapping between landscape and portrait views

In this tutorial we will be covering:

Creating an app that allows for iPhone rotation from side to side, as well as creating functions that take multiple arguments and writing a custom class, additionally we will be adding segments to our segmented control and making the various segments act differently based on which one is clicked.

Setting up for the rotation:

So, we have finished the first tutorial, but what now? Well, the one common thought would be to add landscape view mode into the application.

If you are wondering why someone would want to put their application into landscape view here are a few reasons:

  • Wider screen
  • Increased zoom without having to scroll horizontally
  • Easier on the eyes (because most of the information on the screen will be larger than it was in portrait mode)

To start off working on this modification (yes, we are going to be modifying the previous program) we will need to butcher it a bit. This is because we did all the previous code within the AppDelegate class, which is really only meant to delegate the initial memory needed for the application then hand control over to another class. It also cleans up after the application has finished (by releasing the class that had control). Read More

2 COMMENTS | Tags : , , , , ,

iPhone Tutorial by BetaWar – Part 1

Posted by Matthew Cawley under iPhone, Tutorials on Monday Mar 8, 2010

Introduction to xCode and Objective-C

Requirements before starting this tutorial:

You need an Intel based Mac (most of the new ones are Intel based, so if you got it with say OS X you should probably be fine here)
Internet connection

Downloading xCode:

First off, go to http://www.developer…ne/index.action and log into your Apple ID. This will allow you to see the more link required to download the iPhone SDK and xCode bundle.
Once you have logged in scroll to the bottom of the page (you should once again be at the index.action page). Select the appropriate download for your Mac and wait for it to finish (this can take a little while, it is about 2.3 GB file for the Snow Leopard download.

Installing xCode:

This is a very simple step. Click on the iPhone SDK desktop icon, then the iPhone SDK and Tools for <Snow Leopard/ Leopard> and follow the onscreen instructions.

Finding xCode, and the other Development tools on your Mac:

This step seems like it would be very simple, but it took me a little while to figure it out (never mind that I had only owned a Mac for about an hour at this point in the process…). Click on the documents icon in the system tray, then say “Open in Finder”, once the window opens click on “Macintosh HD” under “Devices”, if you followed the standard install paths and options there should be a folder here labeled “Developer”, click on that to open and then open the “Applications” folder under that to find the tools we will be using to develop iPhone applications.

For the basis of this tutorial we will be using xCode only and programmatically creating our user interface (UI), this is not to say it is the most correct way of doing things, but I just prefer having all my control objects stored in the same place instead of having everything scattered across multiple files and having to get them working together. The other option is to build your UI in Interface Builder and then only place the code for functionality needed in your Objective-C files.

For the moment just fire up xCode.

Creating a new project: Read More

ADD COMMENTS | Tags : , , , , ,
Get Adobe Flash playerPlugin by wpburn.com wordpress themes