Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

grandM

macrumors 68000
Original poster
Oct 14, 2013
1,568
329
So I have this splitview. On the left hand side you have the tableView. It has this plus sign. When I tap it I create a new managedObject Woman. I set a stored variable property on detailVC called woman. Then I segue from detailVC to editVC changing data. When I hit the plus sign everything works as it should.

When however I first select another woman in my tableView (showing her data on the detailVC) and then hit the plus I'm not seguing. Anyone know why?

Code:
self.detailViewController!.woman = woman
self.detailViewController?.managedObjectContext = self.managedObjectContext
self.detailViewController?.performSegueWithIdentifier("editWomanSegue", sender: self.detailViewController!
)

I looked in the prepareForSegue of the detailVC. In prepareForSegue of detailVC I'm doing:
Code:
let editVC = segue.destinationViewController as! EditWomanViewController

            editVC.managedObjectContext = self.managedObjectContext

            editVC.woman = self.woman
I put a print on the setting of the woman stored variable property in editWomanVC and yes it is set. Only problem is the View is not shown or loaded (viewDidLoad isn't called for) :s
 
Last edited:
I might have found the solution. I have it running now. I solved it by first performing a segue from the masterVC to the detailVC. In the detailVC I'm performing again a segue to the editWomanVC when an attribute of woman is empty in the detailVC. This works. I still wonder why I could not perform a segue on the detailVC with
Code:
       self.detailViewController?.performSegueWithIdentifier("editWomanSegue", sender:self.detailViewController!)
though. I hope this answer will save somebody else a lot of cursing though.
 
I think I know where the problem resolved of. It seems if you have a split view and segue from the detailVC to editWomanSegue the mainVC does not appear in editWomanSegue's navigation stack...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.