0

I have array of strings

 NSMutableArray * nam = [[NSMutableArray alloc] initWithObjects:@"ZAZ", @"London", @"Australia",@"England", @"Dallas", @"Mexico", @"Russia", nil]; 

How I can create indexed TableView from this string alphabetically??? Like in "Contacts"! Or maybe somebody know some lessons with this problem?

1
  • You can sort first your array alphabetically and then use that sorted array in table view .. Commented Aug 9, 2012 at 11:02

1 Answer 1

2

Edit : Create UITableView follow link. Use newArray as tableview array

Sort your NSMutableArray alphabetically like this:

NSMutableArray *newArray = [nam sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)];

Use this newArray as TableViewDataSource array for alphabetically ordered cells

Sign up to request clarification or add additional context in comments.

2 Comments

ok. And how I add indexes? And how to do so by clicking on index a table jumped to section???
iphonesdkarticles.com/2009/01/… Simple project with index table)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.