Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions SASlideMenu/SASlideMenu/SASlideMenuRootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#define kMenuTableSize 280
#define kSwipeMinDetectionSpeed 0.1f

NSString * const cachingKeyFormat = @"%li,%li";


typedef enum {
SASlideMenuStateInitial,
Expand Down Expand Up @@ -407,7 +409,12 @@ -(void) panItem:(UIPanGestureRecognizer*)gesture{
}

-(UINavigationController*) controllerForIndexPath:(NSIndexPath*) indexPath{
return [controllers objectForKey:indexPath];
return [controllers objectForKey:[self getNSIndexPathKey:indexPath]];
}

-(NSString*)getNSIndexPathKey:(NSIndexPath*)indexPath
{
return [NSString stringWithFormat:cachingKeyFormat, indexPath.section, indexPath.row];
}

-(void) switchToContentViewController:(UINavigationController*) content completion:(void (^)(void))completion{
Expand Down Expand Up @@ -495,7 +502,7 @@ -(void) addContentViewController:(UIViewController*) content withIndexPath:(NSIn
disableContentViewControllerCaching = [self.leftMenu.slideMenuDataSource disableContentViewControllerCachingForIndexPath:indexPath];
}
if (!disableContentViewControllerCaching) {
[controllers setObject:content forKey:indexPath];
[controllers setObject:content forKey:[self getNSIndexPathKey:indexPath]];
}
}
}
Expand Down