]> git.saurik.com Git - cydia.git/commitdiff
Use loadView/releaseSubviews for PackageListController.
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 8 Mar 2011 21:12:26 +0000 (13:12 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 8 Mar 2011 21:12:26 +0000 (13:12 -0800)
MobileCydia.mm

index f5420afa966f2f8ab375c18c1029bed311671965..01a4338595fd90eec83827ad5f713f2d02c3162d 100644 (file)
@@ -5877,19 +5877,27 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 
         packages_ = [NSArray array];
         sections_ = [NSMutableArray arrayWithCapacity:16];
+    } return self;
+}
 
-        list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStylePlain] autorelease];
-        [list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
-        [[self view] addSubview:list_];
+- (void) loadView {
+    [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]];
 
-        // XXX: is 20 the most optimal number here?
-        [list_ setSectionIndexMinimumDisplayRowCount:20];
+    list_ = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStylePlain] autorelease];
+    [list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
+    [[self view] addSubview:list_];
 
-        [(UITableView *) list_ setDataSource:self];
-        [list_ setDelegate:self];
+    // XXX: is 20 the most optimal number here?
+    [list_ setSectionIndexMinimumDisplayRowCount:20];
 
-        [self updateHeight];
-    } return self;
+    [(UITableView *) list_ setDataSource:self];
+    [list_ setDelegate:self];
+
+    [self updateHeight];
+}
+
+- (void) releaseSubviews {
+    list_ = nil;
 }
 
 - (void) setDelegate:(id)delegate {