diff --git a/MMDrawerController/MMDrawerController.m b/MMDrawerController/MMDrawerController.m index 5b5a393d..6eeb3fc7 100644 --- a/MMDrawerController/MMDrawerController.m +++ b/MMDrawerController/MMDrawerController.m @@ -217,15 +217,15 @@ - (void)decodeRestorableStateWithCoder:(NSCoder *)coder{ [super decodeRestorableStateWithCoder:coder]; - if ((controller = [coder decodeObjectForKey:MMDrawerLeftDrawerKey])){ - self.leftDrawerViewController = [coder decodeObjectForKey:MMDrawerLeftDrawerKey]; + if ((!self.leftDrawerViewController)&&(controller = [coder decodeObjectForKey:MMDrawerLeftDrawerKey])){ + self.leftDrawerViewController = controller; } - - if ((controller = [coder decodeObjectForKey:MMDrawerRightDrawerKey])){ + + if ((!self.rightDrawerViewController)&&(controller = [coder decodeObjectForKey:MMDrawerRightDrawerKey])){ self.rightDrawerViewController = controller; } - if ((controller = [coder decodeObjectForKey:MMDrawerCenterKey])){ + if ((!self.centerViewController)&&(controller = [coder decodeObjectForKey:MMDrawerCenterKey])){ self.centerViewController = controller; }