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.
CoreData:User creates new record, but then cancels = trash.. thoughts...
Hi all, I need some feedback on something I would like to improve in my apps. I have several Business apps, and they use CoreData. When a user wants to add a new record, I create one and save it to the database, then show the ViewController to edit the record. The side affect of this approach is that , if the user cancels, then there is a "half baked" record hanging out there, that shows up and confuses the user.
Ideally, I would like for the record to no longer exist if the user hits cancel. I have some ideas but I don't think they are good solutions, as they open the door for more bugs. Whats the right way to do this?
Solution I haven't tried yet: specify nil for the context when creating the object. Insert it into the context when the user saves.
Solution I have done: create a placeholder instance, with some kind of flag that keeps it out of regular usage. The edit screen deals with this instance. When the user saves, create a new instance and copy over the necessary properties from the placeholder.
Replies
Solution I have done: create a placeholder instance, with some kind of flag that keeps it out of regular usage. The edit screen deals with this instance. When the user saves, create a new instance and copy over the necessary properties from the placeholder.
SlickShopper 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