Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
The UITableView is Populated using the NSMutuableArray.
I had displayed values from NSArray into the UITableViewCell,
What i need is delete the individual cell from TableView, for this i need to delete particular element from nsArray using [ removeObjectAtIndex: indexPath.row]; and then reload the tableview.
What else i am suppose to do, Do i need to write any tableView Delegate Methods.
Is your array stored somewhere like in a plist? Because if your declaring it on viewDidLoad with all its objects and remove one during runtime, the next time your app loads it will be back. I suggest if you want to populate a table view with array data and be able to delete, then save a NSArray to NSUserDefaults and use setObject, and removeObjectAtIndex.
I'm not 100% sure I understand the problem you're having, but are you using the TableViewDataSource protocol? If you are, and you're implementing
tableView:commitEditingStyle:forRowAtIndexPath:
then you should be able to handle changing the data source and animating the deletion of the row in one stroke. That method is called when the tableview is sent an "insert" or "delete" message and is basically there to allow the TableViewDataSource to make changes to match the view's content.
Also, are you using Core Data to model your content? it seems like persisting your data in a relational model instead of custom objects might be easier. That way each array is only holding an fundamental object (NSString, int, BOOL), and that's all tied together at runtime
so what's the correct one? I might use that instead so the user will at least know that the cell is being deleted by fading out the cell or something.
Insert or delete rows. Reloading the whole table is brute force. See the overview presentation in the table view link in my signature. I really need to get the next blog post written.
Insert or delete rows. Reloading the whole table is brute force. See the overview presentation in the table view link in my signature. I really need to get the next blog post written.
Replies
oh btw, you should use NSMutableArray
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeBut that just my 2 cents.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeSlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeBut, Now i have to update the plist by updated NSMutableArray.
Let the Custom Object be z
z { fname, lastname, address }
My NSMutableArray A consists of Custom Object z not Just One Element in the NSMutableArray
Now due to custom object i am unable to use writeTofile in plist with updated NSMutableArray.
could someone suggest something on the issue
Thankx for any reply.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesometableView:commitEditingStyle:forRowAtIndexPath:
then you should be able to handle changing the data source and animating the deletion of the row in one stroke. That method is called when the tableview is sent an "insert" or "delete" message and is basically there to allow the TableViewDataSource to make changes to match the view's content.
Also, are you using Core Data to model your content? it seems like persisting your data in a relational model instead of custom objects might be easier. That way each array is only holding an fundamental object (NSString, int, BOOL), and that's all tied together at runtime
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomethanks
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeSlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome