修复了数组可能越界的问题

This commit is contained in:
fengshuo
2022-11-11 17:46:37 +08:00
parent e855f87849
commit c22ede0a13
146 changed files with 515 additions and 371 deletions

View File

@@ -16,6 +16,7 @@
#import "ThemeColor.h"
#import "XCCurrentVCStackManager.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///View
#import "XPShareItemCell.h"
#import "XPMineShareViewController.h"
@@ -112,7 +113,7 @@
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
XPShareItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPShareItemCell class]) forIndexPath:indexPath];
XPShareItem * item = [self.items objectAtIndex:indexPath.item];
XPShareItem * item = [self.items safeObjectAtIndex1:indexPath.item];
if (item.type == XPShareItemTagAppFriends) {
item.disable = YES;
} else {
@@ -123,7 +124,7 @@
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
XPShareItem * item = [self.items objectAtIndex:indexPath.item];
XPShareItem * item = [self.items safeObjectAtIndex1:indexPath.item];
if (item.type == XPShareItemTagAppFriends) {
[TTPopup dismiss];
XPMineShareViewController * shareVC = [[XPMineShareViewController alloc] init];

View File

@@ -8,6 +8,7 @@
#import "XPHomeAttentionTableViewCell.h"
///Third
#import <Masonry/Masonry.h>
#import "NSArray+Safe.h"
///View
#import "XPHomeAttentionCollectionViewCell.h"
@@ -42,7 +43,7 @@
#pragma mark - UICollectionViewCellDelegate And UICollectionViewDatasource
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPHomeAttentionCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeAttentionCollectionViewCell class]) forIndexPath:indexPath];
cell.liveRoom = [self.attentionList objectAtIndex:indexPath.item];
cell.liveRoom = [self.attentionList safeObjectAtIndex1:indexPath.item];
return cell;
}
@@ -53,7 +54,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.attentionList.count > 0) {
HomeLiveRoomModel * liveModel = [self.attentionList objectAtIndex:indexPath.item];
HomeLiveRoomModel * liveModel = [self.attentionList safeObjectAtIndex1:indexPath.item];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPHomeAttentionTableViewCell:didClickItem:)]) {
[self.delegate xPHomeAttentionTableViewCell:self didClickItem:liveModel];
}

View File

@@ -11,6 +11,7 @@
#import <SDCycleScrollView/SDCycleScrollView.h>
///Model
#import "HomeBannerInfoModel.h"
#import "NSArray+Safe.h"
@interface XPHomeBannerTableViewCell ()<SDCycleScrollViewDelegate>
@property (nonatomic, strong) SDCycleScrollView *cycleScrollView;
@@ -42,7 +43,7 @@
}
#pragma mark - SDCycleScrollViewDelegate
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
HomeBannerInfoModel * bannerInfo = [self.bannerList objectAtIndex:index];
HomeBannerInfoModel * bannerInfo = [self.bannerList safeObjectAtIndex1:index];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPHomeBannerTableViewCell:didClickBanner:)]) {
[self.delegate xPHomeBannerTableViewCell:self didClickBanner:bannerInfo];
}

View File

@@ -11,6 +11,7 @@
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
#import "NSArray+Safe.h"
#import "UIImage+Utils.h"
///Model
#import "HomeCollectRoomModel.h"
@@ -183,9 +184,9 @@
if (_roomInfo.micUsers.count > 0) {
self.micContainerView.hidden = NO;
for (NSInteger i = 0; i < self.micUserArray.count; i++) {
NetImageView * imageView = [self.micUserArray objectAtIndex:i];
NetImageView * imageView = [self.micUserArray safeObjectAtIndex1:i];
if (i< _roomInfo.micUsers.count) {
HomePlayMicUserModel * micUserInfo = [_roomInfo.micUsers objectAtIndex:i];
HomePlayMicUserModel * micUserInfo = [_roomInfo.micUsers safeObjectAtIndex1:i];
imageView.imageUrl = micUserInfo.avatar;
imageView.hidden = NO;
} else {

View File

@@ -12,6 +12,7 @@
#import "ThemeColor.h"
#import "NetImageView.h"
#import "XPHomeGradientLabel.h"
#import "NSArray+Safe.h"
///Model
#import "HomePlayRoomModel.h"
@@ -194,9 +195,9 @@
}
for (int i = 0; i < self.stackView.subviews.count; i++) {
NetImageView * imageView = [self.stackView.subviews objectAtIndex:i];
NetImageView * imageView = [self.stackView.subviews safeObjectAtIndex1:i];
if (i < _roomInfo.micUsers.count) {
HomePlayMicUserModel * userInfo = [_roomInfo.micUsers objectAtIndex:i];
HomePlayMicUserModel * userInfo = [_roomInfo.micUsers safeObjectAtIndex1:i];
imageView.imageUrl = userInfo.avatar;
imageView.hidden = NO;
} else {

View File

@@ -12,6 +12,7 @@
#import "XPMacro.h"
#import "ThemeColor.h"
#import "UIImage+Utils.h"
#import "NSArray+Safe.h"
///View
#import "XPHomeHotRoomCollectionViewCell.h"
@@ -62,7 +63,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPHomeHotRoomCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeHotRoomCollectionViewCell class]) forIndexPath:indexPath];
HomeRecommendRoomModel * info = [self.hotAnchorList objectAtIndex:indexPath.row];
HomeRecommendRoomModel * info = [self.hotAnchorList safeObjectAtIndex1:indexPath.row];
cell.hotRoomInfo = info;
cell.indexPathRow = indexPath.row;
return cell;
@@ -71,7 +72,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.hotAnchorList.count > 0) {
HomeRecommendRoomModel * info = [self.hotAnchorList objectAtIndex:indexPath.row];
HomeRecommendRoomModel * info = [self.hotAnchorList safeObjectAtIndex1:indexPath.row];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPHomeHotRoomTableViewCell:didClickItem:)]) {
[self.delegate xPHomeHotRoomTableViewCell:self didClickItem:info];
}

View File

@@ -13,6 +13,7 @@
#import "NetImageView.h"
#import "XPMacro.h"
#import "UIImage+Utils.h"
#import "NSArray+Safe.h"
#import "XPHomeGradientLabel.h"
///Model
#import "HomeLittleGameRoomModel.h"
@@ -172,9 +173,9 @@
if (_gameInfo.micUsers.count > 0) {
self.micContainerView.hidden = NO;
for (NSInteger i = 0; i < self.micUserArray.count; i++) {
NetImageView * imageView = [self.micUserArray objectAtIndex:i];
NetImageView * imageView = [self.micUserArray safeObjectAtIndex1:i];
if (i< _gameInfo.micUsers.count) {
HomeLittleGameMicUserModel * micUserInfo = [_gameInfo.micUsers objectAtIndex:i];
HomeLittleGameMicUserModel * micUserInfo = [_gameInfo.micUsers safeObjectAtIndex1:i];
imageView.imageUrl = micUserInfo.avatar;
imageView.hidden = NO;
} else {

View File

@@ -12,6 +12,7 @@
#import "ThemeColor.h"
#import "NetImageView.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "HomeMenuInfoModel.h"
@@ -66,7 +67,7 @@
#pragma mark - Event Response
- (void)onTapMenuRecognizer:(UITapGestureRecognizer *)tap {
UIView * view = [tap view];
HomeMenuInfoModel * homeInfoModel = [self.menuList objectAtIndex:view.tag -1000];
HomeMenuInfoModel * homeInfoModel = [self.menuList safeObjectAtIndex1:view.tag -1000];
if (homeInfoModel && self.delegate && [self.delegate respondsToSelector:@selector(xPHomeMenuTableViewCell:didClickMenuInfo:)]) {
[self.delegate xPHomeMenuTableViewCell:self didClickMenuInfo:homeInfoModel];
}

View File

@@ -10,6 +10,7 @@
#import <Masonry/Masonry.h>
///Tool
#import "XPMacro.h"
#import "NSArray+Safe.h"
///View
#import "XPHomeRedommendCollectionViewCell.h"
@@ -48,7 +49,7 @@
- (void)tapRecognizer:(UITapGestureRecognizer *)tap {
NSInteger index = tap.view.tag - 1001;
if (index < self.recommendList.count) {
HomeRecommendRoomModel * recommend = [_recommendList objectAtIndex:index];
HomeRecommendRoomModel * recommend = [_recommendList safeObjectAtIndex1:index];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPHomeRecommendTableViewCell:didClickItem:)]) {
[self.delegate xPHomeRecommendTableViewCell:self didClickItem:recommend];
}
@@ -66,7 +67,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPHomeRedommendCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeRedommendCollectionViewCell class]) forIndexPath:indexPath];
HomeRecommendRoomModel * info = [self.recommendList objectAtIndex:indexPath.row];
HomeRecommendRoomModel * info = [self.recommendList safeObjectAtIndex1:indexPath.row];
cell.recommendRoomInfo = info;
return cell;
}
@@ -74,7 +75,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.recommendList.count > 0) {
HomeRecommendRoomModel * recommend = [self.recommendList objectAtIndex:indexPath.row];
HomeRecommendRoomModel * recommend = [self.recommendList safeObjectAtIndex1:indexPath.row];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPHomeRecommendTableViewCell:didClickItem:)]) {
[self.delegate xPHomeRecommendTableViewCell:self didClickItem:recommend];
}

View File

@@ -11,6 +11,7 @@
#import <Masonry/Masonry.h>
#import "ThemeColor.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///View
#import "XPHomeLiveRecordCell.h"
#import "StatisticsServiceHelper.h"
@@ -82,7 +83,7 @@
#pragma mark - UICollectionViewCellDelegate And UICollectionViewDatasource
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPHomeLiveRecordCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeLiveRecordCell class]) forIndexPath:indexPath];
cell.recordRoom = [self.roomList objectAtIndex:indexPath.item];
cell.recordRoom = [self.roomList safeObjectAtIndex1:indexPath.item];
return cell;
}
@@ -93,7 +94,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.roomList.count > 0) {
HomeRecommendRoomModel * liveModel = [self.roomList objectAtIndex:indexPath.item];
HomeRecommendRoomModel * liveModel = [self.roomList safeObjectAtIndex1:indexPath.item];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPHomeLiveHeadViewDidClickItem:)]) {
NSMutableDictionary * dic = [NSMutableDictionary dictionary];
[dic safeSetObject:liveModel.uid forKey:@"roomUid"];

View File

@@ -11,6 +11,7 @@
#import <MJRefresh/MJRefresh.h>
///Tool
#import "ThemeColor.h"
#import "NSArray+Safe.h"
///View
#import "XPHomeHapppyRoomTableViewCell.h"
#import "XPHomeBannerTableViewCell.h"
@@ -67,7 +68,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.roomList.count > 0) {
HomePlayRoomModel * model = [self.roomList objectAtIndex:indexPath.row];
HomePlayRoomModel * model = [self.roomList safeObjectAtIndex1:indexPath.row];
if (model.isBanner) {
return 80;
}
@@ -78,7 +79,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.roomList.count > 0) {
HomePlayRoomModel * model = [self.roomList objectAtIndex:indexPath.row];
HomePlayRoomModel * model = [self.roomList safeObjectAtIndex1:indexPath.row];
if (model.isBanner) {
XPHomeBannerTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
if (cell == nil) {
@@ -106,7 +107,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.roomList.count > 0) {
HomePlayRoomModel * model = [self.roomList objectAtIndex:indexPath.row];
HomePlayRoomModel * model = [self.roomList safeObjectAtIndex1:indexPath.row];
if (!model.isBanner && model.uid.integerValue > 0) {
[XPRoomViewController openRoom:model.uid fromNick:nil fromType:UserEnterRoomFromType_Home_Recommend fromUid:nil viewController:self];
}

View File

@@ -8,6 +8,7 @@
#import "XPHomeHotRoomViewController.h"
///Third
#import <Masonry/Masonry.h>
#import "NSArray+Safe.h"
///View
#import "XPHomeHapppyRoomTableViewCell.h"
#import "XPHomeListEmptyTableViewCell.h"
@@ -56,7 +57,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.roomList.count > 0) {
HomePlayRoomModel * model = [self.roomList objectAtIndex:indexPath.row];
HomePlayRoomModel * model = [self.roomList safeObjectAtIndex1:indexPath.row];
if (model.isBanner) {
return 80;
}
@@ -67,7 +68,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.roomList.count > 0) {
HomePlayRoomModel * model = [self.roomList objectAtIndex:indexPath.row];
HomePlayRoomModel * model = [self.roomList safeObjectAtIndex1:indexPath.row];
if (model.isBanner) {
XPHomeBannerTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
if (cell == nil) {
@@ -95,7 +96,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.roomList.count > 0) {
HomePlayRoomModel * model = [self.roomList objectAtIndex:indexPath.row];
HomePlayRoomModel * model = [self.roomList safeObjectAtIndex1:indexPath.row];
if (!model.isBanner && model.uid.integerValue > 0) {
[XPRoomViewController openRoom:model.uid fromNick:model.title fromType:UserEnterRoomFromType_Home_Recommend fromUid:nil viewController:self];
}

View File

@@ -12,6 +12,7 @@
///Tool
#import "XPMacro.h"
#import "ThemeColor.h"
#import "NSArray+Safe.h"
///Model
#import "HomeLiveRoomModel.h"
#import "HomeCollectRoomModel.h"
@@ -186,7 +187,7 @@
if (cell == nil) {
cell = [[XPHomeCollectRoomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeCollectRoomTableViewCell class])];
}
cell.roomInfo = [self.collectRoomList objectAtIndex:indexPath.row];
cell.roomInfo = [self.collectRoomList safeObjectAtIndex1:indexPath.row];
return cell;
} else {
XPHomeLikeEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeLikeEmptyTableViewCell class])];
@@ -201,7 +202,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (indexPath.section == 1 && self.collectRoomList.count > 0) {
HomeCollectRoomModel * roomInfo = [self.collectRoomList objectAtIndex:indexPath.row];
HomeCollectRoomModel * roomInfo = [self.collectRoomList safeObjectAtIndex1:indexPath.row];
if (roomInfo.roomUid.integerValue > 0) {
[XPRoomViewController openRoom:roomInfo.roomUid viewController:self];
}

View File

@@ -12,6 +12,7 @@
///Tool
#import "ThemeColor.h"
#import "UIImage+Utils.h"
#import "NSArray+Safe.h"
///Model
#import "HomeLittleGameRoomModel.h"
///View
@@ -114,7 +115,7 @@
if (cell == nil) {
cell = [[XPHomeLittleGameTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeLittleGameTableViewCell class])];
}
cell.gameInfo = [self.datasource objectAtIndex:indexPath.row];
cell.gameInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
return cell;
}
XPHomeListEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
@@ -127,7 +128,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
HomeLittleGameRoomModel * gameInfo = [self.datasource objectAtIndex:indexPath.row];
HomeLittleGameRoomModel * gameInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
if (gameInfo.uid.length > 0) {
[XPRoomViewController openRoom:gameInfo.uid viewController:self];
}

View File

@@ -13,6 +13,7 @@
#import "ThemeColor.h"
#import "XPMacro.h"
#import "XCHUDTool.h"
#import "NSArray+Safe.h"
///View
#import "XPHomeHapppyRoomTableViewCell.h"
#import "XPHomeBannerTableViewCell.h"
@@ -91,7 +92,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPHomeListCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeListCollectionViewCell class]) forIndexPath:indexPath];
HomeRecommendRoomModel * model = [self.datasource objectAtIndex:indexPath.item];
HomeRecommendRoomModel * model = [self.datasource safeObjectAtIndex1:indexPath.item];
cell.roomModel = model;
return cell;
}
@@ -104,7 +105,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
HomeRecommendRoomModel * model = [self.datasource objectAtIndex:indexPath.item];
HomeRecommendRoomModel * model = [self.datasource safeObjectAtIndex1:indexPath.item];
NSString *roomUid = model.uid;
if (roomUid.length > 0) {
[XPRoomViewController openRoom:roomUid viewController:self];

View File

@@ -15,6 +15,7 @@
#import "XPMacro.h"
#import "ThemeColor.h"
#import "XPHtmlUrl.h"
#import "NSArray+Safe.h"
///Model
#import "HomeTagModel.h"
///View
@@ -97,7 +98,7 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
}
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
HomeTagModel * hometag = [self.tagList objectAtIndex:index];
HomeTagModel * hometag = [self.tagList safeObjectAtIndex1:index];
UIViewController<JXCategoryListContentViewDelegate> * list = (UIViewController<JXCategoryListContentViewDelegate> *)[self.contentView.validListDict objectForKey:[NSNumber numberWithInteger:index]];
if (list) {
return list;
@@ -118,7 +119,7 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
}
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
HomeTagModel * hometag = [self.tagList objectAtIndex:index];
HomeTagModel * hometag = [self.tagList safeObjectAtIndex1:index];
if (![hometag.name isEqualToString:@"喜欢"] && ![hometag.name isEqualToString:@"小游戏"]) {
XPHomePartyViewController * list = (XPHomePartyViewController<JXCategoryListContentViewDelegate> *)[self.contentView.validListDict objectForKey:[NSNumber numberWithInteger:index]];;
if ([hometag.name isEqualToString:@"个播"]) {

View File

@@ -12,6 +12,7 @@
///Tool
#import "XPMacro.h"
#import "ThemeColor.h"
#import "NSArray+Safe.h"
///Model
#import "HomeRecommendRoomModel.h"
///View
@@ -111,7 +112,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPHomeListCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeListCollectionViewCell class]) forIndexPath:indexPath];
HomeRecommendRoomModel * model = [self.datasource objectAtIndex:indexPath.item];
HomeRecommendRoomModel * model = [self.datasource safeObjectAtIndex1:indexPath.item];
cell.roomModel = model;
return cell;
}
@@ -124,7 +125,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
HomeRecommendRoomModel * model = [self.datasource objectAtIndex:indexPath.item];
HomeRecommendRoomModel * model = [self.datasource safeObjectAtIndex1:indexPath.item];
NSString * roomUid;
if (self.isAnchor) {
roomUid = model.uid;

View File

@@ -19,6 +19,7 @@
#import "XPWeakTimer.h"
#import "ClientConfig.h"
#import "UIImage+Utils.h"
#import "NSArray+Safe.h"
///View
#import "XPHomeRecommendHeaderView.h"
///P
@@ -206,7 +207,7 @@
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
UIViewController *viewController;
NSString * title= [self.titles objectAtIndex:index];
NSString * title= [self.titles safeObjectAtIndex1:index];
if ([title isEqualToString:@"开黑畅聊"]) {
viewController = self.personalRoomVC;
} else {
@@ -216,7 +217,7 @@
}
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
NSString * title= [self.titles objectAtIndex:index];
NSString * title= [self.titles safeObjectAtIndex1:index];
if ([title isEqualToString:@"开黑畅聊"]) {
[self.presenter getPlayGameWithTeam:1];
} else {

View File

@@ -11,6 +11,7 @@
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "HomeSearchResultModel.h"
///View
@@ -79,14 +80,14 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
if (cell == nil) {
cell = [[XPSearchListTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPSearchListTableViewCell class])];
}
HomeSearchResultModel * resultModel = [self.datasource objectAtIndex:indexPath.row];
HomeSearchResultModel * resultModel = [self.datasource safeObjectAtIndex1:indexPath.row];
[cell configData:resultModel type:self.type];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
HomeSearchResultModel * resultModel = [self.datasource objectAtIndex:indexPath.row];
HomeSearchResultModel * resultModel = [self.datasource safeObjectAtIndex1:indexPath.row];
BOOL result = [[NSUserDefaults standardUserDefaults] boolForKey:kFromSearchToHomeViewKey];
if (!result) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kFromSearchToHomeViewKey];

View File

@@ -12,6 +12,7 @@
#import "ThemeColor.h"
#import "AccountInfoStorage.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///View
#import "XPHomeAttentionCollectionViewCell.h"
#import "XPHomeSearchRecordCell.h"
@@ -157,7 +158,7 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
if (collectionView == self.searchCollectionView) {
XPHomeSearchRecordCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeSearchRecordCell class]) forIndexPath:indexPath];
cell.recordString = [self.searchList objectAtIndex:indexPath.row];
cell.recordString = [self.searchList safeObjectAtIndex1:indexPath.row];
return cell;
} else {
XPHomeAttentionCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeAttentionCollectionViewCell class]) forIndexPath:indexPath];
@@ -187,7 +188,7 @@ NSString * const XPConstSearchRecordStoreKey = @"XPConstSearchRecordStoreKey";
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
if (collectionView == self.searchCollectionView) {
NSString *str = [self.searchList objectAtIndex:indexPath.row];
NSString *str = [self.searchList safeObjectAtIndex1:indexPath.row];
CGFloat width = [str boundingRectWithSize:CGSizeMake(200, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:12]} context:nil].size.width;
return CGSizeMake(width + 26, 26);
} else {

View File

@@ -15,6 +15,7 @@
#import "XCHUDTool.h"
#import "Api+FindNew.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "FindNewGreetListModel.h"
///View
@@ -132,7 +133,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
XPSessionFindNewGreetTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPSessionFindNewGreetTableViewCell class])];
FindNewGreetModel * model = [self.datasource objectAtIndex:indexPath.row];
FindNewGreetModel * model = [self.datasource safeObjectAtIndex1:indexPath.row];
if (model.fId == self.selectModel.fId) {
model.isSelect = YES;
} else {
@@ -145,7 +146,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
FindNewGreetModel * model = [self.datasource objectAtIndex:indexPath.row];
FindNewGreetModel * model = [self.datasource safeObjectAtIndex1:indexPath.row];
self.selectModel = model;
[self.tableView reloadData];
}

View File

@@ -12,6 +12,7 @@
#import "ThemeColor.h"
#import "TTPopup.h"
#import "XCCurrentVCStackManager.h"
#import "NSArray+Safe.h"
///Model
#import "FindNewUserInfoModel.h"
///View
@@ -93,7 +94,7 @@
if (cell == nil) {
cell = [[XPSessionFindNewTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPSessionFindNewTableViewCell class])];
}
cell.userInfo = [self.datasource objectAtIndex:indexPath.row];
cell.userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.delegate = self;
return cell;
}
@@ -147,7 +148,7 @@
///
UIWindow * currentWindow;
for (int i = 0; i < [UIApplication sharedApplication].windows.count; i++) {
UIWindow * window = [[UIApplication sharedApplication].windows objectAtIndex:i];
UIWindow * window = [[UIApplication sharedApplication].windows safeObjectAtIndex1:i];
if(window.tag == 1000) {
currentWindow = window;
break;
@@ -200,7 +201,7 @@
///
UIWindow * currentWindow;
for (int i = 0; i < [UIApplication sharedApplication].windows.count; i++) {
UIWindow * window = [[UIApplication sharedApplication].windows objectAtIndex:i];
UIWindow * window = [[UIApplication sharedApplication].windows safeObjectAtIndex1:i];
if(window.tag == 1000) {
currentWindow = window;
break;

View File

@@ -12,6 +12,7 @@
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "MessageMenuModel.h"
///View
@@ -154,7 +155,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
MessageToolMenuCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MessageToolMenuCollectionViewCell class]) forIndexPath:indexPath];
MessageMenuModel * model = [self.menuList objectAtIndex:indexPath.row];
MessageMenuModel * model = [self.menuList safeObjectAtIndex1:indexPath.row];
cell.imageName = model.imageName;
return cell;
}
@@ -162,7 +163,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.menuList.count > 0) {
MessageMenuModel * model = [self.menuList objectAtIndex:indexPath.row];
MessageMenuModel * model = [self.menuList safeObjectAtIndex1:indexPath.row];
if (self.delegate && [self.delegate respondsToSelector:@selector(didSelectMenuItem:)]) {
[self.delegate didSelectMenuItem:model];
}

View File

@@ -16,6 +16,7 @@
#import "XPMacro.h"
#import "UITableView+NIMScrollToBottom.h"
#import "ThemeColor.h"
#import "NSArray+Safe.h"
///Model
#import "RoomInfoModel.h"
#import "UserInfoModel.h"
@@ -115,7 +116,7 @@
[self.sessionTableView.mj_header endRefreshing];
if (error == nil && messages.count > 0) {
for (int i = ((int)messages.count -1); i > 0; i--) {
NIMMessage * message = [messages objectAtIndex:i];
NIMMessage * message = [messages safeObjectAtIndex1:i];
[self.messages insertObject:message atIndex:0];
}
}
@@ -350,7 +351,7 @@
}
- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
NIMMessage * message = [self.messages objectAtIndex:indexPath.row];
NIMMessage * message = [self.messages safeObjectAtIndex1:indexPath.row];
NSString * identifier = [MessageCell cellContent:message];
///cell
MessageCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
@@ -361,12 +362,12 @@
cell = [tableView dequeueReusableCellWithIdentifier:identifier];
}
cell.delegate = self;
[cell renderWithMessage:[self.messages objectAtIndex:indexPath.row]];
[cell renderWithMessage:[self.messages safeObjectAtIndex1:indexPath.row]];
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
NIMMessage *msg = [self.messages objectAtIndex:indexPath.row];
NIMMessage *msg = [self.messages safeObjectAtIndex1:indexPath.row];
return [MessageCell measureHeight:msg];
}
@@ -498,7 +499,7 @@
UIWindow * currentWindow;
for (int i = 0; i < [UIApplication sharedApplication].windows.count; i++) {
UIWindow * window = [[UIApplication sharedApplication].windows objectAtIndex:i];
UIWindow * window = [[UIApplication sharedApplication].windows safeObjectAtIndex1:i];
if(window.tag == 1000) {
currentWindow = window;
break;

View File

@@ -14,6 +14,7 @@
#import "ClientConfig.h"
#import "Api+Mine.h"
#import "AccountInfoStorage.h"
#import "NSArray+Safe.h"
///Model
#import "UserInfoModel.h"
///View
@@ -223,7 +224,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction * deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"置顶" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
NIMRecentSession * session = [self.recentSessions objectAtIndex:indexPath.row];
NIMRecentSession * session = [self.recentSessions safeObjectAtIndex1:indexPath.row];
[[NIMSDK sharedSDK].conversationManager deleteRecentSession:session];
}];
deleteAction.title = @"删除";

View File

@@ -12,6 +12,7 @@
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "HomeCollectRoomModel.h"
///P
@@ -138,14 +139,14 @@
if (cell == nil) {
cell = [[XPMineCollectRoomEditCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineCollectRoomEditCell class])];
}
cell.roomInfo = [self.datasource objectAtIndex:indexPath.row];
cell.roomInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
return cell;
} else {
XPMineCollectRoomCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineCollectRoomCell class])];
if (cell == nil) {
cell = [[XPMineCollectRoomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineCollectRoomCell class])];
}
cell.roomInfo = [self.datasource objectAtIndex:indexPath.row];
cell.roomInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
return cell;
}
}
@@ -163,7 +164,7 @@
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
HomeCollectRoomModel * roomInfo = [self.datasource objectAtIndex:indexPath.row];
HomeCollectRoomModel * roomInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
if (self.isEdit) {
roomInfo.isSelected = !roomInfo.isSelected;
[tableView reloadData];

View File

@@ -12,6 +12,7 @@
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "FansInfoModel.h"
///View
@@ -142,7 +143,7 @@
cell = [[XPMineAttentionTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineAttentionTableViewCell class])];
}
cell.delegate = self;
FansInfoModel * fansInfo = [self.datasource objectAtIndex:indexPath.row];
FansInfoModel * fansInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
fansInfo.useingType = self.type;
cell.fansInfo = fansInfo;
return cell;
@@ -159,7 +160,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
FansInfoModel * fansInfoModel = [self.datasource objectAtIndex:indexPath.row];
FansInfoModel * fansInfoModel = [self.datasource safeObjectAtIndex1:indexPath.row];
if (self.type == ContactUseingType_In_Room) {
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:[NIMSession session:fansInfoModel.uid type:NIMSessionTypeP2P]];
sessionVC.openType = SessionListOpenTypeRoom;

View File

@@ -12,6 +12,7 @@
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "FansInfoModel.h"
///View
@@ -152,7 +153,7 @@
cell = [[XPMineFansTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineFansTableViewCell class])];
}
cell.delegate = self;
FansInfoModel * fansInfo = [self.datasource objectAtIndex:indexPath.row];
FansInfoModel * fansInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
fansInfo.useingType = self.type;
cell.fansInfo = fansInfo;
return cell;
@@ -169,7 +170,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
FansInfoModel * fansInfoModel = [self.datasource objectAtIndex:indexPath.row];
FansInfoModel * fansInfoModel = [self.datasource safeObjectAtIndex1:indexPath.row];
if (self.type == ContactUseingType_In_Room) {
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:[NIMSession session:fansInfoModel.uid type:NIMSessionTypeP2P]];
sessionVC.openType = SessionListOpenTypeRoom;

View File

@@ -13,6 +13,7 @@
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "UserInfoModel.h"
///View
@@ -50,7 +51,7 @@
if (array.count > 0) {
NSMutableArray * uids = [NSMutableArray array];
for (int i = 0; i< array.count; i++) {
NIMUser * user = [array objectAtIndex:i];
NIMUser * user = [array safeObjectAtIndex1:i];
[uids addObject:user.userId];
}
[self.presenter getUserListInfo:uids];
@@ -84,7 +85,7 @@
if (cell == nil) {
cell = [[XPMineFriendTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineFriendTableViewCell class])];
}
cell.userInfo = [self.datasource objectAtIndex:indexPath.row];
cell.userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
return cell;
}
@@ -99,7 +100,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
UserInfoModel * userInfo = [self.datasource objectAtIndex:indexPath.row];
UserInfoModel * userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
if (self.type == ContactUseingType_Share) {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineFriendViewController:didSelectItem:)]) {
[self.delegate xPMineFriendViewController:self didSelectItem:userInfo];

View File

@@ -13,6 +13,7 @@
#import "ThemeColor.h"
#import "NetImageView.h"
#import "NIMMessageUtils.h"
#import "NSArray+Safe.h"
@interface XPRoomMessageBubbleCollectionViewCell : UICollectionViewCell
@@ -169,13 +170,13 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPRoomMessageBubbleCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPRoomMessageBubbleCollectionViewCell class]) forIndexPath:indexPath];
cell.session = [self.datasource objectAtIndex:indexPath.row];
cell.session = [self.datasource safeObjectAtIndex1:indexPath.row];
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomMessageBubbleView:didSelectSession:)]) {
NIMRecentSession * session = [self.datasource objectAtIndex:indexPath.row];
NIMRecentSession * session = [self.datasource safeObjectAtIndex1:indexPath.row];
[self.delegate xPRoomMessageBubbleView:self didSelectSession:session];
[self animationFinish];
}

View File

@@ -8,6 +8,7 @@
#import "XPGuildSuperAdminSetTableViewCell.h"
///Third
#import <Masonry/Masonry.h>
#import "NSArray+Safe.h"
///Tool
#import "ThemeColor.h"
///Tool
@@ -123,7 +124,7 @@
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPGuildSuperAdminRoomCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPGuildSuperAdminRoomCollectionViewCell class]) forIndexPath:indexPath];
GuildRoomInfoModel * roomInfo = [self.managerInfo.roomList objectAtIndex:indexPath.row];
GuildRoomInfoModel * roomInfo = [self.managerInfo.roomList safeObjectAtIndex1:indexPath.row];
cell.roomInfo = roomInfo;
return cell;
}

View File

@@ -13,6 +13,7 @@
#import "NetImageView.h"
#import "ThemeColor.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "GuildPersonIncomeRecordModel.h"
///View
@@ -104,7 +105,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasouce.count > 0) {
XPGuildIncomeDetailCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPGuildIncomeDetailCollectionViewCell class]) forIndexPath:indexPath];
cell.incomeDetailInfo= [self.datasouce objectAtIndex:indexPath.row];
cell.incomeDetailInfo= [self.datasouce safeObjectAtIndex1:indexPath.row];
return cell;
}

View File

@@ -9,12 +9,14 @@
///Third
#import <Masonry/Masonry.h>
#import <MJRefresh/MJRefresh.h>
///Tool
#import "ThemeColor.h"
#import "PLTimeUtil.h"
#import "TTPopup.h"
#import "NSDate+DateUtils.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "GuildIncomeRecordModel.h"
#import "GuildPersonIncomeRecordModel.h"
@@ -179,14 +181,14 @@
cell = [[XPGuildIncomeRecordTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPGuildIncomeRecordTableViewCell class])];
}
cell.rankNumber = indexPath.row;
cell.userInfo = [self.datasource objectAtIndex:indexPath.row];
cell.userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
return cell;
} else if(self.incomeType == GuildIncomeType_Hall) {
XPGuildPersonIncomeTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPGuildPersonIncomeTableViewCell class])];
if (cell == nil) {
cell = [[XPGuildPersonIncomeTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPGuildPersonIncomeTableViewCell class])];
}
cell.userInfo = [self.datasource objectAtIndex:indexPath.row];
cell.userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
return cell;
} else if(self.incomeType == GuildIncomeType_Anchor) {
XPGuildSingleRoomIncomeTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPGuildSingleRoomIncomeTableViewCell class])];
@@ -194,7 +196,7 @@
cell = [[XPGuildSingleRoomIncomeTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPGuildSingleRoomIncomeTableViewCell class])];
}
cell.userInfo = [self.datasource objectAtIndex:indexPath.row];
cell.userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.rankNumber = indexPath.row;
return cell;
}
@@ -236,7 +238,7 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.incomeType == GuildIncomeType_Hall) {
if (self.datasource.count > 0) {
GuildPersonIncomeUserInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
GuildPersonIncomeUserInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
XPMineGuildIncomeDetailViewController * incomeDetailVC = [[XPMineGuildIncomeDetailViewController alloc] init];
incomeDetailVC.hallId = self.guidId;
incomeDetailVC.startTime = self.startTimeStr;

View File

@@ -13,6 +13,7 @@
#import "XPMacro.h"
#import "NetImageView.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "ClanMemberDetailInfoModel.h"
#import "GuildAuthModel.h"
@@ -138,7 +139,7 @@
if (cell == nil) {
cell = [[XPMineGuildManagerPerTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineGuildManagerPerTableViewCell class])];
}
GuildAuthModel * authInfo = [self.datasource objectAtIndex:indexPath.row];
GuildAuthModel * authInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.authInfo = authInfo;
cell.delegate = self;
if (authInfo.status) {

View File

@@ -12,6 +12,7 @@
///Tool
#import "ThemeColor.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///View
#import "XPClanMemberTableViewCell.h"
///P
@@ -159,7 +160,7 @@
}
cell.delegate = self;
cell.cellType = ClanMemberTableViewCellType_Manager_Add_Remove;
ClanMemberInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
if (memberInfo.roleType == GuildRoleType_Manager) {
self.managerNumber += 1;
}

View File

@@ -12,6 +12,7 @@
///Tool
#import "ThemeColor.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///View
#import "XPClanMemberTableViewCell.h"
#import "XPMineGuildEmptyTableViewCell.h"
@@ -136,7 +137,7 @@
}
cell.delegate = self;
cell.cellType = ClanMemberTableViewCellType_Remove_Member;
ClanMemberInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.memberInfo = memberInfo;
return cell;
}
@@ -148,7 +149,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
ClanMemberInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
XPMineUserInfoViewController * mineUserVC = [[XPMineUserInfoViewController alloc] init];
mineUserVC.uid = memberInfo.uid.integerValue;
[self.navigationController pushViewController:mineUserVC animated:YES];

View File

@@ -12,6 +12,7 @@
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///View
#import "XPClanMemberTableViewCell.h"
#import "XPMineGuildEmptyTableViewCell.h"
@@ -120,7 +121,7 @@
cell = [[XPClanMemberTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPClanMemberTableViewCell class])];
}
cell.cellType = ClanMemberTableViewCellType_Manager_Set;
ClanMemberInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.memberInfo = memberInfo;
return cell;
}
@@ -140,7 +141,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
ClanMemberInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
XPMineGuildManagerPerViewController * managerAuthVC = [[XPMineGuildManagerPerViewController alloc] init];
managerAuthVC.guildId = self.guildId;
managerAuthVC.managerInfo = memberInfo;

View File

@@ -13,6 +13,7 @@
#import "NetImageView.h"
#import "XPMacro.h"
#import "AccountInfoStorage.h"
#import "NSArray+Safe.h"
///Model
#import "ClanDetailInfoModel.h"
///View
@@ -165,14 +166,14 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPClanRoomCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([ XPClanRoomCollectionViewCell class]) forIndexPath:indexPath];
cell.guildInfo = [self.clanRoomList objectAtIndex:indexPath.row];
cell.guildInfo = [self.clanRoomList safeObjectAtIndex1:indexPath.row];
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.clanRoomList.count > 0) {
GuildInfoModel * guildInfo = [self.clanRoomList objectAtIndex:indexPath.row];
GuildInfoModel * guildInfo = [self.clanRoomList safeObjectAtIndex1:indexPath.row];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGuildHeaderView:dicSelectGuild:)]) {
[self.delegate xPGuildHeaderView:self dicSelectGuild:guildInfo];
}

View File

@@ -7,7 +7,7 @@
#import "XPGuildTimeMonthPickerView.h"
#import "ThemeColor.h"
#import "NSArray+Safe.h"
extern NSString *const kDateFormatYYYYMMDD;
// Constants :
static NSString * const kSureButtonItemTitle = @"确定";
@@ -256,7 +256,7 @@ typedef NS_ENUM(NSInteger,ScrollViewTagValue) {
for (int i = 0; i < _days.count; i++) {
NSString *day = (NSString*)[_days objectAtIndex:i];
NSString *day = (NSString*)[_days safeObjectAtIndex1:i];
UILabel *labelDay = [[UILabel alloc] initWithFrame:CGRectMake(0, (i * kHooDatePickerScrollViewItemHeight) + offsetContentScrollView, _scrollViewDays.frame.size.width, kHooDatePickerScrollViewItemHeight)];
labelDay.text = day;
@@ -334,7 +334,7 @@ typedef NS_ENUM(NSInteger,ScrollViewTagValue) {
for (int i = 0; i < self.months.count; i++) {
NSString *day = (NSString*)[self.months objectAtIndex:i];
NSString *day = (NSString*)[self.months safeObjectAtIndex1:i];
UILabel *labelDay = [[UILabel alloc] initWithFrame:CGRectMake(0.0, (i * kHooDatePickerScrollViewItemHeight) + offsetContentScrollView, _scrollViewMonths.frame.size.width, kHooDatePickerScrollViewItemHeight)];
labelDay.text = day;
@@ -411,7 +411,7 @@ typedef NS_ENUM(NSInteger,ScrollViewTagValue) {
for (int i = 0; i < _years.count; i++) {
NSString *day = (NSString*)[_years objectAtIndex:i];
NSString *day = (NSString*)[_years safeObjectAtIndex1:i];
UILabel *labelDay = [[UILabel alloc] initWithFrame:CGRectMake(0.0, (i * kHooDatePickerScrollViewItemHeight) + offsetContentScrollView, _scrollViewYears.frame.size.width, kHooDatePickerScrollViewItemHeight)];
labelDay.text = day;
@@ -492,7 +492,7 @@ typedef NS_ENUM(NSInteger,ScrollViewTagValue) {
for (int i = 0; i < _dates.count; i++) {
NSDate *date = [_dates objectAtIndex:i];
NSDate *date = [_dates safeObjectAtIndex1:i];
NSString *hour = [dateFormatter stringFromDate:date];
@@ -570,7 +570,7 @@ typedef NS_ENUM(NSInteger,ScrollViewTagValue) {
for (int i = 0; i < self.hours.count; i++) {
NSString *hour = (NSString*)[self.hours objectAtIndex:i];
NSString *hour = (NSString*)[self.hours safeObjectAtIndex1:i];
UILabel *labelHour = [[UILabel alloc] initWithFrame:CGRectMake(0, (i * kHooDatePickerScrollViewItemHeight) + offsetContentScrollView, _scrollViewHours.frame.size.width, kHooDatePickerScrollViewItemHeight)];
labelHour.text = hour;
@@ -646,7 +646,7 @@ typedef NS_ENUM(NSInteger,ScrollViewTagValue) {
for (int i = 0; i < self.minutes.count; i++) {
NSString *minute = (NSString*)[self.minutes objectAtIndex:i];
NSString *minute = (NSString*)[self.minutes safeObjectAtIndex1:i];
UILabel *labelMinute = [[UILabel alloc] initWithFrame:CGRectMake(0, (i * kHooDatePickerScrollViewItemHeight) + offsetContentScrollView, _scrollViewMinutes.frame.size.width, kHooDatePickerScrollViewItemHeight)];
labelMinute.text = minute;
@@ -722,7 +722,7 @@ typedef NS_ENUM(NSInteger,ScrollViewTagValue) {
for (int i = 0; i < self.seconds.count; i++) {
NSString *second = (NSString*)[self.seconds objectAtIndex:i];
NSString *second = (NSString*)[self.seconds safeObjectAtIndex1:i];
UILabel *labelSecond = [[UILabel alloc] initWithFrame:CGRectMake(0, (i * kHooDatePickerScrollViewItemHeight) + offsetContentScrollView, _scrollViewSeconds.frame.size.width, kHooDatePickerScrollViewItemHeight)];
labelSecond.text = second;
@@ -1269,7 +1269,7 @@ typedef NS_ENUM(NSInteger,ScrollViewTagValue) {
if (index < 0) return;
for (int i = 0; i < labels.count; i++) {
UILabel *label = (UILabel *)[labels objectAtIndex:i];
UILabel *label = (UILabel *)[labels safeObjectAtIndex1:i];
if (i != index) {
label.textColor = self.tintColor;
label.font = kHooDatePickerLabelFont;

View File

@@ -13,6 +13,7 @@
#import "XPMacro.h"
#import "TTPopup.h"
#import "UIImage+Utils.h"
#import "NSArray+Safe.h"
///Model
#import "GuildRoomInfoModel.h"
///View
@@ -108,7 +109,7 @@
cell = [[XPGuildChooseManagerRoomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPGuildChooseManagerRoomTableViewCell class])];
}
cell.delegate = self;
GuildRoomInfoModel* roomInfo = [self.datasource objectAtIndex:indexPath.row];
GuildRoomInfoModel* roomInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.roomInfo = roomInfo;
if (roomInfo.hasManage) {
if (![self.chooseArray containsObject:roomInfo.hallRoomUid]) {

View File

@@ -13,6 +13,7 @@
#import "ThemeColor.h"
#import "XPMacro.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "GuildSuperAdminInfoModel.h"
///View
@@ -82,7 +83,7 @@
cell = [[XPGuildSuperAdminSetTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPGuildSuperAdminSetTableViewCell class])];
}
cell.delegate = self;
GuildSuperAdminInfoModel * info= [self.datasource objectAtIndex:indexPath.row];
GuildSuperAdminInfoModel * info= [self.datasource safeObjectAtIndex1:indexPath.row];
cell.managerInfo = info;
return cell;
}

View File

@@ -13,6 +13,7 @@
#import "XPMacro.h"
#import "ThemeColor.h"
#import "AccountInfoStorage.h"
#import "NSArray+Safe.h"
///Model
#import "ClanDetailInfoModel.h"
#import "ClanMemberDetailInfoModel.h"
@@ -150,7 +151,7 @@
cell = [[XPClanMemberTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPClanMemberTableViewCell class])];
}
cell.cellType = ClanMemberTableViewCellType_Normal;
ClanMemberInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.isLast = (self.datasource.count -1) == indexPath.row;
cell.memberInfo = memberInfo;
return cell;
@@ -189,7 +190,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
ClanMemberInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
userInfoVC.uid = memberInfo.uid.integerValue;
[self.navigationController pushViewController:userInfoVC animated:YES];

View File

@@ -12,6 +12,7 @@
#import "XPMacro.h"
#import "ThemeColor.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "ClanMemberDetailInfoModel.h"
#import "GuildSearchUserInfoModel.h"
@@ -97,7 +98,7 @@
cell = [[XPClanMemberTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPClanMemberTableViewCell class])];
}
cell.cellType = ClanMemberTableViewCellType_Normal;
ClanMemberInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.memberInfo = memberInfo;
return cell;
}else if(self.searchType == GuildSearchType_Guild_Add_Member) {
@@ -106,7 +107,7 @@
cell = [[XPMineGuildSearchMemberTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineGuildSearchMemberTableViewCell class])];
}
cell.delegate = self;
GuildSearchUserInfoModel * userInfo = [self.datasource objectAtIndex:indexPath.row];
GuildSearchUserInfoModel * userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.userInfo = userInfo;
return cell;
} else if(self.searchType == GuildSearchType_Clan_Add_Super_Admin) {
@@ -115,7 +116,7 @@
cell = [[XPGuildSearchSuperAdminTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPGuildSearchSuperAdminTableViewCell class])];
}
cell.delegate = self;
GuildSearchSuperAdminModel * userInfo = [self.datasource objectAtIndex:indexPath.row];
GuildSearchSuperAdminModel * userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.userInfo = userInfo;
return cell;
}
@@ -141,7 +142,7 @@
switch (self.searchType) {
case GuildSearchType_Clan_All_Member:
{
ClanMemberInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
userInfoVC.uid = memberInfo.uid.integerValue;
[((UINavigationController *)self.presentingViewController) pushViewController:userInfoVC animated:YES];
@@ -150,7 +151,7 @@
break;
case GuildSearchType_Guild_Add_Member:
{
GuildSearchUserInfoModel * userInfo = [self.datasource objectAtIndex:indexPath.row];
GuildSearchUserInfoModel * userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
userInfoVC.uid = userInfo.uid.integerValue;
[((UINavigationController *)self.presentingViewController) pushViewController:userInfoVC animated:YES];

View File

@@ -15,6 +15,7 @@
#import "NetImageView.h"
#import "AccountInfoStorage.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "ClanDetailInfoModel.h"
#import "ClanMemberDetailInfoModel.h"
@@ -281,7 +282,7 @@
cell = [[XPClanMemberTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPClanMemberTableViewCell class])];
}
cell.cellType = ClanMemberTableViewCellType_Normal;
ClanMemberInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.isLast = (self.datasource.count -1) == indexPath.row;
cell.memberInfo = memberInfo;
return cell;
@@ -319,7 +320,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
ClanMemberInfoModel * memberInfo = [self.datasource objectAtIndex:indexPath.row];
ClanMemberInfoModel * memberInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
userInfoVC.uid = memberInfo.uid.integerValue;
[self.navigationController pushViewController:userInfoVC animated:YES];

View File

@@ -13,6 +13,7 @@
#import "XPMacro.h"
#import "XPHtmlUrl.h"
#import "StatisticsServiceHelper.h"
#import "NSArray+Safe.h"
///Model
#import "XPMineItemModel.h"
///P

View File

@@ -9,6 +9,7 @@
///Third
#import <Masonry/Masonry.h>
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
@@ -70,7 +71,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPNoblePrivilegeCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass(XPNoblePrivilegeCell.class) forIndexPath:indexPath];
NobleAuthInfo *info = [self.vipAuthInfos objectAtIndex:indexPath.row];
NobleAuthInfo *info = [self.vipAuthInfos safeObjectAtIndex1:indexPath.row];
if ([self.vipInfo.ownAuthTypes containsObject:@(info.authType)]) {
cell.isOwn = YES;
}
@@ -79,7 +80,7 @@
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
NobleAuthInfo *info = [self.vipAuthInfos objectAtIndex:indexPath.row];
NobleAuthInfo *info = [self.vipAuthInfos safeObjectAtIndex1:indexPath.row];
XPNobleAuthorityDescView *alertView = [[XPNobleAuthorityDescView alloc] initWithFrame:CGRectMake(0, 0, 300, 286)];
alertView.vipInfo = info;
TTPopupService * config = [[TTPopupService alloc] init];

View File

@@ -14,6 +14,7 @@
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
#import "NSArray+Safe.h"
///Model
#import "NobleRankListModel.h"
@@ -154,7 +155,7 @@
- (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view {
XPNobleRankUpdateViewCell *myCell = (XPNobleRankUpdateViewCell *)cell;
NObleRankUserModel * info = [self.nobleList objectAtIndex:index];
NObleRankUserModel * info = [self.nobleList safeObjectAtIndex1:index];
myCell.userInfo = info;
}

View File

@@ -25,6 +25,7 @@
#import "XPHtmlUrl.h"
#import "TTPopup.h"
#import "StatisticsServiceHelper.h"
#import "NSArray+Safe.h"
///View
#import "XPNobleCenterListViewController.h"
#import "XPNobleCenterNavView.h"
@@ -198,7 +199,7 @@
NSInteger defaultSelectIndex = 0;
NobleInfo * currentAuth;
for (int index = 0; index < model.vipInfos.count; index++) {
NobleInfo *tagInfo = [model.vipInfos objectAtIndex:index];
NobleInfo *tagInfo = [model.vipInfos safeObjectAtIndex1:index];
[names addObject:tagInfo.vipName];
if (tagInfo.vipLevel == model.currLevel) {
defaultSelectIndex = index;
@@ -321,7 +322,7 @@
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
XPNobleCenterListViewController *VC = [[XPNobleCenterListViewController alloc] init];
VC.isOpenNoble = self.userInfo.userVipInfoVO.vipLevel;
NobleInfo *vipInfo = [self.model.vipInfos objectAtIndex:index];
NobleInfo *vipInfo = [self.model.vipInfos safeObjectAtIndex1:index];
VC.vipInfo = vipInfo;
if (vipInfo.comingSoon != 2) {
VC.vipAuthInfos = self.model.vipAuthInfos;
@@ -381,7 +382,7 @@
#pragma mark - events
- (void)onOpenNobleButtonClick:(UITapGestureRecognizer *)button {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventVipOpenClick];
RechargeListModel *rechargeModel = [self.rechargeModel.list objectAtIndex:0];
RechargeListModel *rechargeModel = [self.rechargeModel.list safeObjectAtIndex1:0];
[self showLoading];
[self.presenter requestNobleIAPRechargeOrderWithChargeProdId:rechargeModel.chargeProdId roomUid:self.roomUid ? [NSString stringWithFormat:@"%zd", self.roomUid] : nil];
}

View File

@@ -11,6 +11,7 @@
#import <NIMSDK/NIMSDK.h>
#import "XPMineBlackListTableViewCell.h"
#import "XPMineFriendEmptyTableViewCell.h"
#import "NSArray+Safe.h"
///Model
#import "UserInfoModel.h"
///P
@@ -36,7 +37,7 @@
if (array.count > 0) {
NSMutableArray * uids = [NSMutableArray array];
for (int i = 0; i< array.count; i++) {
NIMUser * user = [array objectAtIndex:i];
NIMUser * user = [array safeObjectAtIndex1:i];
[uids addObject:user.userId];
}
[self.presenter getUserListInfo:uids];
@@ -68,7 +69,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPMineBlackListTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineBlackListTableViewCell class])];
cell.userInfo = [self.datasource objectAtIndex:indexPath.row];
cell.userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
return cell;
}
XPMineFriendEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineFriendEmptyTableViewCell class])];
@@ -89,7 +90,7 @@
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
if (editingStyle ==UITableViewCellEditingStyleDelete){
if (self.datasource.count > 0) {
UserInfoModel *userInfo = [self.datasource objectAtIndex:indexPath.row];
UserInfoModel *userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
[[NIMSDK sharedSDK].userManager removeFromBlackBlackList:[NSString stringWithFormat:@"%ld", userInfo.uid] completion:^(NSError * _Nullable error) {
if (error == nil) {
[self.datasource removeObject:userInfo];

View File

@@ -12,6 +12,7 @@
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "XPMineNotificationItemModel.h"
///View
@@ -83,7 +84,7 @@
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
XPMineNotificationItemModel *item = [self.dataModelArray objectAtIndex:indexPath.row];
XPMineNotificationItemModel *item = [self.dataModelArray safeObjectAtIndex1:indexPath.row];
XPMineNotificationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineNotificationTableViewCell class]) forIndexPath:indexPath];
cell.delegate = self;
cell.itemModel = item;

View File

@@ -14,6 +14,7 @@
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
#import "XPHtmlUrl.h"
///Model
#import "XPMineSettingItemModel.h"
@@ -225,8 +226,8 @@
if (cell == nil) {
cell = [[XPMineSettingTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineSettingTableViewCell class])];
}
NSArray * array = [self.datasource objectAtIndex:indexPath.section];
XPMineSettingItemModel * model = [array objectAtIndex:indexPath.row];
NSArray * array = [self.datasource safeObjectAtIndex1:indexPath.section];
XPMineSettingItemModel * model = [array safeObjectAtIndex1:indexPath.row];
cell.itemModel = model;
return cell;
}
@@ -260,7 +261,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
XPMineSettingItemModel * model = [[self.datasource objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
XPMineSettingItemModel * model = [[self.datasource safeObjectAtIndex1:indexPath.section] safeObjectAtIndex1:indexPath.row];
[self pushViewControllerWithType:model.type];
}
}

View File

@@ -13,6 +13,7 @@
#import "NetImageView.h"
#import "XPMacro.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
//View
#import "XPSkillCardListPropCell.h"
#import "XPSkillCardSelectPropView.h"
@@ -111,7 +112,7 @@
cell = [[XPSkillCardListPropCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPSkillCardListPropCell class])];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.model = [self.dataArray objectAtIndex:indexPath.row];
cell.model = [self.dataArray safeObjectAtIndex1:indexPath.row];
cell.isLast = self.dataArray.count == indexPath.row + 1;
return cell;
}
@@ -125,7 +126,7 @@
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
XPSkillCardRecordPropModel *item = [self.dataArray objectAtIndex:indexPath.row];
XPSkillCardRecordPropModel *item = [self.dataArray safeObjectAtIndex1:indexPath.row];
return [self layoutCellHeightWithItem:item];
}

View File

@@ -12,6 +12,7 @@
#import "ThemeColor.h"
#import "UIImage+Utils.h"
#import "XCHUDTool.h"
#import "NSArray+Safe.h"
// View
#import "XPSkillCardSelectPropCell.h"
// Model
@@ -79,7 +80,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPSkillCardSelectPropCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPSkillCardSelectPropCell class]) forIndexPath:indexPath];
XPSkillCardSourcePropDetailModel * item = [self.sourceArray objectAtIndex:indexPath.row];
XPSkillCardSourcePropDetailModel * item = [self.sourceArray safeObjectAtIndex1:indexPath.row];
cell.model = item;
cell.isSelected = [self.selectPropNameArray containsObject:item.propVal];
return cell;
@@ -87,7 +88,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
XPSkillCardSourcePropDetailModel *item = [self.sourceArray objectAtIndex:indexPath.row];
XPSkillCardSourcePropDetailModel *item = [self.sourceArray safeObjectAtIndex1:indexPath.row];
if ([self.selectPropNameArray containsObject:item.propVal]) {///
[self.selectPropNameArray removeObject:item.propVal];
NSInteger index = 0;

View File

@@ -10,6 +10,7 @@
#import <Masonry/Masonry.h>
#import "XPMacro.h"
#import "ThemeColor.h"
#import "NSArray+Safe.h"
// View
#import "XPSkillCardTypeCollectionViewCell.h"
@@ -55,7 +56,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPSkillCardTypeCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPSkillCardTypeCollectionViewCell class]) forIndexPath:indexPath];
XPSkillCardTypeModel * item = [self.array objectAtIndex:indexPath.row];
XPSkillCardTypeModel * item = [self.array safeObjectAtIndex1:indexPath.row];
cell.itemModel = item;
return cell;
}
@@ -63,7 +64,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPSkillCardTypeViewDidSelectItem:)]) {
XPSkillCardTypeModel * model = [self.array objectAtIndex:indexPath.row];
XPSkillCardTypeModel * model = [self.array safeObjectAtIndex1:indexPath.row];
[self.delegate xPSkillCardTypeViewDidSelectItem:model];
}
}

View File

@@ -26,6 +26,7 @@
#import "ThemeColor.h"
#import "UIImage+Utils.h"
#import "NetImageView.h"
#import "NSArray+Safe.h"
@interface XPSkillCardEditViewController ()
<
@@ -242,7 +243,7 @@ XPMineCustomNavViewDelegate
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.defaultModel = self.model;
cell.model = [self.propArray objectAtIndex:indexPath.row];
cell.model = [self.propArray safeObjectAtIndex1:indexPath.row];
cell.isLast = (self.propArray.count == indexPath.row + 1);
cell.delegate = self;
return cell;
@@ -262,8 +263,8 @@ XPMineCustomNavViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.tableView endEditing:YES];
XPSkillCardResourcePropModel *sourceProp = [self.model.props objectAtIndex:indexPath.row];
XPSkillCardPropModel *editProp = [self.propArray objectAtIndex:indexPath.row];
XPSkillCardResourcePropModel *sourceProp = [self.model.props safeObjectAtIndex1:indexPath.row];
XPSkillCardPropModel *editProp = [self.propArray safeObjectAtIndex1:indexPath.row];
if (editProp.state == 0 || editProp.state == 2) { //\
[self showSkillListWithSourceProps:sourceProp.propDictVos propModel:editProp selectArray:editProp.refPropVos editIndex:indexPath.row];
}
@@ -287,14 +288,14 @@ XPMineCustomNavViewDelegate
#pragma mark - XPSkillCardEditPropCellDelegate
- (void)xPSkillCardPropCellPropValChange:(XPSkillCardEditPropCell *)cell selectArray:(NSArray *)selectArray {
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
XPSkillCardPropModel *model = [self.propArray objectAtIndex:indexPath.row];
XPSkillCardPropModel *model = [self.propArray safeObjectAtIndex1:indexPath.row];
model.refPropVos = [NSMutableArray arrayWithArray:selectArray];
}
#pragma mark - XPSkillCardSelectPropViewDelegate
- (void)xPSkillCardSelectPropViewCompleteSelect:(NSArray *)selectArray editIndex:(NSInteger)editIndex {
[TTPopup dismiss];
XPSkillCardPropModel *model = [self.propArray objectAtIndex:editIndex];
XPSkillCardPropModel *model = [self.propArray safeObjectAtIndex1:editIndex];
model.refPropVos = [NSMutableArray arrayWithArray:selectArray];
[self.tableView reloadData];
}
@@ -311,7 +312,7 @@ XPMineCustomNavViewDelegate
for (int i = 0; i<self.propArray.count; i++) {
NSMutableArray *propDetailArray = [NSMutableArray array];
XPSkillCardUpdatePropModel *item = [[XPSkillCardUpdatePropModel alloc] init];
XPSkillCardPropModel * proModel = [self.propArray objectAtIndex:i];
XPSkillCardPropModel * proModel = [self.propArray safeObjectAtIndex1:i];
if (proModel.refPropVos.count) {
for (XPSkillCardSourcePropDetailModel *editItem in proModel.refPropVos) {
XPSkillCardUpdatePropDetailModel *detailItem = [[XPSkillCardUpdatePropDetailModel alloc] init];

View File

@@ -24,6 +24,7 @@
#import "TTPopup.h"
#import "ThemeColor.h"
#import "XPSkillCardPlayerManager.h"
#import "NSArray+Safe.h"
@interface XPSkillCardViewController ()
<UITableViewDelegate,
@@ -145,7 +146,7 @@ XPSkillCardListCellDelegate
cell = [[XPSkillCardListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPSkillCardListCell class])];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
XPSkillCardModel * item = [self.dataSource objectAtIndex:indexPath.row];
XPSkillCardModel * item = [self.dataSource safeObjectAtIndex1:indexPath.row];
item.isGuestPage = self.uid != [AccountInfoStorage instance].getUid.integerValue;
cell.model = item;
cell.delegate = self;
@@ -161,7 +162,7 @@ XPSkillCardListCellDelegate
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
XPSkillCardModel * item = [self.dataSource objectAtIndex:indexPath.row];
XPSkillCardModel * item = [self.dataSource safeObjectAtIndex1:indexPath.row];
return [self layoutCellHeightWithItem:item];
}
@@ -195,7 +196,7 @@ XPSkillCardListCellDelegate
///
- (void)xPSkillCardListCellEditButtonClick:(XPSkillCardListCell *)cell {
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
XPSkillCardModel * item = [self.dataSource objectAtIndex:indexPath.row];
XPSkillCardModel * item = [self.dataSource safeObjectAtIndex1:indexPath.row];
XPSkillCardEditViewController *vc = [[XPSkillCardEditViewController alloc] init];
vc.cardId = item.cardId;
vc.cardRecordId = item.cardRecordId;
@@ -205,7 +206,7 @@ XPSkillCardListCellDelegate
///
- (void)xPSkillCardListCellDeleteVoiceButtonClick:(XPSkillCardListCell *)cell {
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
XPSkillCardModel * item = [self.dataSource objectAtIndex:indexPath.row];
XPSkillCardModel * item = [self.dataSource safeObjectAtIndex1:indexPath.row];
[TTPopup alertWithMessage:@"确定要删除该声音吗?" confirmHandler:^{
[self.presenter deleteSkillCard:[NSString stringWithFormat:@"%zd", item.cardRecordId]];
} cancelHandler:^{
@@ -222,7 +223,7 @@ XPSkillCardListCellDelegate
[TTPopup alertWithConfig:config confirmHandler:^{
@kStrongify(self);
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
XPSkillCardModel * item = [self.dataSource objectAtIndex:indexPath.row];
XPSkillCardModel * item = [self.dataSource safeObjectAtIndex1:indexPath.row];
XPVoiceCardViewController *vc = [[XPVoiceCardViewController alloc] init];
vc.cardId = item.cardId;
vc.cardRecordId = item.cardRecordId;
@@ -235,7 +236,7 @@ XPSkillCardListCellDelegate
- (void)xPSkillCardListCellPlayButtonClick:(XPSkillCardListCell *)cell button:(UIButton *)button {
self.playButton = button;
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
XPSkillCardModel * item = [self.dataSource objectAtIndex:indexPath.row];
XPSkillCardModel * item = [self.dataSource safeObjectAtIndex1:indexPath.row];
if (!self.isPlaying) {
if(item.propRecordVo.count) {
XPSkillCardRecordPropModel *voiceItem = item.propRecordVo[0];

View File

@@ -21,6 +21,7 @@
#import "XPVoiceCardCircleLayer.h"
#import "AccountInfoStorage.h"
#import "YYUtility.h"
#import "NSArray+Safe.h"
///View
#import "XPMineUserInfoCustomNavView.h"
///Model
@@ -183,7 +184,7 @@
self.fileName = [NSString stringWithFormat:@"voiceShow_%@_%@.wav", [AccountInfoStorage instance].getUid, date];
NSFileManager *fileMgr = [[NSFileManager alloc] init];
//
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"voiceShow"];
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"voiceShow"];
self.totalFilePath = [filePath stringByAppendingPathComponent:self.fileName];
if(![fileMgr fileExistsAtPath:filePath]){//,
@@ -289,7 +290,7 @@
NSMutableArray *propDetailArray = [NSMutableArray array];
XPSkillCardUpdatePropModel *item = [[XPSkillCardUpdatePropModel alloc] init];
XPSkillCardUpdatePropDetailModel *detailItem = [[XPSkillCardUpdatePropDetailModel alloc] init];
XPSkillCardRecordPropModel * proModel = [self.propArray objectAtIndex:i];
XPSkillCardRecordPropModel * proModel = [self.propArray safeObjectAtIndex1:i];
item.parentId = proModel.propId;
detailItem.propId = proModel.propId;
if (proModel.state == 3) { ///
@@ -306,7 +307,7 @@
NSMutableArray *propDetailArray = [NSMutableArray array];
XPSkillCardUpdatePropModel *item = [[XPSkillCardUpdatePropModel alloc] init];
XPSkillCardUpdatePropDetailModel *detailItem = [[XPSkillCardUpdatePropDetailModel alloc] init];
XPSkillCardPropModel * proModel = [self.propArray objectAtIndex:i];
XPSkillCardPropModel * proModel = [self.propArray safeObjectAtIndex1:i];
item.parentId = proModel.propId;
detailItem.propId = proModel.propId;
if (proModel.state == 3) { ///

View File

@@ -13,6 +13,7 @@
#import "RoomFaceInfoModel.h"
#import "UserInfoModel.h"
#import "XPRoomFaceProtocol.h"
#import "NSArray+Safe.h"
@implementation XPRoomFacePresenter
@@ -33,7 +34,7 @@
NSString * faceFile = [XPRoomFaceTool shareFaceTool].faceDirectory;
NSMutableArray * faceArray = [NSMutableArray array];
for (int i = 0; i< sortArray.count; i++) {
RoomFaceInfoModel * faceInfo = [sortArray objectAtIndex:i];
RoomFaceInfoModel * faceInfo = [sortArray safeObjectAtIndex1:i];
if (!faceInfo.isNobleFace && faceInfo.faceType == 1) {
NSString *faceName = [NSString stringWithFormat:@"%@_%ld_%ld",faceInfo.pinyin,faceInfo.fid,faceInfo.iconPos];
NSString *dirName = [NSString stringWithFormat:@"%@_%ld",faceInfo.pinyin,faceInfo.fid];
@@ -57,7 +58,7 @@
NSString * faceFile = [XPRoomFaceTool shareFaceTool].faceDirectory;
NSMutableArray * faceArray = [NSMutableArray array];
for (int i = 0; i< sortArray.count; i++) {
RoomFaceInfoModel * faceInfo = [sortArray objectAtIndex:i];
RoomFaceInfoModel * faceInfo = [sortArray safeObjectAtIndex1:i];
if (faceInfo.faceType == 1) {
NSString *faceName = [NSString stringWithFormat:@"%@_%ld_%ld",faceInfo.pinyin,faceInfo.fid,faceInfo.iconPos];
NSString *dirName = [NSString stringWithFormat:@"%@_%ld",faceInfo.pinyin,faceInfo.fid];

View File

@@ -11,6 +11,7 @@
#import <CommonCrypto/CommonDigest.h>
#import "NSObject+MJExtension.h"
#import "RoomFaceInfoModel.h"
#import "NSArray+Safe.h"
#define FileHashDefaultChunkSizeForReadingData 1024*8 // 8K
NSString * const kRoomFaceVersion = @"kRoomFaceVersion";
@@ -43,7 +44,7 @@ NSString * const kRoomFaceVersion = @"kRoomFaceVersion";
- (void)downFaceDataCompletion:(nullable void (^)(NSString * nullable))completion {
//doucument
NSArray*pathsss =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *documentsDirectory = [pathsss objectAtIndex:0];
NSString *documentsDirectory = [pathsss safeObjectAtIndex1:0];
NSString*faceDirectory = [documentsDirectory stringByAppendingPathComponent:@"Face"];
///
NSString *version = [[NSUserDefaults standardUserDefaults]objectForKey: kRoomFaceVersion];

View File

@@ -13,6 +13,7 @@
#import "ThemeColor.h"
#import "XPRoomFaceTool.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "RoomFaceTitleItemModel.h"
#import "RoomFaceInfoModel.h"
@@ -241,7 +242,7 @@
#pragma mark - UICollectionViewDelegate And UICollectionViewDatasource
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
if (collectionView == self.titleCollectionView) {
RoomFaceTitleItemModel * itemModel = [self.titleList objectAtIndex:indexPath.row];
RoomFaceTitleItemModel * itemModel = [self.titleList safeObjectAtIndex1:indexPath.row];
CGSize size = [itemModel.title boundingRectWithSize:CGSizeMake(100, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine
attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} context:nil].size;
return CGSizeMake(size.width + 10, size.height);
@@ -260,7 +261,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
if (collectionView == self.titleCollectionView) {
XPRoomFaceTitleCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPRoomFaceTitleCollectionViewCell class]) forIndexPath:indexPath];
RoomFaceTitleItemModel * model = [self.titleList objectAtIndex:indexPath.item];
RoomFaceTitleItemModel * model = [self.titleList safeObjectAtIndex1:indexPath.item];
if (model == self.selectTitleItem) {
model.isSelect = YES;
} else {
@@ -273,9 +274,9 @@
XPRoomFaceCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPRoomFaceCollectionViewCell class]) forIndexPath:indexPath];
RoomFaceInfoModel * faceInfo;
if (self.selectTitleItem.faceType == RoomFaceTitleItemType_Normal) {
faceInfo = [self.faceList objectAtIndex:indexPath.row];
faceInfo = [self.faceList safeObjectAtIndex1:indexPath.row];
} else {
faceInfo = [self.nobelFaceList objectAtIndex:indexPath.row];
faceInfo = [self.nobelFaceList safeObjectAtIndex1:indexPath.row];
}
cell.vipLevel = self.userInfo.userVipInfoVO.vipLevel;
cell.faceInfo =faceInfo;
@@ -284,7 +285,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (collectionView == self.titleCollectionView) {
RoomFaceTitleItemModel * titleModel = [self.titleList objectAtIndex:indexPath.row];
RoomFaceTitleItemModel * titleModel = [self.titleList safeObjectAtIndex1:indexPath.row];
self.selectTitleItem = titleModel;
[self.titleCollectionView reloadData];
NSArray * list = titleModel.faceType == RoomFaceTitleItemType_Normal ? self.faceList : self.nobelFaceList;
@@ -292,11 +293,11 @@
[self.faceCollectionView reloadData];
} else {
if (self.selectTitleItem.faceType == RoomFaceTitleItemType_Normal) {
RoomFaceInfoModel * faceInfo = [self.faceList objectAtIndex:indexPath.row];
RoomFaceInfoModel * faceInfo = [self.faceList safeObjectAtIndex1:indexPath.row];
[self sendFaceCustomMessage:faceInfo];
} else {
if (indexPath.row < self.nobelFaceList.count) {
RoomFaceInfoModel * faceInfo = [self.nobelFaceList objectAtIndex:indexPath.row];
RoomFaceInfoModel * faceInfo = [self.nobelFaceList safeObjectAtIndex1:indexPath.row];
if (faceInfo.faceVipInfo.vipLevel > self.userInfo.userVipInfoVO.vipLevel) {
TTAlertConfig *config = [[TTAlertConfig alloc] init];
config.message = [NSString stringWithFormat:@"尚未达到发送%@所需贵族等级,\n 所需贵族等级:%@", faceInfo.name,faceInfo.faceVipInfo.vipName];

View File

@@ -8,7 +8,7 @@
#import "XPGiftStorage.h"
#import "GiftInfoModel.h"
#import "NSObject+MJExtension.h"
#import "NSArray+Safe.h"
@interface XPGiftStorage ()
///key:id value:
@property (nonatomic, strong) NSCache<NSString *, NSArray<GiftInfoModel *> *> *roomGiftCache;
@@ -97,7 +97,7 @@
[fileManager createDirectoryAtPath:giftDirPath withIntermediateDirectories:YES attributes:nil error:nil];
}
for (int i = 0; i< array.count; i++) {
GiftInfoModel * giftInfoModel = [array objectAtIndex:i];
GiftInfoModel * giftInfoModel = [array safeObjectAtIndex1:i];
NSString *giftPath = [giftDirPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%ld", giftInfoModel.giftId]];
[NSKeyedArchiver archiveRootObject:giftInfoModel.model2dictionary toFile:giftPath];
}

View File

@@ -14,6 +14,7 @@
#import "XPMacro.h"
#import "ThemeColor+SendGift.h"
#import "XPGiftCollectionViewFlowLayout.h"
#import "NSArray+Safe.h"
///Model
#import "GiftInfoModel.h"
///View
@@ -71,7 +72,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPGiftItemCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPGiftItemCollectionViewCell class]) forIndexPath:indexPath];
GiftInfoModel * giftInfo;
giftInfo= [self.weekStarGiftList objectAtIndex:indexPath.item];
giftInfo= [self.weekStarGiftList safeObjectAtIndex1:indexPath.item];
if (giftInfo.giftId == self.selectGiftInfo.giftId) {
giftInfo.isSelected = YES;
} else {
@@ -84,7 +85,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.weekStarGiftList.count > 0) {
GiftInfoModel * giftInfo= [self.weekStarGiftList objectAtIndex:indexPath.item];
GiftInfoModel * giftInfo= [self.weekStarGiftList safeObjectAtIndex1:indexPath.item];
self.selectGiftInfo = giftInfo;
[self.collectionView reloadData];

View File

@@ -8,6 +8,7 @@
#import "XPGiftCountView.h"
///Third
#import <Masonry/Masonry.h>
#import "NSArray+Safe.h"
///Model
#import "XPGiftCountModel.h"
///View
@@ -106,7 +107,7 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPGiftCountCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPGiftCountCollectionViewCell class]) forIndexPath:indexPath];
XPGiftCountModel *countItem = [self.giftCountArray objectAtIndex:indexPath.item];
XPGiftCountModel *countItem = [self.giftCountArray safeObjectAtIndex1:indexPath.item];
cell.countModel = countItem;
return cell;
}
@@ -114,7 +115,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftCountView:didClickItem:)]) {
XPGiftCountModel *countItem = [self.giftCountArray objectAtIndex:indexPath.item];
XPGiftCountModel *countItem = [self.giftCountArray safeObjectAtIndex1:indexPath.item];
[self.delegate xPGiftCountView:self didClickItem:countItem];
}
}
@@ -128,7 +129,7 @@
}
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftCountView:didClickItem:)]) {
XPGiftCountModel *countItem = [self.giftCountArray objectAtIndex:0];
XPGiftCountModel *countItem = [self.giftCountArray safeObjectAtIndex1:0];
[self.delegate xPGiftCountView:self didClickItem:countItem];
}

View File

@@ -12,6 +12,7 @@
#import "XPMacro.h"
#import "XPHtmlUrl.h"
#import "ThemeColor+SendGift.h"
#import "NSArray+Safe.h"
///Model
#import "GiftInfoModel.h"
#import "GiftReceiveInfoModel.h"
@@ -252,7 +253,7 @@
// id
- (GiftInfoModel *)findGiftInfoByGiftId:(NSInteger)giftId {
for (int i=0; i<self.datasource.count ; i++) {
GiftInfoModel *giftInfo = [self.datasource objectAtIndex:i];
GiftInfoModel *giftInfo = [self.datasource safeObjectAtIndex1:i];
if (giftInfo.giftId == giftId) {
return giftInfo;
}
@@ -313,7 +314,7 @@
XPGiftItemCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPGiftItemCollectionViewCell class]) forIndexPath:indexPath];
GiftInfoModel * giftInfo;
giftInfo= [self.datasource objectAtIndex:indexPath.item];
giftInfo= [self.datasource safeObjectAtIndex1:indexPath.item];
cell.curUserNobleLevel = self.curUserNobleLevel;
cell.giftInfo = giftInfo;
return cell;
@@ -323,7 +324,7 @@
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
[self resetSelectGift:self.datasource];
GiftInfoModel * giftInfo= [self.datasource objectAtIndex:indexPath.item];
GiftInfoModel * giftInfo= [self.datasource safeObjectAtIndex1:indexPath.item];
[self dealSelectGift:giftInfo];
[self.giftcollectionView reloadData];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoView:didClickItem:type:)]) {
@@ -396,7 +397,7 @@
if (self.datasource.count > 0) {
if (self.defaultSelectGiftId.length && (self.segmentType == GiftSegmentType_Normal | self.segmentType == GiftSegmentType_Pack)) {
for (int i = 0 ; i <self.datasource.count; i++) {
GiftInfoModel * gift = [self.datasource objectAtIndex:i];
GiftInfoModel * gift = [self.datasource safeObjectAtIndex1:i];
if (gift.giftId == [self.defaultSelectGiftId integerValue]) {
[self dealSelectGift:gift];
self.selectIndex = [self.datasource indexOfObject:gift];

View File

@@ -12,6 +12,7 @@
#import <YYText.h>
///Tool
#import "ThemeColor.h"
#import "NSArray+Safe.h"
///Model
#import "GiftLuckyBroadcastModel.h"
@@ -151,7 +152,7 @@
- (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view {
XPGiftLuckyGiftBroadcastCell *myCell = (XPGiftLuckyGiftBroadcastCell *)cell;
GiftLuckyBroadcastModel * info = [self.records objectAtIndex:index];
GiftLuckyBroadcastModel * info = [self.records safeObjectAtIndex1:index];
myCell.giftInfo = info;
}

View File

@@ -13,6 +13,7 @@
#import "NetImageView.h"
#import "ThemeColor.h"
#import "UIImage+Utils.h"
#import "NSArray+Safe.h"
///Model
#import "UserInfoModel.h"
#import "XPGiftUserInfoModel.h"
@@ -127,7 +128,7 @@
}];
for (int i = 0; i < newArray.count; i++) {
XPGiftUserInfoModel * userInfo = [newArray objectAtIndex:i];
XPGiftUserInfoModel * userInfo = [newArray safeObjectAtIndex1:i];
if (userInfo && userInfo.uid > 0 && userInfo.uid != uid.integerValue) { ///
NSString * uid = [NSString stringWithFormat:@"%ld", userInfo.uid];
if (userInfo.isSelect) {
@@ -162,14 +163,14 @@
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPGiftUserCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPGiftUserCollectionViewCell class]) forIndexPath:indexPath];
XPGiftUserInfoModel * queue = [self.userArray objectAtIndex:indexPath.row];
XPGiftUserInfoModel * queue = [self.userArray safeObjectAtIndex1:indexPath.row];
cell.userInfo = queue;
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
XPGiftUserInfoModel * queue = [self.userArray objectAtIndex:indexPath.row];
XPGiftUserInfoModel * queue = [self.userArray safeObjectAtIndex1:indexPath.row];
queue.isSelect = !queue.isSelect;
[self.collectionView reloadData];
NSString * selectUid = [NSString stringWithFormat:@"%ld", queue.uid];

View File

@@ -18,6 +18,7 @@
#import "StatisticsServiceHelper.h"
#import "XPHtmlUrl.h"
#import "AccountInfoStorage.h"
#import "NSArray+Safe.h"
///Model
#import "GiftInfoModel.h"
#import "XPGiftCountModel.h"
@@ -180,7 +181,7 @@
AttachmentModel * attachment = [[AttachmentModel alloc] init];
attachment.first = CustomMessageType_AllMicroSend;
attachment.second = Custom_Message_Sub_AllMicroLuckySend;
NSDictionary * obj = [luckyBagGifts objectAtIndex:i];
NSDictionary * obj = [luckyBagGifts safeObjectAtIndex1:i];
[data1 setObject:i == 0 ? @(YES):@(NO) forKey:@"isShowAnimation"];
[data1 setObject:obj forKey:@"luckyGiftList"];
[data1 setObject:receiveModel.gift.giftName forKey:@"giftName"];

View File

@@ -16,6 +16,7 @@
#import "NSString+Utils.h"
#import "QEmotionHelper.h"
#import "AccountInfoStorage.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsCommentModel.h"
///View
@@ -136,7 +137,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
MonentsReplyModel * replayinfo = [self.datasource objectAtIndex:indexPath.row];
MonentsReplyModel * replayinfo = [self.datasource safeObjectAtIndex1:indexPath.row];
return replayinfo.replyRowHeight;
}
return 44;
@@ -145,7 +146,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
XPMonentsReplyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsReplyTableViewCell class])];
cell.replyInfo = [self.datasource objectAtIndex:indexPath.row];
cell.replyInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.delegate = self;
return cell;
}
@@ -158,7 +159,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (indexPath.section == 0 && self.datasource.count > 0) {
MonentsReplyModel * replyInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsReplyModel * replyInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
if (replyInfo.uid.integerValue != [AccountInfoStorage instance].getUid.integerValue && self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsCommentTableViewCell:didClickCommon:)]) {
[self.delegate xPMonentsCommentTableViewCell:self didClickCommon:replyInfo];
}

View File

@@ -15,6 +15,7 @@
#import "XPMonentsLayoutConfig.h"
#import "SDPhotoBrowser.h"
#import "XCCurrentVCStackManager.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsInfoModel.h"
///View
@@ -140,7 +141,7 @@
#pragma mark - SDPhotoBrowserDelegate
- (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index {
MonentsPicInfoModel *picinfo = [self.monentsInfo.dynamicResList objectAtIndex:index];
MonentsPicInfoModel *picinfo = [self.monentsInfo.dynamicResList safeObjectAtIndex1:index];
return [NSURL URLWithString:picinfo.resUrl];
}

View File

@@ -17,6 +17,7 @@
#import "AccountInfoStorage.h"
#import "MonentsTopicModel.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
@interface XPMoentsTopicListTableViewCell : UITableViewCell
///
@@ -216,7 +217,7 @@
if (cell == nil) {
cell = [[XPMoentsTopicListTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMoentsTopicListTableViewCell class])];
}
cell.topicInfo = [self.datasource objectAtIndex:indexPath.row];
cell.topicInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
return cell;
}
@@ -227,7 +228,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
MonentsTopicModel * infor = [self.datasource objectAtIndex:indexPath.row];
MonentsTopicModel * infor = [self.datasource safeObjectAtIndex1:indexPath.row];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMoentsTopicListView:didSelectItem:)]) {
[self.delegate xPMoentsTopicListView:self didSelectItem:infor];
}

View File

@@ -12,6 +12,7 @@
#import "ThemeColor.h"
#import "NetImageView.h"
#import "XPMonentsLayoutConfig.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsInfoModel.h"
@@ -88,7 +89,7 @@
make.size.mas_equalTo(CGSizeMake(kMONENTS_PIC_ONE_WIDTH, kMONENTS_PIC_ONE_WIDTH));
make.left.top.mas_equalTo(self);
}];
MonentsPicInfoModel * picInfo = [_dynamicResList objectAtIndex:0];
MonentsPicInfoModel * picInfo = [_dynamicResList safeObjectAtIndex1:0];
self.firstImageView.imageUrl = picInfo.resUrl;
} else if(_dynamicResList.count == 2) {
self.firstImageView.hidden = NO;
@@ -98,7 +99,7 @@
make.left.top.mas_equalTo(self);
}];
MonentsPicInfoModel * picInfo = [_dynamicResList objectAtIndex:0];
MonentsPicInfoModel * picInfo = [_dynamicResList safeObjectAtIndex1:0];
self.firstImageView.imageUrl = picInfo.resUrl;
self.secondImageView.hidden = NO;
@@ -108,14 +109,14 @@
make.left.mas_equalTo(self.firstImageView.mas_right).offset(kMONENTS_PIC_SPACE);
}];
MonentsPicInfoModel * secondPicInfo = [_dynamicResList objectAtIndex:1];
MonentsPicInfoModel * secondPicInfo = [_dynamicResList safeObjectAtIndex1:1];
self.secondImageView.imageUrl = secondPicInfo.resUrl;
} else{
for (int i = 0; i < _dynamicResList.count; i++) {
MonentsPicInfoModel * picInfo = [_dynamicResList objectAtIndex:i];
MonentsPicInfoModel * picInfo = [_dynamicResList safeObjectAtIndex1:i];
if (i < self.subViewArray.count) {
NetImageView * imageView = [self.subViewArray objectAtIndex:i];
NetImageView * imageView = [self.subViewArray safeObjectAtIndex1:i];
imageView.hidden = NO;
imageView.imageUrl = picInfo.resUrl;
}
@@ -125,7 +126,7 @@
for (int i = 0; i < self.subViewArray.count; i++) {
NSInteger page = i % 3;
NSInteger line = i / 3;
NetImageView * imageView = [self.subViewArray objectAtIndex:i];
NetImageView * imageView = [self.subViewArray safeObjectAtIndex1:i];
[imageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(itemWidth, itemWidth));
make.left.mas_equalTo(page * (itemWidth + kMONENTS_PIC_SPACE));

View File

@@ -10,6 +10,7 @@
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsTopicModel.h"
///View
@@ -69,21 +70,21 @@
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
MonentsTopicModel * topicModel = [self.topicList objectAtIndex:indexPath.row];
MonentsTopicModel * topicModel = [self.topicList safeObjectAtIndex1:indexPath.row];
CGFloat itemWidth = [topicModel.name boundingRectWithSize:CGSizeMake(100, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingTruncatesLastVisibleLine attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightBold]} context:nil].size.width;
return CGSizeMake(itemWidth +34, 26);
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPMonentsTopicCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMonentsTopicCollectionViewCell class]) forIndexPath:indexPath];
cell.topicInfo = [self.topicList objectAtIndex:indexPath.row];
cell.topicInfo = [self.topicList safeObjectAtIndex1:indexPath.row];
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.topicList.count > 0) {
MonentsTopicModel * topicInfo = [self.topicList objectAtIndex:indexPath.row];
MonentsTopicModel * topicInfo = [self.topicList safeObjectAtIndex1:indexPath.row];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsRecommendHeaderView:didSelectItem:)]) {
[self.delegate xPMonentsRecommendHeaderView:self didSelectItem:topicInfo];
}

View File

@@ -15,6 +15,7 @@
#import "XPMacro.h"
///Model
#import "MonentsInfoModel.h"
#import "NSArray+Safe.h"
@interface XPMonentsUserInfoView ()
///
@@ -250,9 +251,9 @@
self.secondTagImageView.hidden = YES;
self.thirdTagImageView.hidden = YES;
for (int i = 0; i< _monentsInfo.labelList.count; i++) {
NSString * imageUrl = [_monentsInfo.labelList objectAtIndex:i];
NSString * imageUrl = [_monentsInfo.labelList safeObjectAtIndex1:i];
if (i < self.tagStackView.subviews.count) {
NetImageView * image = [self.tagStackView.subviews objectAtIndex:i];
NetImageView * image = [self.tagStackView.subviews safeObjectAtIndex1:i];
image.hidden = NO;
image.imageUrl = imageUrl;
}

View File

@@ -11,6 +11,7 @@
#import <MJRefresh/MJRefresh.h>
///Tool
#import "ThemeColor.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsTopicModel.h"
///View
@@ -92,7 +93,7 @@
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([UITableViewCell class])];
}
MonentsTopicModel * topicModel = [self.datasource objectAtIndex:indexPath.row];
MonentsTopicModel * topicModel = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.textLabel.text = [NSString stringWithFormat:@"#%@", topicModel.name];
cell.textLabel.textColor = [ThemeColor mainTextColor];
cell.textLabel.font = [UIFont systemFontOfSize:13];
@@ -102,7 +103,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
MonentsTopicModel * topicModel = [self.datasource objectAtIndex:indexPath.row];
MonentsTopicModel * topicModel = [self.datasource safeObjectAtIndex1:indexPath.row];
XPMonentTopicContainerViewController * topicVC = [[XPMonentTopicContainerViewController alloc] init];
topicVC.worldId = topicModel.tId;
[self.navigationController pushViewController:topicVC animated:YES];

View File

@@ -14,6 +14,7 @@
#import "XPMacro.h"
#import "XPMonentsLayoutConfig.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsListInfoModel.h"
///P
@@ -105,7 +106,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
MonentsInfoModel * monentInfo= [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentInfo= [self.datasource safeObjectAtIndex1:indexPath.row];
[XPMonentsLayoutConfig layoutMonentsModel:monentInfo];
return monentInfo.rowHeight;
}
@@ -115,7 +116,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPMonentsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsTableViewCell class])];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.delegate = self;
cell.monentsInfo = monentsInfo;
return cell;
@@ -128,7 +129,7 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
detailVC.monentsInfo = monentsInfo;
detailVC.delegate = self;
[self.navigationController pushViewController:detailVC animated:YES];

View File

@@ -15,6 +15,7 @@
#import "QEmotionHelper.h"
#import "QKeyboardManager.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsInfoModel.h"
#import "MonentsCommentModel.h"
@@ -164,7 +165,7 @@
return self.monentsInfo.rowHeight;
} else if(indexPath.section == 1) {
if (self.datasource.count > 0) {
MonentsCommentModel * commentInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsCommentModel * commentInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
return [XPMonentsLayoutConfig commentCommentRowHeight:commentInfo];
} else {
return 400;
@@ -202,7 +203,7 @@
} else {
if (self.datasource.count > 0) {
XPMonentsCommentTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsCommentTableViewCell class])];
cell.commentInfo = [self.datasource objectAtIndex:indexPath.row];
cell.commentInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.delegate = self;
return cell;
} else {
@@ -216,7 +217,7 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (indexPath.section == 1) {
if (self.datasource.count > 0) {
MonentsCommentModel* monent = [self.datasource objectAtIndex:indexPath.row];
MonentsCommentModel* monent = [self.datasource safeObjectAtIndex1:indexPath.row];
self.commentId = monent.commentId;
self.inputBarView.inputTextView.placeholder = [NSString stringWithFormat:@"回复: %@", monent.nick];
[self.inputBarView textViewBecomeFirstResponder];

View File

@@ -13,6 +13,7 @@
#import "ThemeColor.h"
#import "TTPopup.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsInteractiveModel.h"
///P
@@ -105,7 +106,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
MonentsInteractiveModel * model = [self.datasource objectAtIndex:indexPath.row];
MonentsInteractiveModel * model = [self.datasource safeObjectAtIndex1:indexPath.row];
return model.worldName.length > 0? 130 : 90;
}
return KScreenHeight - kNavigationHeight;
@@ -114,7 +115,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPMonentsInteractiveTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsInteractiveTableViewCell class])];
MonentsInteractiveModel * model = [self.datasource objectAtIndex:indexPath.row];
MonentsInteractiveModel * model = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.interactiveInfo = model;
return cell;
}
@@ -126,7 +127,7 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
MonentsInteractiveModel * model = [self.datasource objectAtIndex:indexPath.row];
MonentsInteractiveModel * model = [self.datasource safeObjectAtIndex1:indexPath.row];
MonentsInfoModel * monents = [[MonentsInfoModel alloc] init];
monents.dynamicId = model.dynamicId;
detailVC.monentsInfo = monents;

View File

@@ -14,6 +14,7 @@
#import "XPMacro.h"
#import "XPMonentsLayoutConfig.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsListInfoModel.h"
///P
@@ -109,7 +110,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
MonentsInfoModel * monentInfo= [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentInfo= [self.datasource safeObjectAtIndex1:indexPath.row];
[XPMonentsLayoutConfig layoutMonentsModel:monentInfo];
return monentInfo.rowHeight;
}
@@ -119,7 +120,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPMonentsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsTableViewCell class])];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.monentsInfo = monentsInfo;
cell.delegate = self;
return cell;
@@ -132,7 +133,7 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
detailVC.monentsInfo = monentsInfo;
detailVC.delegate = self;
[self.navigationController pushViewController:detailVC animated:YES];

View File

@@ -14,6 +14,7 @@
#import "XPMacro.h"
#import "XPMonentsLayoutConfig.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsListInfoModel.h"
///P
@@ -69,7 +70,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
MonentsInfoModel * monentInfo= [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentInfo= [self.datasource safeObjectAtIndex1:indexPath.row];
[XPMonentsLayoutConfig layoutMonentsModel:monentInfo];
return monentInfo.rowHeight;
}
@@ -79,7 +80,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPMonentsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsTableViewCell class])];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.delegate = self;
cell.monentsInfo = monentsInfo;
return cell;
@@ -92,7 +93,7 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
detailVC.monentsInfo = monentsInfo;
detailVC.delegate = self;
[self.navigationController pushViewController:detailVC animated:YES];

View File

@@ -17,6 +17,7 @@
#import "Api+Mine.h"
#import "UploadImage.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsTopicModel.h"
#import "MonentsPicResInfo.h"
@@ -25,6 +26,7 @@
#import "XPMonentsPublishTopicView.h"
#import "XPMoentsTopicListView.h"
#import "XPMonentPublishSuccessView.h"
///P
#import "XPMonentsPublishPresenter.h"
#import "XPMonentsPublishProtocol.h"
@@ -233,7 +235,7 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPMonentsPublishCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMonentsPublishCollectionViewCell class]) forIndexPath:indexPath];
UIImage * image = [self.datasource objectAtIndex:indexPath.row];
UIImage * image = [self.datasource safeObjectAtIndex1:indexPath.row];
if (indexPath.row == (self.datasource.count -1)) {
cell.isShowDelete = self.datasource.count == 9;
} else {

View File

@@ -14,6 +14,7 @@
#import "XPMacro.h"
#import "XPMonentsLayoutConfig.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsInfoModel.h"
#import "MonentsTopicModel.h"
@@ -111,7 +112,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
MonentsInfoModel * monentInfo= [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentInfo= [self.datasource safeObjectAtIndex1:indexPath.row];
[XPMonentsLayoutConfig layoutMonentsModel:monentInfo];
return monentInfo.rowHeight;
}
@@ -121,7 +122,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPMonentsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsTableViewCell class])];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.monentsInfo = monentsInfo;
cell.delegate = self;
return cell;
@@ -134,7 +135,7 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
detailVC.monentsInfo = monentsInfo;
detailVC.delegate = self;
[self.navigationController pushViewController:detailVC animated:YES];

View File

@@ -14,6 +14,7 @@
#import "XPMacro.h"
#import "XPMonentsLayoutConfig.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsListInfoModel.h"
///P
@@ -101,7 +102,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
MonentsInfoModel * monentInfo= [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentInfo= [self.datasource safeObjectAtIndex1:indexPath.row];
[XPMonentsLayoutConfig layoutMonentsModel:monentInfo];
return monentInfo.rowHeight;
}
@@ -111,7 +112,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPMonentsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsTableViewCell class])];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.delegate = self;
cell.monentsInfo = monentsInfo;
return cell;
@@ -124,7 +125,7 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
detailVC.monentsInfo = monentsInfo;
detailVC.delegate = self;
[self.navigationController pushViewController:detailVC animated:YES];

View File

@@ -14,6 +14,7 @@
#import "XPMacro.h"
#import "XPMonentsLayoutConfig.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "MonentsListInfoModel.h"
///P
@@ -101,7 +102,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
MonentsInfoModel * monentInfo= [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentInfo= [self.datasource safeObjectAtIndex1:indexPath.row];
[XPMonentsLayoutConfig layoutMonentsModel:monentInfo];
return monentInfo.rowHeight;
}
@@ -111,7 +112,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPMonentsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsTableViewCell class])];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.delegate = self;
cell.monentsInfo = monentsInfo;
return cell;
@@ -124,7 +125,7 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
MonentsInfoModel * monentsInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
detailVC.monentsInfo = monentsInfo;
detailVC.delegate = self;
[self.navigationController pushViewController:detailVC animated:YES];

View File

@@ -7,6 +7,7 @@
#import "ZegoRtcImpl.h"
#import <ZegoAudioRoom/ZegoAudioRoom.h>
#import "NSArray+Safe.h"
@interface ZegoRtcImpl()<ZegoAudioRoomDelegate, ZegoAudioLivePublisherDelegate, ZegoSoundLevelDelegate, ZegoMediaPlayerEventDelegate>
@@ -210,7 +211,7 @@
NSString *uid = nil;
NSArray *strArray = [userInfo.streamID componentsSeparatedByString:@"-"];
if (strArray.count >= 2) {
uid = [strArray objectAtIndex:1];
uid = [strArray safeObjectAtIndex1:1];
if (userInfo.soundLevel > 0) {
[uids addObject:uid];
}

View File

@@ -12,6 +12,7 @@
#import "ThemeColor.h"
#import "NetImageView.h"
#import "TTPopup.h"
#import "NSArray+Safe.h"
///Model
#import "AcrossRoomPKPanelModel.h"
@@ -277,14 +278,14 @@
self.redValueLabel.text = [NSString stringWithFormat:@"%lld", data.cAmount];
self.blueValueLabel.text = [NSString stringWithFormat:@"%lld", data.aAmount];
if (data.csRank.count > 0) {//
AcrossRoomPkRankModel *contributeInfo = [data.csRank objectAtIndex:0];
AcrossRoomPkRankModel *contributeInfo = [data.csRank safeObjectAtIndex1:0];
self.contributeNick.text = contributeInfo.nick ? contributeInfo.nick : @"";
self.contributeValue.text = [NSString stringWithFormat:@"神豪值:%@", contributeInfo.amount? contributeInfo.amount : @""];
self.contributeAvatar.imageUrl = contributeInfo.avatar;
}
if (data.crRank.count > 0) {
AcrossRoomPkRankModel *charmInfo = [data.crRank objectAtIndex:0];
AcrossRoomPkRankModel *charmInfo = [data.crRank safeObjectAtIndex1:0];
self.charmNick.text = charmInfo.nick ? charmInfo.nick : @"";
self.charmValue.text = [NSString stringWithFormat:@"魅力值:%@", charmInfo.amount? charmInfo.amount : @""];
self.charmAvatar.imageUrl = charmInfo.avatar;

View File

@@ -16,6 +16,7 @@
#import "UIImage+Utils.h"
#import "UIButton+EnlargeTouchArea.h"
#import "Timestamp.h"
#import "NSArray+Safe.h"
///Model
#import "UserInfoModel.h"
#import "AcrossRoomPKPanelModel.h"
@@ -565,7 +566,7 @@
self.blueAvatarImageView.imageUrl = _pkPanelInfo.aAvatar;
self.buleCountLabel.text = [NSString stringWithFormat:@"%lld", _pkPanelInfo.aAmount];
for (int i = 0; i<_pkPanelInfo.csRank.count; i++) {
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.csRank objectAtIndex:i];
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.csRank safeObjectAtIndex1:i];
if (i >= self.redContributeStackView.subviews.count) {
break;
}
@@ -573,7 +574,7 @@
userView.panelInfo = rankModel;
}
for (int i = 0; i<_pkPanelInfo.crRank.count; i++) {
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.crRank objectAtIndex:i];
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.crRank safeObjectAtIndex1:i];
if (i >= self.redCharmStackView.subviews.count) {
break;
}
@@ -582,7 +583,7 @@
}
for (int i = 0; i<_pkPanelInfo.asRank.count; i++) {
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.asRank objectAtIndex:i];
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.asRank safeObjectAtIndex1:i];
if (i >= self.blueContributeStackView.subviews.count) {
break;
}
@@ -591,7 +592,7 @@
}
for (int i = 0; i<_pkPanelInfo.arRank.count; i++) {
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.arRank objectAtIndex:i];
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.arRank safeObjectAtIndex1:i];
if (i >= self.blueCharmStackView.subviews.count) {
break;
}

View File

@@ -15,6 +15,7 @@
#import "UIImage+Utils.h"
#import "Api+AcrossRoomPK.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "AcrossRoomPKInfoModel.h"
///View
@@ -189,7 +190,7 @@
cell = [[XPAcrossRoomPKTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPAcrossRoomPKTableViewCell class])];
}
cell.delegate = self;
AcrossRoomPKInfoModel * pkRoomInfo = [self.datasource objectAtIndex:indexPath.row];
AcrossRoomPKInfoModel * pkRoomInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
if (pkRoomInfo.uid.integerValue == self.selectRoomInfo.uid.integerValue) {
pkRoomInfo.hadSelected = YES;
} else {

View File

@@ -18,6 +18,7 @@
#import "XCHUDTool.h"
#import "XPMacro.h"
#import "StatisticsServiceHelper.h"
#import "NSArray+Safe.h"
///Model
#import "UserInfoModel.h"
#import "RoomInfoModel.h"
@@ -110,7 +111,7 @@
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
for (NSInteger i = (self.subviews.count - 1) ; i >= 0 ; i--) {
UIView * subView = [self.subviews objectAtIndex:i];
UIView * subView = [self.subviews safeObjectAtIndex1:i];
CGPoint convertPoint = [subView convertPoint:point fromView:self];
if (CGRectContainsPoint(subView.bounds, convertPoint)) {
return [subView hitTest:convertPoint withEvent:event];
@@ -357,7 +358,7 @@
#pragma mark - SDCycleScrollViewDelegate
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
if (self.activityList.count > index) {
ActivityInfoModel * info = [self.activityList objectAtIndex:index];
ActivityInfoModel * info = [self.activityList safeObjectAtIndex1:index];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_banner_click eventAttributes:@{@"bannerName": info.bannerName}];
if([info.bannerName isEqualToString:@"首充有礼"]) {
[self firstRechargeTapRecognizer];
@@ -387,7 +388,7 @@
/** */
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index {
if (self.activityList.count > index) {
ActivityInfoModel * info = [self.activityList objectAtIndex:index];
ActivityInfoModel * info = [self.activityList safeObjectAtIndex1:index];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_banner_show eventAttributes:@{@"bannerName": info.bannerName}];
}
}

View File

@@ -13,6 +13,7 @@
#import "NetImageView.h"
#import "TTPopup.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "AcrossRoomPKPanelModel.h"
@@ -283,7 +284,7 @@
self.contributeTitleLabel.hidden = NO;
self.noneContrbuteLabel.hidden = YES;
for (int i = 0; i<data.csRank.count; i++) {
AcrossRoomPkRankModel *contributeInfo = [data.csRank objectAtIndex:i];
AcrossRoomPkRankModel *contributeInfo = [data.csRank safeObjectAtIndex1:i];
XPAnchorPKResultContributeView *view = [[XPAnchorPKResultContributeView alloc] init];
[self.mainView addSubview:view];
view.data = contributeInfo;

View File

@@ -19,6 +19,7 @@
#import "Api+UserCard.h"
#import "XCHUDTool.h"
#import "AccountInfoStorage.h"
#import "NSArray+Safe.h"
///Model
#import "UserInfoModel.h"
#import "AcrossRoomPKPanelModel.h"
@@ -459,7 +460,7 @@
self.redCountLabel.text = [NSString stringWithFormat:@"%lld", _pkPanelInfo.cAmount];
self.blueCountLabel.text = [NSString stringWithFormat:@"%lld", _pkPanelInfo.aAmount];
for (int i = 0; i<_pkPanelInfo.csRank.count; i++) {
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.csRank objectAtIndex:i];
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.csRank safeObjectAtIndex1:i];
if (i >= self.redContributeStackView.subviews.count) {
break;
}
@@ -468,7 +469,7 @@
}
for (int i = 0; i<_pkPanelInfo.asRank.count; i++) {
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.asRank objectAtIndex:i];
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.asRank safeObjectAtIndex1:i];
if (i >= self.blueContributeStackView.subviews.count) {
break;
}

View File

@@ -15,6 +15,7 @@
#import "UIImage+Utils.h"
#import "Api+AnchorPk.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
///Model
#import "AcrossRoomPKInfoModel.h"
///View
@@ -178,7 +179,7 @@
cell = [[XPAnchorPKTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPAnchorPKTableViewCell class])];
}
cell.delegate = self;
AcrossRoomPKInfoModel * pkRoomInfo = [self.datasource objectAtIndex:indexPath.row];
AcrossRoomPKInfoModel * pkRoomInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
if (pkRoomInfo.uid.integerValue == self.selectRoomInfo.uid.integerValue) {
pkRoomInfo.hadSelected = YES;
} else {

View File

@@ -6,13 +6,13 @@
//
#import "XPRoomAnimationHitView.h"
#import "NSArray+Safe.h"
@implementation XPRoomAnimationHitView
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
for (NSInteger i = (self.subviews.count - 1) ; i >= 0 ; i--) {
UIView * subView = [self.subviews objectAtIndex:i];
UIView * subView = [self.subviews safeObjectAtIndex1:i];
CGPoint convertPoint = [subView convertPoint:point fromView:self];
if (CGRectContainsPoint(subView.bounds, convertPoint)) {
return [subView hitTest:convertPoint withEvent:event];

View File

@@ -8,7 +8,7 @@
#import "XPRoomGraffitiGiftAnimationView.h"
#import "XPWeakTimer.h"
#import "XPMacro.h"
#import "NSArray+Safe.h"
@interface XPRoomGraffitiGiftAnimationView ()
@property (nonatomic,strong) NSTimer *timer;
@@ -65,7 +65,7 @@
});
return;
}
NSValue * valeu= [self.datasource objectAtIndex:self.index];
NSValue * valeu= [self.datasource safeObjectAtIndex1:self.index];
CGPoint point = valeu.CGPointValue;
UIImageView * imageView = [[UIImageView alloc] init];
imageView.layer.masksToBounds = YES;

View File

@@ -18,6 +18,7 @@
#import "XPHtmlUrl.h"
#import "ApiHost.h"
#import "UIImage+Utils.h"
#import "NSArray+Safe.h"
///Model
#import "ArrangeMicModel.h"
#import "AttachmentModel.h"
@@ -611,7 +612,7 @@
if (cell == nil) {
cell = [[XPArrangeMicTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPArrangeMicTableViewCell class])];
}
ArrangeMicUserModel * userInfo = [self.datasource objectAtIndex:indexPath.row];
ArrangeMicUserModel * userInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
userInfo.arrangeMicType = self.userInfo.type;
cell.isManager = self.userInfo.isManager;
userInfo.number = indexPath.row + 1;

View File

@@ -16,6 +16,7 @@
#import "RtcManager.h"
#import "XPConstant.h"
#import "XCHUDTool.h"
#import "NSArray+Safe.h"
///Model
#import "Music+CoreDataClass.h"
///View
@@ -135,11 +136,11 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey;
if (!self.isPlaying && self.currentMusic) {
self.isPlaying = [[RtcManager instance] changePlayState:BackMusicPlayState_Resume];
} else {
Music * music = [array objectAtIndex:index];
Music * music = [array safeObjectAtIndex1:index];
[self playCurrentMusic:music index:index];
}
} else {
Music * music = [array objectAtIndex:index];
Music * music = [array safeObjectAtIndex1:index];
[self playCurrentMusic:music index:index];
}
}
@@ -213,7 +214,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey;
{
if (self.isPlaying == NO && self.currentMusic == nil) {
NSArray * array = [[XPCoreDataManager shareInstance].managedObjectContext executeFetchRequest:self.request error:nil];
Music * music = [array objectAtIndex:0];
Music * music = [array safeObjectAtIndex1:0];
[self playCurrentMusic:music index:0];
} else {
if (self.isPlaying) {
@@ -228,7 +229,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey;
{
NSArray * array = [[XPCoreDataManager shareInstance].managedObjectContext executeFetchRequest:self.request error:nil];
if (self.isPlaying == NO && self.currentMusic == nil) {
Music * music = [array objectAtIndex:0];
Music * music = [array safeObjectAtIndex1:0];
[self playCurrentMusic:music index:0];
} else {
NSInteger index = self.currentIndex + 1;

View File

@@ -15,6 +15,7 @@
#import "XPMacro.h"
#import "XPCoreDataManager.h"
#import "ThemeColor.h"
#import "NSArray+Safe.h"
///Model
#import "Music+CoreDataClass.h"
///View
@@ -112,7 +113,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPRoomMusicLibraryTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPRoomMusicLibraryTableViewCell class])];
Music * musicInfo = [self.datasource objectAtIndex:indexPath.row];
Music * musicInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
if (musicInfo.musicId == self.selectMusic.musicId) {
cell.isSelect = YES;
} else {
@@ -133,7 +134,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
Music * musicInfo = [self.datasource objectAtIndex:indexPath.row];
Music * musicInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
self.selectMusic = musicInfo;
self.playView.music = musicInfo;
[self.tableView reloadData];
@@ -184,7 +185,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
Music * music = [self.datasource objectAtIndex:indexPath.row];
Music * music = [self.datasource safeObjectAtIndex1:indexPath.row];
[self showLoading];
if ([music.musicId isEqualToString:self.currentMusic.musicId]) {
self.playView.music = nil;

View File

@@ -19,6 +19,7 @@
#import "SJXCSMIPHelper.h"
#import "XPCoreDataManager.h"
#import "GCDHelper.h"
#import "NSArray+Safe.h"
///Model
#import "Music+CoreDataClass.h"
@interface XPRoomTransferMusicViewController ()<MyHTTPConnectionDelegate>
@@ -200,21 +201,21 @@
NSArray *albumNames = [AVMetadataItem metadataItemsFromArray:mp3Asset.commonMetadata withKey:AVMetadataCommonKeyArtwork keySpace:AVMetadataKeySpaceCommon];
NSArray *titles = [AVMetadataItem metadataItemsFromArray:mp3Asset.commonMetadata withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon];
if (artists.count > 0) {
AVMetadataItem *artist = [artists objectAtIndex:0];
AVMetadataItem *artist = [artists safeObjectAtIndex1:0];
singer = [artist.value copyWithZone:nil];
}else{
singer = @"未知歌手";
}
if (albumNames.count > 0) {
AVMetadataItem *artist = [albumNames objectAtIndex:0];
AVMetadataItem *artist = [albumNames safeObjectAtIndex1:0];
image = [UIImage imageWithData:[artist.value copyWithZone:nil]];
}else{
image = [UIImage imageNamed:@"common_avatar"];
}
if (titles.count > 0) {
AVMetadataItem *artist = [titles objectAtIndex:0];
AVMetadataItem *artist = [titles safeObjectAtIndex1:0];
songName = [artist.value copyWithZone:nil];
}else{
songName = @"未知";

View File

@@ -32,6 +32,7 @@
#import "Api+WishGift.h"
#import "StatisticsServiceHelper.h"
#import "NSObject+MJExtension.h"
#import "NSArray+Safe.h"
///Model
#import "RoomInfoModel.h"
#import "MicroQueueModel.h"
@@ -173,7 +174,7 @@
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
for (NSInteger i = (self.subviews.count - 1) ; i >= 0 ; i--) {
UIView * subView = [self.subviews objectAtIndex:i];
UIView * subView = [self.subviews safeObjectAtIndex1:i];
CGPoint convertPoint = [subView convertPoint:point fromView:self];
if (CGRectContainsPoint(subView.bounds, convertPoint)) {
return [subView hitTest:convertPoint withEvent:event];

View File

@@ -14,6 +14,7 @@
#import "XPHtmlUrl.h"
#import "TTPopup.h"
#import "XCHUDTool.h"
#import "NSArray+Safe.h"
///View
#import "XPRoomHalfWebView.h"
#import "XPCandyTreeMoreRuleCell.h"
@@ -86,7 +87,7 @@ NSString * const kCandyTreeHideMessage = @"kCandyTreeHideMessage";
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([UITableViewCell class])];
}
cell.backgroundColor = [UIColor whiteColor];
cell.textLabel.text = [self.datasource objectAtIndex:indexPath.row];
cell.textLabel.text = [self.datasource safeObjectAtIndex1:indexPath.row];
cell.textLabel.textColor = [ThemeColor alertTitleColor];
cell.textLabel.font = [UIFont systemFontOfSize:15];
return cell;

View File

@@ -13,6 +13,7 @@
#import "ThemeColor.h"
#import "XCHudTool.h"
#import "Api+CandyTree.h"
#import "NSArray+Safe.h"
///Model
#import "CandyTreeRecordModel.h"
///View
@@ -143,7 +144,7 @@
if (cell == nil) {
cell = [[XPCandyTreeRankTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPCandyTreeRankTableViewCell class])];
}
cell.roomRankModel = [self.datasource objectAtIndex:indexPath.row];
cell.roomRankModel = [self.datasource safeObjectAtIndex1:indexPath.row];
return cell;
}

Some files were not shown because too many files have changed in this diff Show More