Re: Mac containment segues, and prepareForSegue
Re: Mac containment segues, and prepareForSegue
- Subject: Re: Mac containment segues, and prepareForSegue
- From: Roland King <email@hidden>
- Date: Tue, 28 Oct 2014 08:53:58 +0800
> On 28 Oct 2014, at 7:30 am, Fritz Anderson <email@hidden> wrote:
>
> This is Yosemite, in Swift under Xcode 6.1.
>
> The summary: I don’t understand NSStoryboard containment relationships. I’ve never received a prepareForSegue(_, sender:), and without it, I can’t figure out how to propagate data from a document into its views.
>
> This is completely elementary. I can’t figure it out. What am I missing?
>
>
> My prepareForSegue()s are never called. I had my suspicions: Interface Builder does not let you edit the containment “segues,” meaning you can’t assign an intelligible identifier to guide the prepare function in initializing the incoming controller.
Are you sure you’re talking about ‘Containment’ segues here? Containment segues for me are the ones marked ‘Embed’ which go between Container Views and the thing they contain And those are editable and you can add identifiers to them and they trigger prepareForSegue in the NSViewController subclass at the front end. I just tested one.
Are you talking in this case about the thing which looks like a segue and goes from the NSWindowController to the main NSViewController and is designated a ‘Relationship Segue’? Seems that’s also the type between NSSplitViewController and its splits? Indeed they appear to be uneditable and not like real segues at all despite being listed in the ‘Triggered Segues’ of the View Controller they come from.
>
> As far as I can tell:
>
> * They are “segues” only in the sense that they are lines drawn between scenes in a storyboard. They do not share any other characteristic.
>
> * There is no property or function in NSWindowController giving access to the “window content controller,” despite IB’s insistence that there be one.
>
> * IB affords no way to access the containment relationship or the controllers at either end of it.
>
For ‘Relationship’ segues that appears to be correct, other segues seem to work much as they do on iOS.
That also begs the question as to why NSWindowController supports prepareForSegue since I can’t find a way to hook it up to anything except by a relationship segue which as you say appears not to actually be a segue.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden