Code Monkey home page Code Monkey logo

Comments (15)

arturdev avatar arturdev commented on July 19, 2024

Hi iulianvarzaru.
If you want to open same content view controller by selecting on each of cells, then you mast implement
tableView:didSelectRowAtIndexPath method and perform segue manually, e.g.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self performSegueWithIdentifier:@"yourSegue" sender:nil];
}

//...

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
     UIViewController *vc = [[segue destinationViewController] viewControllers][0];
    // pass some data
}

By doing this make sure that your left table view has segue with identifier @"yourSegue" of type AMSlideMenuContentSegue.

"I have tried playing with didselectitem and prepareforsegue but I get an error that there is no segue with rightMenu in storyboard."
If you use only left menu and haven't right menu and if you have setted 'All Exceptions' breakpoint, then its ok .
It's just stopped in the @Try @catch block.
You can just click on 'Continue program execution'
screen shot 2014-01-23 at 7 38 47 pm

Or you can disable that breakpoint :)

from amslidemenu2.

 avatar commented on July 19, 2024

Hey arturdev,

Thanks for the fast reply, I kinda got the same conclusion after trying different solutions. I have done it like this:

UINavigationController *nav = (UINavigationController *)[segue destinationViewController];
IPHomeCollectionViewController *hm = (IPHomeCollectionViewController *)[nav topViewController];

And then I am passing the data.

But, is this ok in terms of memory allocation ?

Thanks for you help and for creating this library.

Best Regards,
Iulian Varzaru

from amslidemenu2.

arturdev avatar arturdev commented on July 19, 2024

Yes, you are doing right :)
[nav topViewController];
or
[nav.viewControllers objectAtIndex:0];

from amslidemenu2.

hsb1007 avatar hsb1007 commented on July 19, 2024

Hi

When I do table:didSelect, Do I still need to implement segueIdentifierForIndexPathInLeftMenu?

I can't get it to work =(

I get the below error ( I am using storyboard and left menu only)

has no segue with identifier 'rightMenu'

And when I take out all the exception, I get the following

(<ERKLeftMenuViewController: 0x16648360>) has no segue with identifier '''

And yes, I do have 'leftMenu' segue =(

Any advice is appreciated

Thanks

Ben

from amslidemenu2.

arturdev avatar arturdev commented on July 19, 2024

You have to implement segueIdentifierForIndexPathInLeftMenu anyway.
and if you implemented
-tableView:didSelectRowAtIndexPath method,
then you need to perform segue manually:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
        [self performSegueWithIdentifier:[self.mainVC segueIdentifierForIndexPathInLeftMenu:indexPath] sender:self];
}

from amslidemenu2.

hsb1007 avatar hsb1007 commented on July 19, 2024

Hi

Thank you for quick response.

I am not sure what I did wrong but seems like 'prepareForSegue' happens THEN 'segueIdentifierForIndexPathInLeftMenu' happens.

The issue i have is the data I am passing doesn't seem to be saved.

And I found out that in prepareForSegue's destinationViewController one has different memory allcoated than the actual view controller that are presented at the end.

So it seems like 'segueIdentifierForIndexPathInLeftMenu overrides the manual perform segue from tableDidSelect ?

And also closing animation doesn't work for me and I think they are probably related issue.

Is there any advice you can share ?

Thank you so much in advance

Cheers

Ben

from amslidemenu2.

arturdev avatar arturdev commented on July 19, 2024

Can you provide part of your codes?

from amslidemenu2.

hsb1007 avatar hsb1007 commented on July 19, 2024

I certainly can. but which part would be relevant?
I have attached 2 screenshots.

One is from main and the other one is from Left menu view controller.

Thank you so much and let me know if there's any other part of codes you need.

Cheers

screen shot 2014-02-24 at 11 47 29 pm
screen shot 2014-02-24 at 11 47 41 pm

from amslidemenu2.

arturdev avatar arturdev commented on July 19, 2024

everything seems correct.
I think the problem is in another place.
It will be better if you send me your full project archive.

from amslidemenu2.

hsb1007 avatar hsb1007 commented on July 19, 2024

Thank you so much for your help.

I have set up github project for it
https://github.com/hsb1007/Kukky.git

I really appreciate your help! Thank you

from amslidemenu2.

arturdev avatar arturdev commented on July 19, 2024

screen shot 2014-02-25 at 10 36 34 am
Project can't be compiled.
It seems that project didn't merged successfully in git.
Make an archive of your project and send to
[email protected]

from amslidemenu2.

arturdev avatar arturdev commented on July 19, 2024

You have done some mistakes.
First of all, when you connect your menu to content view controller, make sure that segues source is the table view controller instead of UiTableviewCell.
Second, do not give same identifier to different segues (i.e. itemList).
And 3th mistake is in your ERKLeftMenuViewController's prepafeForSegue:sender method.
Here sender is view controller, not cell. And for getting selected indexPath just call

    NSIndexPath *indexPath = [self.myTableView indexPathForSelectedRow];    
    if (!indexPath) // if this is true, than this means that the initial indexPath is opened
    {
        indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
    }
 UINavigationController *contentNVC = [segue destinationViewController];
 UIViewController *vc = [contentNVC topViewController];
   //.. pass data to vc 

from amslidemenu2.

hsb1007 avatar hsb1007 commented on July 19, 2024

Thank you so much!

They all working fine now =)

from amslidemenu2.

arturdev avatar arturdev commented on July 19, 2024

Welcome! :)

On Wed, Feb 26, 2014 at 6:43 AM, hsb1007 [email protected] wrote:

Thank you so much!

They all working fine now =)

Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-36085235
.

from amslidemenu2.

vadoliyanidhi avatar vadoliyanidhi commented on July 19, 2024

hello arturdev ,
I am trying to implement AMSlidemenu in iOS8 withStoryboard.i m new for storyboard already i m implement AMSlidemenu .

I have used two different left-menu one for before Login and Afterlogin how to manage thats I don't know.

beforLoginleftMenu So Slider-->>loginVC
If login button is pressed I would like to open new Slider Afterloginleftmenu.

Thank you So So much in Advance .

from amslidemenu2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.