One Quickie


Displaying a UIAlert (UIAlert->General)
    UIAlertView *alert =
        [[UIAlertView alloc] initWithTitle: @"Some Title"
                             message: @"You look very nice today."
                             delegate: self
                             cancelButtonTitle: @"OK"
                             otherButtonTitles: nil];
    [alert show];
    [alert release];
If you want to know what got tapped, use a delegate method. The cancel button is index zero.
- (void) alertView: (UIAlertView *) alertView
    clickedButtonAtIndex: (NSInteger) buttonIndex {
    NSLog(@"foobage! %d", buttonIndex);
} // clickedButtonAtIndex



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com