Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-21-2011, 03:30 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 64
algor_angel is on a distinguished road
Unhappy CoreData: Cancel button doesn't prevent modified entity to save changes

Hello guys. Once again I need your help!

I have the following scenario: I create an Entity of a NSManagedObject the same way that Apple uses in it's CoreDataBooks code sample. This part works fine: If, during editing you press on 'Cancel', the addingContext is set to nil and the changes are discarded, or, if you press 'Save' the addingContext and the mainContext are merged and the changes saved.
Now, when I open the detailView for one of the created entities I press on the 'Edit' button which opens the same modalView as above but passing the current Entity and a new context (named 'editingContext') to it. The detailViewController implements the same delegate method as the rootViewController in the same way. If the the user presses 'Save' it should merge the editingContext and the main one, otherwise it should just set the editingContext to nil and dismiss the modalViewController.

The problem is that, for some reason, the changes are saved anyway, not matter what button I press. I tried to call also the 'undo' or the 'rollback' methods when the 'Cancel' button is pressed, but with no success.

Do you have any idea why this happens?
algor_angel is offline   Reply With Quote
Reply

Bookmarks

Tags
cancel, core data, core data entities

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 395
14 members and 381 guests
7twenty7, eski, EvilElf, HemiMG, iOS.Lover, jarv, n00b, pbart, Pudding, sacha1996, Sami Gh, UMAD, VinceYuan, yuncarl28
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,905
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:14 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0