Sort Data into Table?

Discussion in 'iOS Programming' started by ArtOfWarfare, Dec 18, 2009.

  1. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #1
    Okay, I'm begging to think maybe there's a better way to do this, but I have no clue how.

    Here's what I have:
    An array of dictionaries (called Assignments.)
    Each dictionary has 3 keys. (Name, Class, and Date.)

    I would like to create a table of the assignments. It should have a section for each Class, in which all of the Assignments with that Class are put.

    So, help?

    Right now the process I have...
    1.) Run through all the Classes and create an NSMutableDictionary for each.
    2.) Run through all the Assignments and place them in the right Dictionary.
    3.) Run through all the classes and remove the dictionaries for the ones without them.

    That's all good and fine. I have plenty of NSLogs showing that everything was done properly.

    But when I try making the table, it crashes.

    Does someone else have another way of doing this? Maybe you've had to do something similar and would be willing to share the code you used?
     
  2. Luke Redpath macrumors 6502a

    Joined:
    Nov 9, 2007
    Location:
    Colchester, UK
    #2
    Have you considered using Core Data to model your domain and take advantage of everything that it provides (persistence, sorting, querying etc.)?
     
  3. ArtOfWarfare thread starter macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #3
    I've yet to find any good tutorials on using it.
     
  4. Luke Redpath macrumors 6502a

    Joined:
    Nov 9, 2007
    Location:
    Colchester, UK
    #4
  5. icewing macrumors 6502

    Joined:
    Jun 19, 2008
    Location:
    St Louis
    #5

Share This Page