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.

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

#import <br />

@interface TrashAppViewController : UIViewController {<br />

! IBOutlet UIImageView *imageCestino;<br />

! IBOutlet UIImageView *imageLogo;<br />

}<br />

-(IBAction)ripristina;<br />

@end<br />

Abbiamo definito gli elementi necessari: alle righe 4 e 5 due UIImageView, che conterranno il<br />

cestino (pieno o vuoto a seconda del caso) e il logo da eliminare. Alla riga 8, infine, abbiamo<br />

definito l’azione che ci <strong>per</strong>metterà di ripristinare il logo dopo la sua eliminazione.<br />

DEFINIAMO L’ASPETTO GRAFICO.<br />

Procediamo, quindi, con la creazione della struttura grafica della nostra applicazione. Salvate il<br />

file “TrashAppViewController.h” appena modificato e aprite poi<br />

“TrashAppViewController.xib”, che avvierà Interface Builder.<br />

La finestra è <strong>per</strong> ora semplice e si presenterà così:<br />

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

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

Saved successfully!

Ooh no, something went wrong!