Trabalhando com Links -Cocoa Touch Tutorial

Neste screencast demonstro como fazer links para o navegador safari abrir um site pré determinado, além de discar para um numero de telefone, escrever uma sms, um email e abrir o player do youtube com um link

 

Classes:

“BotoesViewController.h”

#import <UIKit/UIKit.h>

#import <Foundation/Foundation.h>

 

@interface BotoesViewController : UIViewController {

 

}

- (IBAction)Email;

- (IBAction)Google;

- (IBAction)SMS;

- (IBAction)Telefone;

- (IBAction)YouTube;

@end

“BotoesViewController.m”

#import “BotoesViewController.h”

 

@implementation BotoesViewController

- (IBAction)Email {

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://contato.applemaniacos@gmail.com"]];

}

- (IBAction)Google {

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

}

- (IBAction)SMS {

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:1325465"]];

 

}

 

- (IBAction)Telefone {

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://545245"]];

 

}

 

- (IBAction)YouTube {

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.youtube.com/watch?v=hTQOf3loYMk"]];

 

 

}

@end