Apartados del CV

domingo, 1 de julio de 2012

Aprendiendo Objetive-C para IOS (Dia 22)


Guion del blog de curso de Objetive-C para IOS - DIA 22
-----------------------------------------------------------------------------

CREANDO UNA APLICACION COMPLETA, Y SUBIENDOLA AL APPSTORE PARTE 4:

Vamos a ver hoy como al pinchar en el boton de arriba a la derecha de nuestra vista principal, abrimos informacion sobre la aplicacion.

Para eso, creamos una nueva clase basada en UIVIewCOntroller, y la llmaremos intruccionesViewController.




Vamos al view controller de nuestra vista, y cambiamos el class identifier por instruccionesViewController

El segue ya esta creado desde el boton de arriba a la derecha, si no fuera asi, lo creamos usando la tecla de CTRL

Creamos el outlet del UIWebView



Veamos como queda el .h y el .m

//
//  instruccionesViewController.h
//  Metabolismo Basal
//
//  Created by david fraj blesa on 26/06/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface instruccionesViewController : UIViewController{
    
}

@property (weak, nonatomic) IBOutlet UIWebView *wvInstrucciones;

@end

-------------

//
//  instruccionesViewController.m
//  Metabolismo Basal
//
//  Created by david fraj blesa on 26/06/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "instruccionesViewController.h"

@implementation instruccionesViewController
@synthesize txtIntrucciones;
@synthesize wvInstrucciones;

- (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];
    //ESTO ES LO UNICO QUE TENEMOS QUE TENER EN CUENTA, YA QUE AQUI SE PONDRA EL CODIGO HTML NECESARIO
    [wvInstrucciones loadHTMLString:@"aqui el codigo en HTML" baseURL:nil];
    
    
    
}


- (void)viewDidUnload
{
    [self setTxtIntrucciones:nil];
    [self setWvInstrucciones:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end

-------------

Y con esto ya tenemos lista nuestra apliacion!!!

Mañana retoques finales!!

-------------

nota: Esto es no es curso propiamente dicho, es un diario de autoaprendizaje de objetive-c, que me sirve para afianzar conocimientos, y de paso, tener un diario de referencia, con ejemplos propios de uso del lenguaje.

-------------

No hay comentarios:

Publicar un comentario