Saturday, June 25, 2011
Hello NSCoder I                          Introducción al desarrollo para iOS                                  @nscoder_bcn...
NSCoder                     • Profesionales y entusiatas del mundo de la                          manzana                 ...
Programa (Mañana)                     • Introducción Objective C / iOS                     • Gestión de Memoria           ...
Programa (Tarde)                     • Presentación de Omnis Studio                     • Introducción a la programación c...
Referencias                     •    Material (github)                          •   https://github.com/NSCoderNightBCN/Hel...
Resultado                     •    App que nos localiza                     •    Conecta a un Web                         ...
Introduccion iOS                             Andreas @aquarioverdeSaturday, June 25, 2011
Requirimientos                     • Conocimientos Objective C / iOS                     • MacOS X                     • i...
Objective C                     •    Class / Instance                     •    Variable                          •   Prope...
Objective C                     •        Method                              - (id)loadNearbyEvents:(CLLocation *)location...
Objective C                                                                  Inheritance                                  ...
Objective C                     •    Protocol                          @protocol NCEventDelegate <NSObject>               ...
iOS                  •       Frameworks                          •   Foundation                          •   UIKit        ...
iOS - MVC                                 [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
iOS - MVC                          Model           Data                                         [NSCoderBCN event:@”Hello ...
iOS - MVC                          Model                                      View           Data                         ...
iOS - MVC                                  Logica   Controller                          Model                             ...
iOS - MVC                                  Logica   Controller                          Model                             ...
iOS - MVC                                  Logica   Controller                          Model                             ...
iOS - MVC                                  Logica   Controller                          Model                             ...
iOS - MVC                                  Logica   Controller                                                            ...
iOS - MVC                                  Logica   Controller                                                            ...
iOS - MVC                                  Logica   Controller                                                            ...
iOS - MVC                                  Logica   Controller                                                            ...
iOS - MVC                                  Logica   Controller                                                            ...
“Hello NSCoder” App                            Alfonso @setfilesl                          Andreas @aquarioverdeSaturday, J...
Pasos                     • Crear Proyecto                     • Crear DetailView & Controller                     • Crear...
XCode: Crear Proyecto                     • IDE for Objective C                     • Templates                      • Win...
DetailsViewController                     • Creación de la View de detalles(XIB) y su                          Controller ...
XCode Groups                     • Creación de grupos para organizar el                          proyecto                 ...
IB: DetailView                     • Herramienta para crear GUI                     • XIB: XML file que define nuestra view ...
Details View                     • NCEventDetailViewController.xib                     • añadir y posicionar en UIView    ...
Root View Controller                     • HelloNSCoderAppDelegate                      - (BOOL)application:(UIApplication...
NCEvent                     • Creación de la clase con los detalles del                          evento = Model           ...
NCEvent                     •       header                          •     properties & init                     •       im...
Detail View-Controller                     •    Conectar NCEventDetailViewController a XIB                          •   pr...
Load View Data                     • NCEventDetailViewController                      • cargar datos el evento al aparecer...
Crear Evento                     • HelloNSCoderAppDelegate                      • crear un evento y asignalo al Controller...
Navigation Controller                     • HelloNSCoderAppDelegate                      • crear Navigation Controller    ...
Navigation Title                     • NCEventDetailsViewController                      • asignar un titulo a la Navigati...
Gracias!                     • @nscoder_bcn                     • Alfonso: @setfilesl                     • Andreas: @aquar...
Upcoming SlideShare
Loading in …5
×

01/01 - Hello NSCoder - Introducción

981 views
904 views

Published on

Introducción al desarrollo iOS

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
981
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

01/01 - Hello NSCoder - Introducción

  1. 1. Saturday, June 25, 2011
  2. 2. Hello NSCoder I Introducción al desarrollo para iOS @nscoder_bcnSaturday, June 25, 2011
  3. 3. 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
  4. 4. 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
  5. 5. 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
  6. 6. 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
  7. 7. 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
  8. 8. Introduccion iOS Andreas @aquarioverdeSaturday, June 25, 2011
  9. 9. Requirimientos • Conocimientos Objective C / iOS • MacOS X • iOS SDK • XCode / Interface Builder [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  10. 10. Objective C • Class / Instance • Variable • Properties • Method [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  11. 11. 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
  12. 12. 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
  13. 13. 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
  14. 14. iOS • Frameworks • Foundation • UIKit • UIView / UITableView • UINavigationBar • root / push / pop [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  15. 15. iOS - MVC [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  16. 16. iOS - MVC Model Data [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  17. 17. iOS - MVC Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  18. 18. iOS - MVC Logica Controller Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  19. 19. iOS - MVC Logica Controller Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  20. 20. iOS - MVC Logica Controller Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  21. 21. iOS - MVC Logica Controller Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  22. 22. iOS - MVC Logica Controller <delegate> Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  23. 23. iOS - MVC Logica Controller <delegate> <datasource> Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  24. 24. iOS - MVC Logica Controller <delegate> <datasource> outlet Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  25. 25. iOS - MVC Logica Controller <delegate> <datasource> outlet action Model View Data UI [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011
  26. 26. 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
  27. 27. “Hello NSCoder” App Alfonso @setfilesl Andreas @aquarioverdeSaturday, June 25, 2011
  28. 28. 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
  29. 29. 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
  30. 30. 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
  31. 31. 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
  32. 32. 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
  33. 33. 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
  34. 34. 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
  35. 35. 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
  36. 36. 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
  37. 37. 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
  38. 38. 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
  39. 39. 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
  40. 40. 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
  41. 41. 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
  42. 42. Gracias! • @nscoder_bcn • Alfonso: @setfilesl • Andreas: @aquarioverde [NSCoderBCN event:@”Hello NSCoder” date:28/05/11]Saturday, June 25, 2011

×