From dc63e78f274cc5733250b137b1ad09ea248445ff Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 16 Mar 2009 15:12:33 +0000 Subject: That was at least interesting. --- UICaboodle/BrowserView.m | 16 ++++++++++++++++ UICaboodle/RVBook.mm | 10 ++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'UICaboodle') diff --git a/UICaboodle/BrowserView.m b/UICaboodle/BrowserView.m index 0f95a04..3a4b779 100644 --- a/UICaboodle/BrowserView.m +++ b/UICaboodle/BrowserView.m @@ -70,6 +70,22 @@ } return self; } ++ (NSArray *) _attributeKeys { + return [NSArray arrayWithObjects:@"device", nil]; +} + +- (NSArray *) attributeKeys { + return [[self class] _attributeKeys]; +} + ++ (BOOL) isKeyExcludedFromWebScript:(const char *)name { + return ![[self _attributeKeys] containsObject:[NSString stringWithUTF8String:name]] && [super isKeyExcludedFromWebScript:name]; +} + +- (NSString *) device { + return [[UIDevice currentDevice] uniqueIdentifier]; +} + + (NSString *) webScriptNameForSelector:(SEL)selector { if (selector == @selector(close)) return @"close"; diff --git a/UICaboodle/RVBook.mm b/UICaboodle/RVBook.mm index 28774ae..4b5a399 100644 --- a/UICaboodle/RVBook.mm +++ b/UICaboodle/RVBook.mm @@ -270,10 +270,16 @@ } - (void) reloadData { - for (int i(0), e([pages_ count]); i != e; ++i) { - RVPage *page([pages_ objectAtIndex:(e - i - 1)]); + size_t count([pages_ count]); + for (size_t i(0); i != count; ++i) { + RVPage *page([pages_ objectAtIndex:(count - i - 1)]); [page reloadData]; } + + if (count != 0) { + RVPage *page([pages_ lastObject]); + [self reloadButtonsForPage:page]; + } } - (CGRect) pageBounds { -- cgit v1.2.3