瀏覽代碼

fix watch table initialization

Felix Paul Kühne 10 年之前
父節點
當前提交
2dd2731318
共有 2 個文件被更改,包括 12 次插入12 次删除
  1. 3 2
      Podfile.lock
  2. 9 10
      VLC for iOS WatchKit Extension/InterfaceController.m

+ 3 - 2
Podfile.lock

@@ -11,7 +11,8 @@ PODS:
   - upnpx (1.3.2)
 
 DEPENDENCIES:
-  - box-ios-sdk-v2 (from `git://github.com/carolanitz/box-ios-sdk-v2.git`, commit `d2df30aa5f76d30910e06f3ef5aff49025de3cf1`)
+  - box-ios-sdk-v2 (from `git://github.com/carolanitz/box-ios-sdk-v2.git`, commit
+    `d2df30aa5f76d30910e06f3ef5aff49025de3cf1`)
   - GHSidebarNav (= 1.0.0)
   - InAppSettingsKit (= 2.2.2)
   - OBSlider (= 1.1.0)
@@ -45,4 +46,4 @@ SPEC CHECKSUMS:
   SSKeychain: 88767e903ee8d274ed380e364d96b7a101235286
   upnpx: e56e4f26d21c439b2383e03b5ca9082a3d5046a1
 
-COCOAPODS: 0.36.0
+COCOAPODS: 0.36.1

+ 9 - 10
VLC for iOS WatchKit Extension/InterfaceController.m

@@ -43,20 +43,17 @@ static NSString *const VLCDBUpdateNotificationRemote = @"org.videolan.ios-app.db
     self.title = NSLocalizedString(@"LIBRARY_ALL_FILES", nil);
     [[VLCNotificationRelay sharedRelay] addRelayRemoteName:VLCDBUpdateNotificationRemote toLocalName:VLCDBUpdateNotification];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateData) name:VLCDBUpdateNotification object:nil];
-    VLCWatchTableController *tableController = [VLCWatchTableController new];
-    tableController.table = self.table;
-    tableController.previousPageButton = self.previousButton;
-    tableController.nextPageButton = self.nextButton;
-    tableController.pageSize = 5;
-    tableController.rowTypeForObjectBlock = ^(id object) {
+    _tableController = [[VLCWatchTableController alloc] init];
+    _tableController.table = self.table;
+    _tableController.previousPageButton = self.previousButton;
+    _tableController.nextPageButton = self.nextButton;
+    _tableController.pageSize = 5;
+    _tableController.rowTypeForObjectBlock = ^(id object) {
         return rowType;
     };
-    tableController.configureRowControllerWithObjectBlock = ^(id controller, id object) {
+    _tableController.configureRowControllerWithObjectBlock = ^(id controller, id object) {
         [self configureTableRowController:context withObject:object];
     };
-
-
-    [self updateData];
 }
 
 - (void)willActivate {
@@ -64,6 +61,8 @@ static NSString *const VLCDBUpdateNotificationRemote = @"org.videolan.ios-app.db
     [super willActivate];
     NSLog(@"%s",__PRETTY_FUNCTION__);
 
+    [self updateData];
+
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateData) name:VLCDBUpdateNotification object:nil];
 }