I have the following data structure, which I cannot change (probably the most important part of this question):
<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>FirstName</key>
<string>John</string>
<key>LastName</key>
<string>Adams</string>
</dict>
<dict>
<key>FirstName</key>
<string>Henry</string>
<key>LastName</key>
<string>Ford</string>
</dict>
</array>
</plist>
I can successfully read this into an NSArray
of class type of Person
(which I created) and well as show this list in a UITableView
.
What I would like to do with this data now is show it in sections, by the first letter in their last name as well as show the SectionIndexList
.
How can I transform this data (not the data source), or leave it intact and query it directly in my DataSource
for UITableView
so I can section it off by the first letter in their last name?
Thanks in advance.
You should do something like:
And implement this methods for the section index titles;
If you have any doubts, there are plenty of tutorials:
Hope it helps!!