|
|
#1 |
|
UITableView / array question
I have a tableivew that is populated from an array. Each index of the array is an NSDictionary with a list of food a person has eaten that day. As I am testing this part of my app over the last couple of weeks I am noticing that I am having to scroll down the list for quite some time to get to the current day.
I decided it is best to show the current day at the top of the list in stead of the bottom. Is the best approach just to invert the array that the tableView uses as it's data source? So the last object becomes the first object and so on?
__________________
I know more than yesterday. Lars |
|
|
|
0
|
|
|
#2 |
|
Having the order of the data model be the same as the order of the rows in the table makes things simpler. Simple is good. Obviously it would be possible for you to write a rowDictionaryForIndexPath: method that would have whatever logic is needed to get the row dictionary but simpler is better.
|
|
|
|
0
|
|
|
#3 | |
|
Quote:
Thanks!
__________________
I know more than yesterday. Lars |
||
|
|
0
|
|
|
#4 |
|
Why not just insert new items at row zero?
|
|
|
|
0
|
|
|
#5 |
|
Huh, So instead of adding the dict to the end of the Array like I am doing, which I would have to invert. Insert the dict to the beginning of the array.
This is why I like this board. I didn't even think of that. Thanks!
__________________
I know more than yesterday. Lars |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 04:00 AM.







Linear Mode
