Exploring the ‘ iTools ’ A start to iPhone Application Development
Apple Developer Suite: Apple Developer Suite includes 3 applications: Xcode Interface Builder iPhone Simulator These three provide all the iTools needed to design, develop and test the iPhone applications.
Exploring the „XCODE‟ XCODE is the Integrated Development Environment that let us create and manage iPhone applications. Getting Started- Create a new project, File -> New -> Project or (Shift + Command + N) Select a Single View Template from any of the options (as shown in Screenshot)
Make sure Application item under „iOS‟ is selected in the left panel, then Click Next. Now, We need to choose a Product and Organisation name for the project. Make sure „iPhone‟ is selected in „Device‟ option, then Click Next. Then choose a path to save the project on the hard drive.
Creating a First Program : A set of groups and files are created automatically when we proceed to the next page, which includes headers, images, controllers , etc. The MessAppDelegate.m page includes all the default methods which are used by iPhone default functionality, like terminating an app, loading an app, etc. The MainStoryboard.storyboard page represents the view page for iPhone applications, which is displayed by the help of content in MessViewController.m
Find and select MessViewController.m that includes functions responsible for displaying the Application content.
The screenshot shows how storyboard page will look like. The main function that is first loaded when an application is started is - (void) viewDidLoad
The following code needs to be written in the - (void)viewDidLoad function.We need to enter the following lines of code to display “Hello World” on an iPhoneScreen.UILabel *myMessage; //Defiines a variablemyMessage=[[UILabel alloc] //allocates memory and sets position on screen initWithFrame:CGRectMake(10.0,100.0,300.0,50.0)]; myMessage.text=@" Hello World !"; // Any Text myMessage.backgroundColor=[UIColor redColor]; // Sets the background color [self.view addSubview:myMessage]; //Add the variable myMessage to the view
Using iPhone Simulator After we have completed with the code part. We need to run the app and test. For that, we either need an iOS device or iPhone Simulator. iPhone Simulator is great deal to test the app because we don‟t need to install the modified app again and again on the physical device, which is the case if we test with iOS device. Using iPhone Simulator, displays the app exactly as it should display it on an actual iPhone.
The application is shown running in the iPhone Simulator in the screenshot
Netgains America has been serving selflessly from over a decade, to clients all over the world, with its gamut ofservices ranging from Web Design, Development to iPad and iPhone Applications. Just visit our website www.netgainsamerica.com for an overview of our services and feel free to contact us any time.