johnyios johnyios - 2 months ago 13
iOS Question

how to reload or refresh an array

in my array i stored database value and delete by user that time i want to reload the array.how to refresh the array?.i also reload table but i not helful for me i want at a time effect on table.

i tiered to use this:

[tableview begineUpdate];
[tableview reloadrowatindexpath:withanimation:];
[tableview deleterowatindexpath:withanimation:];
[tableview endupdate];


for array i alse used this:

array = [NSMutablearray new];

Answer

before reload the table you just removearrayatindexpath

or recall ur array befor reloading the table

//if u are not using in `tableview` method
[tableview begineUpdate];
//here you call ur array again
[tableview reloadrowatindexpath:withanimation:];
[tableview endupdate];
Comments