01/01 - Hello NSCoder - Introducción
Upcoming SlideShare
Loading in...5
×
 

01/01 - Hello NSCoder - Introducción

on

  • 1,071 views

Introducción al desarrollo iOS

Introducción al desarrollo iOS

Statistics

Views

Total Views
1,071
Views on SlideShare
1,071
Embed Views
0

Actions

Likes
0
Downloads
16
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    01/01 - Hello NSCoder - Introducción 01/01 - Hello NSCoder - Introducción Presentation Transcript

    • Saturday, June 25, 2011
    • Hello NSCoder I Introducción al desarrollo para iOS @nscoder_bcnSaturday, June 25, 2011
    • NSCoder • Profesionales y entusiatas del mundo de la manzana • NSCoder Night • Cada jueves 19:00 - Frankfurt de Pelayo • Twitter: @nscoder_bcn • http://groups.google.com/group/ nscoder_bcn • http://nscoder-bcn.tumblr.com/ [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Programa (Mañana) • Introducción Objective C / iOS • Gestión de Memoria • Debugging and Memory Leaks • “Hello NSCoder” App • Web Service “What’s up, NSCoder” • Testing [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Programa (Tarde) • Presentación de Omnis Studio • Introducción a la programación con Omnis Studio • Programación de una aplicación cliente Omnis con XCode para iPhone/iPad [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Referencias • Material (github) • https://github.com/NSCoderNightBCN/Hello-NSCoder • Apple Developer • http://developer.apple.com/ • NSCodeCenter • http://www.nscodecenter.com/ • 85% Cocoa • http://ochentaycincoporcientococoa.tumblr.com/ [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Resultado • App que nos localiza • Conecta a un Web Service • Devuelva eventos a nuestros alrededores • Table View • Detail View [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Introduccion iOS Andreas @aquarioverdeSaturday, June 25, 2011
    • Requirimientos • Conocimientos Objective C / iOS • MacOS X • iOS SDK • XCode / Interface Builder [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Objective C • Class / Instance • Variable • Properties • Method [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Objective C • Method - (id)loadNearbyEvents:(CLLocation *)location ofType:(NString *)type; + (id)eventFromPList:(NSString *)listPath; • Message • receiver / selector / arguments NCEvent *event = [eventLoader loadNearbyEvents:location ofType:type]; [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Objective C Inheritance .h #import <UIKit/UIKit.h> @interface NCEvent : NSObject { NSString *name; } - (id)initWithName:(NSString *)name; @end #import “NCEvent.h” .m @implementation NCEvent - (id)initWithName:(NSString *)name { ... } @end [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Objective C • Protocol @protocol NCEventDelegate <NSObject> .h @required - (void)didFinishUpdatingData; @end @interface NCController : NSObject <NCEventDelegate> { .h } @end [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS • Frameworks • Foundation • UIKit • UIView / UITableView • UINavigationBar • root / push / pop [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC Model Data [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC Logica Controller Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC Logica Controller Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC Logica Controller Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC Logica Controller Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC Logica Controller <delegate> Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC Logica Controller <delegate> <datasource> Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC Logica Controller <delegate> <datasource> outlet Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC Logica Controller <delegate> <datasource> outlet action Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • iOS - MVC Logica Controller <delegate> <datasource> outlet action KVO Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • “Hello NSCoder” App Alfonso @setfilesl Andreas @aquarioverdeSaturday, June 25, 2011
    • Pasos • Crear Proyecto • Crear DetailView & Controller • Crear NCEvent objeto • Add NavigationController • Crear TableView • Push/Pop DetailView [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • XCode: Crear Proyecto • IDE for Objective C • Templates • Window-based Application • com.nscoderbcn.HelloNSCoder • Include Unit Tests [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • DetailsViewController • Creación de la View de detalles(XIB) y su Controller • File -> New -> New File • UIViewController subclass • With XIB • Save As: NCDetailsViewController [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • XCode Groups • Creación de grupos para organizar el proyecto • File -> New -> New Group • UI • XIB • Model [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • IB: DetailView • Herramienta para crear GUI • XIB: XML file que define nuestra view • NIB: compilado del XIB • IBOutlet / IBAction • conectar el Controller con los elementos de la View [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Details View • NCEventDetailViewController.xib • añadir y posicionar en UIView • UIImageView • Image: NSCoder_Icon.png • 3 UILabel • UITextView [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Root View Controller • HelloNSCoderAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: .m (NSDictionary *)launchOptions { NCEventDetailViewController *detailViewController = [[NCEventDetailViewController alloc] init]; self.window.rootViewController = detailViewController; [detailViewController release]; [self.window makeKeyAndVisible]; return YES; } [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • NCEvent • Creación de la clase con los detalles del evento = Model • File -> New -> New File • Objective C class • Subclass of NSObject • Save As: NCEvent [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • NCEvent • header • properties & init • implemenation • synthesize, init, dealloc @interface NCEvent : NSObject { .h } @property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *shortDescription; @property (nonatomic, retain) NSDate *startDate; @property (nonatomic, copy) NSString *location; @property (nonatomic, copy) NSString *fullDescription; - (id)initWithName:(NSString *)eName startDate:(NSDate *)eStartDate location:(NSString *)eLocation; @end [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Detail View-Controller • Conectar NCEventDetailViewController a XIB • property event • property outlets para los elementos del XIB • synthesize & dealloc!!! • Conectar a elementos en XIB @property (nonatomic, retain) NCEvent *event; .h @property (nonatomic, retain) IBOutlet UILabel *shortDescriptionLabel; @property (nonatomic, retain) IBOutlet UILabel *startDateLabel; @property (nonatomic, retain) IBOutlet UILabel *locationLabel; @property (nonatomic, retain) IBOutlet UITextView *descriptionView; [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Load View Data • NCEventDetailViewController • cargar datos el evento al aparecer - (void)viewWillAppear:(BOOL)animated { [self.navigationItem setTitle:event.name]; self.shortDescriptionLabel.text = event.shortDescription; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"yyyy-mm-dd"]; self.startDateLabel.text = [formatter stringFromDate:event.startDate]; self.locationLabel.text = event.location; self.fullDescriptionTextView.text = event.fullDescription; } [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Crear Evento • HelloNSCoderAppDelegate • crear un evento y asignalo al Controller - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: .m (NSDictionary *)launchOptions { NCEvent *event = [[NCEvent alloc] initWithName:@"Hello NSCoder" startDate:[NSDate date] location:@"CINC Barcelona"]; event.shortDescription = ... NCEventDetailViewController *detailViewController = [[NCEventDetailViewController alloc] init]; detailViewController.event = event; [event release]; ... } [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Navigation Controller • HelloNSCoderAppDelegate • crear Navigation Controller • set Detail Controller como root - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: .m (NSDictionary *)launchOptions { ... NCEventDetailViewController *detailViewController = [[NCEventDetailViewController alloc] init]; detailViewController.event = event; [event release]; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController: detailViewController]; ... } [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Navigation Title • NCEventDetailsViewController • asignar un titulo a la Navigation Bar - (void)viewWillAppear:(BOOL)animated .m { self.navigationItem.title = event.name; ... [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
    • Gracias! • @nscoder_bcn • Alfonso: @setfilesl • Andreas: @aquarioverde [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011