Open haxinc opened 10 years ago
Hi,
the methods
- (void)reloadCenterViewControllerUsingBlock:(void (^)(void))reloadBlock;
- (void)replaceCenterViewControllerWithViewController:(UIViewController<ICSDrawerControllerChild, ICSDrawerControllerPresenting> *)viewController;
are both meant to be called when the drawer is open: from the failing NSParameterAssert error message you posted, it seems you are calling this method when the drawer is not open.
To use a UINavigationController as your center view controller, you could:
<ICSDrawerControllerChild>
protocol and implement the required drawer
propertyopenDrawer
method that calls [self.drawer open]
openDrawer
methodI have the same problem. I try to add some views instead of changing background colors. Here are my codes that are followed your annotations.
[self.drawer reloadCenterViewControllerUsingBlock:^(){ if (indexPath.row == 0) { userViewController uV = [[userViewController alloc]init]; [center.view addSubview:uV.view]; }else if (indexPath.row == 1) { cameraViewController cV = [[cameraViewController alloc]init]; [center.view addSubview:cV.view]; }else if (indexPath.row == 2) { localViewController *lV = [[localViewController alloc]init]; [center.view addSubview:lV.view]; } [self.drawer replaceCenterViewControllerWithViewController:center]; }];
When the project runs to the codes about replaceCenterViewControllerWithViewController, it broke down. libc++abi.dylib: terminating with uncaught exception of type NSException
To replace the current center view controller with a different one, you need to call only replaceCenterViewControllerWithViewController:
YourNewCenterViewController *vc = [[YourNewCenterViewController alloc] init];
[self.drawer replaceCenterViewControllerWithViewController:vc];
(The method reloadCenterViewControllerUsingBlock:
is intended to be called when you want to update the current center view controller state (e.g. reload its data))
Thanks, it works. : ) 在 2014年4月29日,下午10:14,vmodena notifications@github.com 写道:
To replace the current center view controller with a different one, you need to call only replaceCenterViewControllerWithViewController:
YourNewCenterViewController *vc = [[YourNewCenterViewController alloc] init]; [self.drawer replaceCenterViewControllerWithViewController:vc]; (The method reloadCenterViewControllerUsingBlock: is intended to be called when you want to update the current center view controller state (e.g. reload its data))
— Reply to this email directly or view it on GitHub.
I have tried as above You mentioned like, YourNewCenterViewController *vc = [[YourNewCenterViewController alloc] init]; [self.drawer replaceCenterViewControllerWithViewController:vc];
but i am getting error as following, 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: self.drawerState == ICSDrawerControllerStateOpen'
Please Help Me Out
Hi,
How could I use the self.drawer replacecenterviewcontroller to use it instead of self.navigationController pushView
I used this code: TagsViewController *x = [[TagsViewController alloc] initWithStyle:UITableViewStylePlain];
it shows this error
Thanks , since [self.drawer open] it doesn't work with UInavigationController