|
@@ -43,7 +43,7 @@ typedef enum {
|
|
|
// Do any additional setup after loading the view.
|
|
// Do any additional setup after loading the view.
|
|
|
|
|
|
|
|
[self configureTableView];
|
|
[self configureTableView];
|
|
|
-
|
|
|
|
|
|
|
+ [self registNotification];
|
|
|
[self loadData];
|
|
[self loadData];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -52,6 +52,10 @@ typedef enum {
|
|
|
// Dispose of any resources that can be recreated.
|
|
// Dispose of any resources that can be recreated.
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+- (void)dealloc {
|
|
|
|
|
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
#pragma mark - Configure
|
|
#pragma mark - Configure
|
|
|
|
|
|
|
|
- (void)configureTableView {
|
|
- (void)configureTableView {
|
|
@@ -75,6 +79,11 @@ typedef enum {
|
|
|
self.homeMoreTableView.jl_footer = self.refreshFooter;
|
|
self.homeMoreTableView.jl_footer = self.refreshFooter;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+- (void)registNotification {
|
|
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveNewOrderNotification:) name:RANotificationNewOrder object:nil];
|
|
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveReloadNotification:) name:RANotificationReloadHome object:nil];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
#pragma mark - Lazy
|
|
#pragma mark - Lazy
|
|
|
|
|
|
|
|
- (NSMutableArray<RAHomeOrderModel *> *)orderArray {
|
|
- (NSMutableArray<RAHomeOrderModel *> *)orderArray {
|
|
@@ -214,5 +223,15 @@ typedef enum {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+#pragma mark - Nofitication Selector
|
|
|
|
|
+
|
|
|
|
|
+- (void)receiveNewOrderNotification:(NSNotification *)notification {
|
|
|
|
|
+ [self loadData];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (void)receiveReloadNotification:(NSNotification *)notification {
|
|
|
|
|
+ [self loadData];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@end
|
|
@end
|