Slide 11
Slide 11 text
Objective-C 1.0
‘07 ‘08 ‘09 ‘10 ‘11 ‘12 ‘13 ‘14 ‘15 ‘16 ‘17
@implementation MyDasource
- (id) init {
self = [super init];
if (self) {
datasource = [[self buildDatasource] retain];
}
return self;
}
-(NSDictionary *) buildDatasource {
NSArray *objects = [NSArray arrayWithObjects:@"Hello World!", nil];
NSArray *keys = [NSArray arrayWithObjects:@"message", nil];
NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:objects
forKeys:keys];
NSString * currentKey;
for(int i = 0; i< [keys count]; i++) {
currentKey = [keys objectAtIndex:i];
NSLog(@"Value = %@", [dictionary valueForKey:currentKey]);
}
return dictionary;
}
@end
Xcode 3.0
October 26