How to use UIAlertView?

This Tutorial deals with how to use UIAlertView in your application…

Let us suppose our viewController class is myViewController and we want an alert on the press of a button

Drag a button from library to view in myViewController.xib

Now come to myViewController.h

Add the following highlighted lines of code

Now in myViewController.m

Add the implementation of “showAlert”

-(IBAction)showAlert
{
	UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Alert" message:@"Alert user" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"button1",@"button2",nil];
	[alert show];
	[alert release];
}

Also add the following delegate method

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
	NSLog(@"Pressed button %d",buttonIndex);
}

The above delegate method will get called everytime you press some button on UIAlertView and will tell the index number of the button pressed

In myViewController.xib make the connections as shown

Save and run application. Output is shown below

Now see how delegation method works. Suppose buttons are pressed in order   button1->Show Alert->button2->Show Alert->OK

then see the output on console

 

 

How to create iPhone/iPad applications and submit them to App Store

How to create iPhone/iPad applications and submit them to App Store

So today we are going to see how to create iPhone/iPad applications and then submit them to App Store. So basically we will be starting with the requirements first that we need to get us started.

Requirements for building iPhone application

 

Macintosh computer

You can build an iPhone application only on a Macintosh computer. Macintosh computers run Mac as their operating system, and are completely different from Windows. You cannot install Mac operating system on a Windows PC as it is hardware dependent. So guys if you own a Windows computer then get ready to shed some money for buying your new Mac. You will feel the difference between them from the day you start using Mac.

 

Xcode

Xcode is an integrated development environment developed by Apple. Applications for iPhone/iPad are developed using Xcode in Objective c language. You can download Xcode by registering on Apple’s developer website. Xcode is downloaded as a complete package which consists of a programming environment for writing codes, an Interface Builder for designing pages and an iPhone simulator for testing applications.

 

 

 

iOS Developer Program

Ok, this is not so good part as it involves some more expenditure after you buy your Macbook. Apple needs you to be enrolled in its developer program before you can start putting applications on app store for sale. There are two membership programs, depending on whether you are a company(iOS Developer program Enterprise – $299) or an individual(iOS Developer Program Standard – $99) you can select your membership. After you get registered you can submit your application for sale on app store.