开发者

iphone Table View Issue

开发者 https://www.devze.com 2023-02-09 19:46 出处:网络
开发者_运维技巧i have two arrays one for search bar and other for contact array. and first one display as tableview. the problem is that when i select two contacts from contact list and then i try t

iphone Table View Issue

开发者_运维技巧

i have two arrays one for search bar and other for contact array. and first one display as tableview. the problem is that when i select two contacts from contact list and then i try to go on my search bar the selected contacts gone as shown in figure 2.

i try to reload table data but it didnot work. please help me... tha nks in advance.


You have a issue with the cells my best guess you have to do something like this before acctually drawing the cell in cellForRowAtIndexPath:

        cell.clearsContextBeforeDrawing = YES;

If that doesn't work it's probably a problem with the indexPath, could you provide some more information related to the code?


If your cells are being released or redrawn at any point, they won't remember they were selected unless you are storing this data somewhere. The cells will be redrawn to their original state OR potentially reused if you are enabling this. I would track your selected cells alongside your contacts array (maybe an NSDictionary?).

0

精彩评论

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