20.04.2013 Views

Tutorial pratici per iPhone SDK v1.6 - Get a Free Blog

Tutorial pratici per iPhone SDK v1.6 - Get a Free Blog

Tutorial pratici per iPhone SDK v1.6 - Get a Free Blog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Ora selezionate il File’s Owner. Dobbiamo collegare i due componenti che abbiamo definito<br />

poco fa. Colleghiamo l’azione “cambiaVista” con il bottone, selezionando “Touch Up Inside”<br />

quando appare il menù di scelta dell’azione. Collegate, infine, l’elemento “vistaDueController”<br />

con l’UIViewController che abbiamo inserito poco prima. Se avete eseguito tutto correttamente<br />

avrete un pannello che si presenta così:<br />

Possiamo salvare e chiudere questa vista.<br />

DEFINIAMO LA “VISTADUE”<br />

Dobbiamo ora definire la seconda vista. Apriamo <strong>per</strong> prima cosa il file “VistaDue.h” e definite<br />

semplicemente questa azione (riga 7):<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

#import <br />

@interface VistaDue : UIViewController {<br />

}<br />

-(IBAction)tornaIndietro;<br />

@end<br />

Salvate il file e apriamo “VistaDue.xib”. Anche in questo caso inseriamo solamente un bottone<br />

nella vista, che ci <strong>per</strong>metterà di tornare alla prima vista:<br />

<strong>Tutorial</strong> <strong>pratici</strong> <strong>per</strong> <strong>iPhone</strong> <strong>SDK</strong>! 74

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!