02.02.2015 Views

Jean-Baptiste.Yunes@univ-paris-diderot.fr - liafa

Jean-Baptiste.Yunes@univ-paris-diderot.fr - liafa

Jean-Baptiste.Yunes@univ-paris-diderot.fr - liafa

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Les protocoles<br />

// l’implémentation nécessite la définition de la méthode du protocole<br />

// UneClasse.m<br />

#import "UneClasse.h"<br />

!<br />

@implementation UneClasse<br />

{<br />

int value;<br />

}<br />

- (id)initWithValue:(int)v {<br />

self = [super init];<br />

if (self) {<br />

NSLog(@"init");<br />

value = v;<br />

}<br />

return self;<br />

}<br />

- (int)value {<br />

return value;<br />

}<br />

+ (id)createWithValue:(int)v {<br />

return [[self alloc] initWithValue:v];<br />

}<br />

- (id)print {<br />

NSLog(@"my value is %d",self.value);<br />

return self;<br />

}<br />

@end<br />

<strong>Jean</strong>-<strong>Baptiste</strong>.<strong>Yunes@univ</strong>-<strong>paris</strong>-<strong>diderot</strong>.<strong>fr</strong> / 2014—2015 Master II<br />

50

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

Saved successfully!

Ooh no, something went wrong!