开发者

Highlighting table rows only on the first 3 app uses

I want to highlight -color-my 开发者_开发知识库app's new rows when i release a new update or when i add a new row. Also, i want to keep them highlighted only when the user uses my app at least 3 times. How can i do it? Thanks in advance


Store in the NSUserDefaults a value for each new table row remembering how many times they've been viewed. Increment a number in the applicationHasFinishedLaunching for each of the rows. If the row's view count is more than 3, remove it. When rendering look up the row id in the NSUserDefaults and check to see if it should be highlighted.

Adding new rows..

 [[NSUserDefaults standardUserDefaults] setInteger:0 forKey:myRowId];

Rendering..

 if ([(NSInteger*)[[NSUserDefaults standardUserDefaults] integerForKey:myRowId] intValue] < 3) { 
  // render highlighted...
 } else {
  // render normal
 }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜