This link has been bookmarked by 9 people . It was first bookmarked on 20 Oct 2008, by tj mapes.
-
15 Oct 09
Lee-Anne Patterson"In this tutorial I will give you a brief introduction on how to get started with your first iPhone application. To begin you will need the latest version of the iPhone SDK which you can download it from here. With the SDK you get some tools like Xcode, Interface Builder, iPhone simulator, and many more. The first application is usually called "Hello World" but I have named my first app "Hello Universe" because a revolutionary device calls for a change of name."
-
11 May 09
-
17 Jan 09
-
- An iPhone application can only have one window. We will create views which can then be added to the window.
- iPhone OS does not support memory management using the garbage collection feature that is in Mac OS Xv10.5 or later.
- An iPhone application can only have one window. We will create views which can then be added to the window.
-
It is important that we save all the images, files, databases, and views in the "Resources" folder because all the iPhone apps run in its own sand box; which means they can only access files placed under the resources folder.
- 19 more annotations...
-
-
he method applicationDidFinishLaunching method is called when the app is launched on the device or the simulator. The method is defined in "HelloUniverseAppDelegate.m" file which is found under the "Classes" folder
-
An iPhone application has only one window (MainWindow.xib) unlike a desktop application which is created with multiple windows; however, we can create multiple views which are added to the window.
-
Every nib file has atleast two files; File's Owner and First Responder which cannot be deleted.
-
reate a view controller to manage the view.
-
iew controllers play a very central role in create an iPhone application. They are responsible for managing a view, navigation and memory management. Every view is connected to a view controller.
-
he UIKit provides a class UIViewController which hides most of the default behavior.
-
The newly created class inherits from UIViewController which knows how to interact with a view.
-
Now that we have our view and the controller class, there must be some way to connect these two files and we can do it by setting the class property of the File's Owner.
-
Now we have to create variables for the controls we defined in our view. So we can connect these variables to the actual controls on the view.
-
we need a way to control the view in the nib file from code and this is done by connecting the view instance variable to the view object in the nib. The connection is made using "outlets".
-
The attribute retain while declaring the property tells the compiler to retain the object during assignment.
-
his method is declared with a special keyword called IBAction, which tells the compiler to make this method available in the Interface Builder.
-
All the variables above are marked with IBOutlet and Interface Builder will make these available to itself so proper connections can be made. We also have a method whose return type is IBAction (void); Interface Builder will also make this method available to itself so we can choose which event will call this method.
-
he method also takes a parameter called "sender" which is the object which triggered the event.
-
We first have to set the view controller to the File's Owner Proxy Object.
-
Identity Inspector
-
The easiest way to remember when to release objects is; if you create it then you own the object and hence you are responsible of releasing it.
-
If you click on Build and Go, the view will not be visible because we have not yet added it to the window.
-
The key thing to remember here is that the view message is passed to the "hvController" which returns the view and is added as sub view to the window. A valid view is returned because we created a connection from the view instance variable to the view in the nib file.
-
-
-
29 Aug 08
-
06 Aug 08
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.