Skip to content

Instantly share code, notes, and snippets.

@gmcerveny
Created October 28, 2010 17:26
Show Gist options
  • Save gmcerveny/651855 to your computer and use it in GitHub Desktop.
Save gmcerveny/651855 to your computer and use it in GitHub Desktop.
@interface PragBook : NSObject {
NSString *title;
NSString *author;
NSMutableArray *chapters;
}
@interface Chapter : NSObject {
NSString *chapterTitle;
NSNumber *pageCount;
}
-----
-(void)createReport {
NSLog(@"There are %@ chapters", [self valueForKeyPath:@"[email protected]"]);
NSLog(@"The titles are %@", [self.book.chapters valueForKey:@"chapterTitle"]);
NSLog(@"The longest chapter is %@ pages long", [self valueForKeyPath:@"[email protected]"]);
NSLog(@"The average chapter length is %@", [self valueForKeyPath:@"[email protected]"]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment