Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

How can i load data into this tableView from my arrays

I want to display the data in a way like this in my TableVIew. I have 3 sets of arrays

1. Category Arrays
2. Album Arrays
3. Track Arrays

Category1 may contains many Albums and each Album contains many tracks .... Category2 may contains many Albums and each Album contains many tracks ....

how can i configure the section and rows in my tableView. Any one give me an idea how can i do it

1.CATEGORY 1

ALBUM1

Track 1

Track 2

ALBUM2

Track 1

Track 2

2.CATEGORY 2

ALBUM1

Track 1

Track 2

.... and son on


image
Post edited by devcoder on

Replies

  • ebender001ebender001 Posts: 103Registered Users
    devcoder;389645 said:
    I want to display the data in a way like this in my TableVIew. I have 3 sets of arrays

    1. Category Arrays
    2. Album Arrays
    3. Track Arrays

    Category1 may contains many Albums and each Album contains many tracks .... Category2 may contains many Albums and each Album contains many tracks ....

    how can i configure the section and rows in my tableView. Any one give me an idea how can i do it

    1.CATEGORY 1

    ALBUM1

    Track 1

    Track 2

    ALBUM2

    Track 1

    Track 2

    2.CATEGORY 2

    ALBUM1

    Track 1

    Track 2

    .... and son on

    There is a UITableViewDelegate method for that:
    - (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath


    Ed
  • devcoderdevcoder Posts: 7New Users
    i doesn't means the Indenting .... What i want to know is how can i add and delete the rows if appropriate rows are selected ... like expanding and collapsing ...
  • Duncan CDuncan C Posts: 8,015Tutorial Authors, Registered Users
    devcoder;389679 said:
    i doesn't means the Indenting .... What i want to know is how can i add and delete the rows if appropriate rows are selected ... like expanding and collapsing ...
    So you want each category to be empty initially, with a disclosure triangle on it? Then, when the user taps on it, you want it to "open up" and display the data for that category?

    We do something very much like that in the help system for our apps "Kevin and Kell" and "Save My Place". (Save My Place is only $0.99. You might want to download it to see if its help (info) screen is doing what you want)

    What we do is create an array of booleans "section is open" for each section of items.
    If a section is not open, we return 1 in response to the numberOfRowsInSection data source call for that section.
    (The only row is the section heading with the disclosure button.)

    If the user taps a section, we change a flag to indicate that that section is now "open," and insert the extra rows for that section into the table view using the insertRowsAtIndexPaths:withRowAnimation: method.
    Regards,

    Duncan C
    WareTo

    mug

    Animated GIF created with Face Dancer, available for free in the app store.
  • michellemichelle Posts: 208Registered Users
    Duncan C;390370 said:
    So you want each category to be empty initially, with a disclosure triangle on it? Then, when the user taps on it, you want it to "open up" and display the data for that category?

    We do something very much like that in the help system for our apps "Kevin and Kell" and "Save My Place". (Save My Place is only $0.99. You might want to download it to see if its help (info) screen is doing what you want)

    What we do is create an array of booleans "section is open" for each section of items.
    If a section is not open, we return 1 in response to the numberOfRowsInSection data source call for that section.
    (The only row is the section heading with the disclosure button.)

    If the user taps a section, we change a flag to indicate that that section is now "open," and insert the extra rows for that section into the table view using the insertRowsAtIndexPaths:withRowAnimation: method.
    I'm having a bit of a problem trying to visualize what your trying to do.

    We came up with some lazy load tableviews that might give you want you want in a little bit different ui then what you are describing.

    Lazy load facebook album cover images - Life in The Clouds
    Help us build great applications or let us make your applications exceptional. We are experts in all types of streaming find us on Facebook
Sign In or Register to comment.