Commit 8a54326de5408aa2cb173f88f1afd429af15a719
1 parent
7a01c6c1
闪退修改
Showing
1 changed file
with
6 additions
and
3 deletions
CNLiveScioLive/Pages/Newsound/OldController/VoiceViewController.m
| @@ -222,7 +222,7 @@ static const NSInteger margin = 34; | @@ -222,7 +222,7 @@ static const NSInteger margin = 34; | ||
| 222 | 222 | ||
| 223 | NSString *strUrl = @"http://app.phonemovie.cnlive.com/gxb/api/cataloglatest"; | 223 | NSString *strUrl = @"http://app.phonemovie.cnlive.com/gxb/api/cataloglatest"; |
| 224 | 224 | ||
| 225 | - NSString *categoryId = [NSString stringWithFormat:@"{\"plat\":\"a\",\"version\":\"5.0\",\"appid\":\"gxb\",\"categoryId\":\"spzl/news/\",\"page\":\"%ld\",\"pageSize\":\"10\"}",(long)self.engPageNumber]; | 225 | + NSString *categoryId = [NSString stringWithFormat:@"{\"plat\":\"a\",\"version\":\"5.0\",\"appid\":\"gxb\",\"categoryId\":\"spzl/news/\",\"page\":\"%ld\"}",(long)self.engPageNumber]; |
| 226 | 226 | ||
| 227 | if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { | 227 | if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { |
| 228 | [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; | 228 | [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; |
| @@ -343,7 +343,7 @@ static const NSInteger margin = 34; | @@ -343,7 +343,7 @@ static const NSInteger margin = 34; | ||
| 343 | 343 | ||
| 344 | NSString *strUrl = @"http://app.phonemovie.cnlive.com/gxb/api/cataloglatest"; | 344 | NSString *strUrl = @"http://app.phonemovie.cnlive.com/gxb/api/cataloglatest"; |
| 345 | 345 | ||
| 346 | - NSString *categoryId = [NSString stringWithFormat:@"{\"plat\":\"a\",\"version\":\"5.0\",\"appid\":\"gxb\",\"categoryId\":\"spzl/news/\",\"page\":\"%ld\",\"pageSize\":\"10\"}",(long)self.engPageNumber]; | 346 | + NSString *categoryId = [NSString stringWithFormat:@"{\"plat\":\"a\",\"version\":\"5.0\",\"appid\":\"gxb\",\"categoryId\":\"spzl/news/\",\"page\":\"%ld\"}",(long)self.engPageNumber]; |
| 347 | 347 | ||
| 348 | if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { | 348 | if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { |
| 349 | [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; | 349 | [AlertViewTool showHUDViewText:CustomStr(@"NetworkiInterruption")]; |
| @@ -1070,12 +1070,15 @@ static const NSInteger margin = 34; | @@ -1070,12 +1070,15 @@ static const NSInteger margin = 34; | ||
| 1070 | 1070 | ||
| 1071 | - (void)favoriteBtnClicked:(id)sender { | 1071 | - (void)favoriteBtnClicked:(id)sender { |
| 1072 | TableData *notice = [[TableData alloc] initWithJSONDictionary:_dictionary]; | 1072 | TableData *notice = [[TableData alloc] initWithJSONDictionary:_dictionary]; |
| 1073 | + if (!notice.pageUrl) { | ||
| 1074 | + return; | ||
| 1075 | + } | ||
| 1073 | BOOL isIn = [[DBAction sharedDBAction] isInTable:[User_Defaults objectForKey:Language_Local] notice:notice]; | 1076 | BOOL isIn = [[DBAction sharedDBAction] isInTable:[User_Defaults objectForKey:Language_Local] notice:notice]; |
| 1074 | NSMutableDictionary *author = [NSMutableDictionary dictionaryWithContentsOfFile:FavouriteAuthors_PATH]; | 1077 | NSMutableDictionary *author = [NSMutableDictionary dictionaryWithContentsOfFile:FavouriteAuthors_PATH]; |
| 1075 | if (!author) { | 1078 | if (!author) { |
| 1076 | author = [NSMutableDictionary dictionary]; | 1079 | author = [NSMutableDictionary dictionary]; |
| 1077 | } | 1080 | } |
| 1078 | - | 1081 | + |
| 1079 | if (!isIn) { | 1082 | if (!isIn) { |
| 1080 | BOOL isInsert = [[DBAction sharedDBAction] insertTable:[User_Defaults objectForKey:Language_Local] notice:notice]; | 1083 | BOOL isInsert = [[DBAction sharedDBAction] insertTable:[User_Defaults objectForKey:Language_Local] notice:notice]; |
| 1081 | [author setObject:_dictionary[@"author"] forKey:notice.pageUrl]; | 1084 | [author setObject:_dictionary[@"author"] forKey:notice.pageUrl]; |