Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableView Indexing
    primarykey
    data
    text
    <p>I have an indexed table view that organizes cities in a state by their first letter. What I have working is an NSMutableDictionary is created with the keys of A,B,C,etc. and the corresponding cities are added to their respective arrays. ex:</p> <pre><code>Y = ( Yatesboro, Yeagertown, York, "York Haven", "York New Salem", "York Springs", Youngstown, Youngsville, Youngwood, Yukon ); Z = ( Zelienople, Zieglerville, "Zion Grove", Zionhill, Zionsville, Zullinger ); </code></pre> <p>now, my table view loads with the correct number of sections, and rows within the sections and the indexing control works fine with this:</p> <pre><code>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return [cities count]; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { if([searchArray count]==0) return @""; return [searchArray objectAtIndex:section]; } // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [[cities objectForKey:[searchArray objectAtIndex:section]] count]; } - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index { NSLog([NSString stringWithFormat:@"clicked index : %i",index]); if (index == 0) { [tableView scrollRectToVisible:[[tableView tableHeaderView] bounds] animated:NO]; return -1; } return index; } </code></pre> <p>My issue is now populating the text of the table cell with the text for each section...Any thoughts on how I can grab this info?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload