UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"UIAlertView"
message:@"Hi There!" delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
[alert release];
As you can see from the code above, square brackets are the order of the day in Objective-C, the iPhone programming language. For now, note that text that comes right after the word "message:". This is where you control what the alert box presents to the user.
Finally, notice the overall pattern of using objects in Objective-C: alloc, "do stuff", release. This is something that you will be using often in your iPhone programming.
No comments:
Post a Comment