alexanderferreira/XCode — Issue #1: viewController
Author: alexanderferreira
Created: 2011-12-15 16:32:58+00:00
State: open

.h
--------------------------------------------------------------------------------------------------------------

#import

@interface WebViewNet : UIViewController {
UIWebView *webview;
NSString *usuarioID;
}
@property(nonatomic,strong) IBOutlet NSString *usuarioID;
@property(nonatomic,strong) IBOutlet UILabel *Usuario;
@property(nonatomic, retain) IBOutlet UIWebView *webView;
@property(nonatomic) BOOL mediaPlaybackRequiresUserAction,allowsInlineMediaPlayback;

@end

.m
----------------------------------------------------------------------------------------------------------

#import "WebViewNet.h"

@implementation WebViewNet

@synthesize Usuario,webView,mediaPlaybackRequiresUserAction,allowsInlineMediaPlayback,usuarioID;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
}
*/

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];

NSString *urlString = [NSString stringWithFormat: @"http://www.leadernet.com.br/%@",usuarioID];
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *requestURL = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestURL];
webView.allowsInlineMediaPlayback = YES;
webView.mediaPlaybackRequiresUserAction = NO;

}