nav遍历操作栈低vc

cell.delectBtnBlock = ^(NSInteger feedid){
//弹框

ACActionSheet *actionSheet = [[ACActionSheet alloc] initWithTitle:nil cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@[@"删除此动态"] actionSheetBlock:^(NSInteger buttonIndex) {

switch (buttonIndex) {

case 0:

[[NetworkManager sharedInstance] requestCircleDeletefeeds:feedid success:^(id dicJson) {

if ([dicJson[@"status_code"] isEqualToString:@"0"]) {

//遍历vc

BOOL isSecond = NO;

for(UIViewController *controller in self.navigationController.viewControllers)

{

if([controller isKindOfClass:[BusinessCircleFeedVC class]])

{

BusinessCircleFeedVC* vc = (BusinessCircleFeedVC*)controller;

[vc requestDataForRelease];//feed进入详情

isSecond = YES;

}

if([controller isKindOfClass:[MyPhotoAlbumVC class]])

{

KLFeedMyPhotoFrame* modelRemove = nil;

MyPhotoAlbumVC* vc = (MyPhotoAlbumVC*)controller;

for (KLFeedMyPhotoFrame* modelF in vc.photoArrayF) {

if ([modelF.photoModel.feed_id integerValue] ==feedid) {

modelRemove = modelF;

}

}

[vc.photoArrayF removeObject:modelRemove];

[vc.tableView reloadData];

}

}

if (!isSecond) {//我的相册进入

MainTabViewController* tabvc = [[ProjectManager sharedInstance] getRootTab];

JJNavigationController* nvc = tabvc.viewControllers[1];

for (UIViewController *controller in nvc.viewControllers) {

if([controller isKindOfClass:[BusinessCircleFeedVC class]])

{

BusinessCircleFeedVC* vc = (BusinessCircleFeedVC*)controller;

[vc requestDataForRelease];

}

if([controller isKindOfClass:[MyPhotoAlbumVC class]])

{

KLFeedMyPhotoFrame* modelRemove = nil;

MyPhotoAlbumVC* vc = (MyPhotoAlbumVC*)controller;

for (KLFeedMyPhotoFrame* modelF in vc.photoArrayF) {

if ([modelF.photoModel.feed_id integerValue] ==feedid) {

modelRemove = modelF;

}

}

[vc.photoArrayF removeObject:modelRemove];

[vc.tableView reloadData];

}

}

}

[self.navigationController popViewControllerAnimated:YES];

}

} fail:^(NSString * error, BOOL re) {

}];

break;

}

}];

[actionSheet show];

};

在栈后面的vc遍历nav,取到栈顶的vc,对其进行操作,包括从数组删元素再刷新、改变属性等等。。。

nav遍历操作栈低vc_第1张图片
phone2.jpg
nav遍历操作栈低vc_第2张图片
photo1.jpg

你可能感兴趣的:(nav遍历操作栈低vc)