Resolved Need Help Loading Multiple Table Views from plist

Discussion in 'iOS Programming' started by Fazzl, Mar 18, 2011.

  1. Fazzl, Mar 18, 2011
    Last edited: Mar 19, 2011

    Fazzl macrumors 6502a

    Fazzl

    Joined:
    Aug 13, 2007
    #1
    I have an app that shows two table views: a first view and a second view that is pushed when you click a cell in the first table.

    For example, first view shows muscles (bicep, chest, arms, etc). When you click a cell (say bicep), it pushes into a table that shows specific exercises for the bicep.

    I currently have it working with arrays and separate class table view controllers for all muscles but its too many files and not optimized.

    I have now put all the data into a plist like this and want to fill the two tables accordingly but it is not working. Any suggestions?

    [​IMG]
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Yes. Please explain what you mean by "it is not working". That's far too vague for us to provide much help and we are not mind readers. Are you getting warning/errors? Is it crashing? If so, what does the crash log say? Etc.

    P.S. Perhaps you should start by reading over these two blog articles: Getting Answers and What Have You Tried?.
     
  3. Fazzl, Mar 18, 2011
    Last edited by a moderator: Mar 18, 2011

    Fazzl thread starter macrumors 6502a

    Fazzl

    Joined:
    Aug 13, 2007
    #3
    The problem I am having is that the plist I posted above is not loading into the tables, although a plist with a list of strings of muscle names successfully loads into the muscle table view.

    Bascially, it is loading this plist fine:
    [​IMG]

    But I want i to load from this plist, because it has the exercises in it as well.
    [​IMG]

    And this is the current method I have to load from the original plist. I think it needs to be changed to let it load from the new plist values called name.

    Code:
    - (void)viewDidLoad
    {
        
        if (excerciseArray == nil)
        {
            NSString *path = [[NSBundle mainBundle]pathForResource:@"muscles" ofType:@"plist"];
            NSMutableArray *array = [[NSMutableArray alloc]initWithContentsOfFile:path];
            self.excerciseArray = array;
            [array release];
        }
        
     
  4. Fazzl, Mar 18, 2011
    Last edited: Mar 18, 2011

    Fazzl thread starter macrumors 6502a

    Fazzl

    Joined:
    Aug 13, 2007
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    Time for a "Resolved" thread prefix (hint, hint)? :D
     
  6. Fazzl, Mar 19, 2011
    Last edited: Mar 19, 2011

    Fazzl thread starter macrumors 6502a

    Fazzl

    Joined:
    Aug 13, 2007
    #6
    Ok ill do taht thanks
     
  7. ajaykhanna009 macrumors newbie

    Joined:
    Apr 25, 2011
    #7
    having same problem

    mate i am making some what same app for my college project and i am having problem when i go from one table view to another. can you help me how to resolve it?
     

Share This Page