Commit e937fbc13e36215d1ed88663d74582216c109156
1 parent
cf227961
0.2.9
Showing
2 changed files
with
13 additions
and
8 deletions
CNLiveCommuntyModule.podspec
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | Pod::Spec.new do |s| | 9 | Pod::Spec.new do |s| |
| 10 | s.name = 'CNLiveCommuntyModule' | 10 | s.name = 'CNLiveCommuntyModule' |
| 11 | - s.version = '0.2.8' | 11 | + s.version = '0.2.9' |
| 12 | s.summary = 'A short description of CNLiveCommuntyModule.' | 12 | s.summary = 'A short description of CNLiveCommuntyModule.' |
| 13 | 13 | ||
| 14 | # This description is used to generate tags and improve search results. | 14 | # This description is used to generate tags and improve search results. |
CNLiveCommuntyModule/Classes/ViewController/CNLiveCommuntServiceViewController.m
| @@ -44,16 +44,21 @@ | @@ -44,16 +44,21 @@ | ||
| 44 | } | 44 | } |
| 45 | - (void)dealloc | 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 | - (void)viewDidLoad { | 63 | - (void)viewDidLoad { |
| 59 | [super viewDidLoad]; | 64 | [super viewDidLoad]; |