stefanoa / SASlideMenu

Library to create iOS sliding menu compatible with storyboards
568 stars 118 forks source link

Dynamic Menu get Content from Json #114

Open cliffgr opened 10 years ago

cliffgr commented 10 years ago

Any one Made it ? I want to download the menu on startup of app..

stefanoa commented 10 years ago

You should be able to do it. However I never did it.

cliffgr commented 10 years ago

i got here an error

// This is the segue you want visibile when the controller is loaded the first time -(NSIndexPath*) selectedIndexPath{ NSLog(@"selectedIndexPath"); return [NSIndexPath indexPathForRow:0 inSection:0]; }

out of index

stefanoa commented 10 years ago

you have to disable the loading of the initial content view controller because you are downloading it with the json. To do that you have to remove the implementation of:

-(NSIndexPath*) selectedIndexPath; 

from your code

cliffgr commented 10 years ago

True but when i remove this method , the application force start with Menu

ios simulator screen shot mar 10 2014 9 56 45 am

ios simulator screen shot mar 10 2014 9 56 51 am

cliffgr commented 10 years ago

hello again i have problem with this......

UIStoryboard *storyboard=[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:[NSBundle mainBundle]];

UINavigationController *secondView= [storyboard instantiateViewControllerWithIdentifier:@"testa"];
MainMenu *myViewController = (MainMenu *)secondView.topViewController; 
myViewController.TableMenuSS=name; //Mutable array with menu titles
[self presentViewController:secondView animated:YES completion:^{
    SASlideMenuAppDelegate* app = (SASlideMenuAppDelegate*)[[UIApplication sharedApplication] delegate];

    [app.window setRootViewController:secondView];
}];

and the output is:

-[SASlideMenuRootViewController topViewController]: unrecognized selector sent to instance 0xa3762d0 2014-03-12 13:53:07.046 SASlideMenuDynamic[10566:70b] *\ Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SASlideMenuRootViewController topViewController]: unrecognized selector sent to instance 0xa3762d0'

when i use secondView.presentedViewController; the data never pass to MainMenu