How to display recently view items in iphone
Posted
by Pugal Devan
on Stack Overflow
See other posts from Stack Overflow
or by Pugal Devan
Published on 2010-06-16T17:15:05Z
Indexed on
2010/06/16
17:32 UTC
Read the original article
Hit count: 257
Hi friends,
I have created tab bar and have three views.
Tab-1 --> table view and it navigates to detail table view.
Tab-2 --> map view.
Tab-3 --> table view.(Recent view for Tab-1 items).
Now i have displayed the names in the table view in tab-1. The names are changed dynamically and displayed using XML parsing. In tab-3 is the recent view. Now i want to display the details in recent view those who visit recently in tab-1 view. I want to display only 10 items in the recent view. So i have used NSMutableArray and i have set deleagtes due to get the items in recent view from tab-1 view.
How to avoid the duplicate recent items and how to remove the older items and inserts the new recent items in recent view.
Here my sample code,
In Recent view class,
stories = [[NSMutableArray alloc] initWithCapacity:10];
items = [[NSMutableDictionary alloc] init];
NSString *preferName = [devDelegate getCurrentAuthor]; //(get name dynamically)
[items setObject:preferName forKey:@"preferName"];
[stories addObject:[items copy]];
cell.textLabel.text = [[stories objectAtIndex:storyIndex] objectForKey:@"preferName"];
So please guide me to how to achieve this.
Thanks.
© Stack Overflow or respective owner