Commit e937fbc13e36215d1ed88663d74582216c109156
1 parent
cf227961
0.2.9
Showing
2 changed files
with
13 additions
and
8 deletions
CNLiveCommuntyModule.podspec
CNLiveCommuntyModule/Classes/ViewController/CNLiveCommuntServiceViewController.m
| ... | ... | @@ -44,16 +44,21 @@ |
| 44 | 44 | } |
| 45 | 45 | - (void)dealloc |
| 46 | 46 | { |
| 47 | - if (self.childViewControllers.count > 0) { | |
| 48 | - UIViewController *vc = self.childViewControllers[0]; | |
| 49 | - if (([self searchProperties:[vc class] string:@"collectionView"] || [self searchProperties:[vc.superclass class] string:@"collectionView"])&&[vc valueForKey:@"collectionView"]&&[[vc valueForKey:@"collectionView"] isKindOfClass:[UICollectionView class]]) { | |
| 50 | - UICollectionView *collectionView = (UICollectionView *)[vc valueForKey:@"collectionView"]; | |
| 51 | - if ([collectionView valueForKey:@"mj_header"]) { | |
| 52 | - id header = [collectionView valueForKey:@"mj_header"]; | |
| 53 | - [header removeObserver:self forKeyPath:@"state"]; | |
| 47 | + @try { | |
| 48 | + if (self.childViewControllers.count > 0) { | |
| 49 | + UIViewController *vc = self.childViewControllers[0]; | |
| 50 | + if (([self searchProperties:[vc class] string:@"collectionView"] || [self searchProperties:[vc.superclass class] string:@"collectionView"])&&[vc valueForKey:@"collectionView"]&&[[vc valueForKey:@"collectionView"] isKindOfClass:[UICollectionView class]]) { | |
| 51 | + UICollectionView *collectionView = (UICollectionView *)[vc valueForKey:@"collectionView"]; | |
| 52 | + if ([collectionView valueForKey:@"mj_header"]) { | |
| 53 | + id header = [collectionView valueForKey:@"mj_header"]; | |
| 54 | + [header removeObserver:self forKeyPath:@"state"]; | |
| 55 | + } | |
| 54 | 56 | } |
| 55 | 57 | } |
| 58 | + } @catch (NSException *exception) { | |
| 59 | + NSLog(@"这是异常了"); | |
| 56 | 60 | } |
| 61 | + | |
| 57 | 62 | } |
| 58 | 63 | - (void)viewDidLoad { |
| 59 | 64 | [super viewDidLoad]; | ... | ... |