iPhone Uitableview. How Do Turn on the Single Letter Alphabetical List Like the Music App

Can I add an alphabet jump list to a tableview like the contact list

There is a comprehensive tutorial on how to do it in the "Table View Programming Guide", called "Populating an Indexed List".

Moreover, if you also need to have the search functionality (the magnify icon), there are two well written solutions:

  • http://iamthewalr.us/blog/2009/12/uisearchdisplaycontroller-and-uilocalizedindexedcollation/
  • http://lukeredpath.co.uk/blog/using-uilocalizedindexedcollation-with-searchable-table-views.html

What is the Vertical Alphabet in the iOS Phonebook Called?

It's called an "indexed list" or "section index" in the documentation.

For a quick hint, look at the documentation for the UITableViewDataSource sectionIndexTitlesForTableView: and tableView:sectionForSectionIndexTitle:atIndex: methods.

For more detailed information, check out the Populating an Indexed List section of the Table View Programming Guide

Displaying Elements in UITableView like iPhone contacts, separated into alphabetical sections?

Add alphabetic sections to ur tableview, then You have to create array of alphabets corresponding to the section in tableview. Like section[0] - 'A', section[1] - 'B', etc.

Add
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
return keys;
}
//the delegate is asking for an array of the values to display in the index.

So the first item in this array will take the user to the first section, which is section 0.

How to get a TableViewCell like Phone.app-Recents tab or Mail.app-mail list

Maybe change the accessoryView of the cell, as there is no 'style' like the the one you want. Still, a custom cell class might make things easier.

An enumeration for the various styles of cells.

typedef enum {
UITableViewCellStyleDefault,
UITableViewCellStyleValue1,
UITableViewCellStyleValue2,
UITableViewCellStyleSubtitle
} UITableViewCellStyle;

The type of standard accessory control used by a cell.

typedef enum {
UITableViewCellAccessoryNone,
UITableViewCellAccessoryDisclosureIndicator,
UITableViewCellAccessoryDetailDisclosureButton,
UITableViewCellAccessoryCheckmark
} UITableViewCellAccessoryType;

Sorting Array of Objects alphabetically based on a string attribute

There are several good examples here on SO. Here is a good example:

How to sort an NSMutableArray with custom objects in it?

How to check MPMusicPlayerController permission?

MPMediaLibraryAuthorizationStatus authorizationStatus = MPMediaLibrary.authorizationStatus;

switch (authorizationStatus)
{
case MPMediaLibraryAuthorizationStatusAuthorized:
{
break;
}
case MPMediaLibraryAuthorizationStatusNotDetermined:
{

break;
}

case MPMediaLibraryAuthorizationStatusRestricted:
case MPMediaLibraryAuthorizationStatusDenied:
{
break;
}
}


Related Topics



Leave a reply



Submit