core data - IOS/Xcode/CoreData: In Modal Controller how to Reference Presenting Controller -


i have modal controller controller2 edits view, created modally controller1. modal controller2 configured in storyboard launched controller1 in following code in viewdidload follows.

uibarbuttonitem *editbutton = [[uibarbuttonitem alloc]                                    initwithtitle:@"edit"                                    style:uibarbuttonitemstyleplain                                    target:self                                    action:                                    //next line calls method editview                                    @selector(editview:)];     self.navigationitem.rightbarbuttonitem = editbutton; 

when dismiss controller2 after saving changes, want change in managedobjectcontext carried on controller1.

some examples on suggest using following:

[controllertarget setmanagedobjectcontext:[self managedobjectcontext]]; 

which go in controller2 right before dismissing it.

however, trying gives error "no known class method" suggesting have instantiate controller 1. however, don't want create new instance of controller1 , pass managed object context it. want pass managedobjectcontext instance of controller1 in navigation stack.

would appreciate suggestions how make work.

thank you.

have tried storing property managed object context in controller1 , using exit segue pass controller2 state , hence use instantiate managedobjectcontext stored in controller1. should work.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -