Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/08/2011, 17:14
Avatar de dual3nigma
dual3nigma
Colaborador
 
Fecha de Ingreso: febrero-2010
Ubicación: Ciudad de México
Mensajes: 295
Antigüedad: 14 años, 2 meses
Puntos: 122
Respuesta: No me va el código

Hola ramondevesa

Si sabes ingles te recomiendo el siguiente sitio http://mobile.tutsplus.com

Lamentablemente la "guía" de "maestros del web" no te enseña nada (sin ofender), tu código no funciona por que no te explicaron que tanto @synthesize como @property son características especiales de objective-c que te permiten declarar e implementar automáticamente "getters" y "setters" por lo tanto deben de ir dentro @inferface ... @end (@property) e @implementation ... @end (@synthesize), igual tu función cambiarEtiqueta debe de quedar dentro @implementation ... @end y fijate que tienes repetida la función dealloc

Te dejo mas o menos como se debería de ver, ya que cuando copio y pego el editor hace una cosa horrible de agregar *

Saludos y suerte ;)

Código Objective-C:
Ver original
  1. //
  2. // *miAppViewController.m
  3. // *miApp
  4. //
  5. //
  6. *
  7. #import "miAppViewController.h"
  8. **
  9. @implementation miAppViewController
  10.  
  11. @synthesize miEtiqueta;
  12.  
  13. -(IBAction)cambiarEtiqueta{
  14.     miEtiqueta.text = @"Bazzinga!";
  15. }
  16.  
  17. /*
  18. // The designated initializer. Override to perform setup that is required before the view is loaded.
  19. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
  20. * * if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
  21. * * * * // Custom initialization
  22. * * }
  23. * * return self;
  24. }
  25. */
  26. *
  27. /*
  28. // Implement loadView to create a view hierarchy programmatically, without using a nib.
  29. - (void)loadView {
  30. }
  31. */
  32. *
  33. *
  34. /*
  35. // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
  36. - (void)viewDidLoad {
  37. * * [super viewDidLoad];
  38. }
  39. */
  40. *
  41. *
  42. /*
  43. // Override to allow orientations other than the default portrait orientation.
  44. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  45. * * // Return YES for supported orientations
  46. * * return (interfaceOrientation == UIInterfaceOrientationPortrait);
  47. }
  48. */
  49. *
  50. - (void)didReceiveMemoryWarning {
  51. * * // Releases the view if it doesn't have a superview.
  52. * * [super didReceiveMemoryWarning];
  53. * *
  54. * * // Release any cached data, images, etc that aren't in use.
  55. }
  56. *
  57. - (void)viewDidUnload {
  58. * * // Release any retained subviews of the main view.
  59. * * // e.g. self.myOutlet = nil;
  60. }
  61. *
  62. *
  63. - (void)dealloc {
  64.     [miEtiqueta release];
  65. * * [super dealloc];
  66. }
  67. *
  68. @end