Showing posts with label sdk. Show all posts
Showing posts with label sdk. Show all posts

Thursday, January 13, 2011

[Basic]Scale for the iPhone Development

[Source]Tap Recognizer



This source is for the tap recognization in the iPhone.

When you tap the screen, the "Oh! iPhone mad" mark appear and soon disappear at the tap point.

Tuesday, January 11, 2011

[Basic]NSURL link (to Safari)

[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://www.google.com"]];

Monday, January 10, 2011

[Basic]AlertView

- (void)viewDidLoad {

    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title"
    message:@"Message\nMessage"
    delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", @"Cancel", nil];

    [alertView show];
    [alertView release];
}

- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 1) { // "Cancel" Button, close the alertView;
          // Do something
    } else { // buttonIndex == 0 // "OK" Button;
         // Do something
    }
 }