You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 1, 2017. It is now read-only.
Here's the scenario: I have a TUIView called ExampleView acting as the rootView of a TUINSView and I want to add an NSView to it. So I copy the following code from TwUI's ExampleProject and paste it to ExampleView's initWithFrame: method.
It was supposed to show a text field on the screen. However it just showed a blue rectangle instead (the TUIViewNSViewContainer).
So I looked into the source of TUIViewNSViewContainer. It tried to add the NSView to its ancestorTUINSView's appKitHostView. However, at that time the TUIViewNSViewContainer's ancestorTUINSView property is still nil becasuse here's how we initialize the ExampleView in the ExampleAppDelegate:
The ExampleView's nsView property is set in the last statement when TUINSView's setRootView method is called. So adding a NSView to TUIView in the initWithFrame: method before it won't work.
The ExampleProject works because text fields are added to the table cells, which are initialized after TUIViewNSViewContainer's nsView is set.
The text was updated successfully, but these errors were encountered:
Here's the scenario: I have a TUIView called ExampleView acting as the rootView of a TUINSView and I want to add an NSView to it. So I copy the following code from TwUI's ExampleProject and paste it to ExampleView's
initWithFrame:
method.It was supposed to show a text field on the screen. However it just showed a blue rectangle instead (the TUIViewNSViewContainer).
So I looked into the source of TUIViewNSViewContainer. It tried to add the NSView to its
ancestorTUINSView
'sappKitHostView
. However, at that time the TUIViewNSViewContainer'sancestorTUINSView
property is still nil becasuse here's how we initialize the ExampleView in the ExampleAppDelegate:The ExampleView's
nsView
property is set in the last statement when TUINSView'ssetRootView
method is called. So adding a NSView to TUIView in theinitWithFrame:
method before it won't work.The ExampleProject works because text fields are added to the table cells, which are initialized after TUIViewNSViewContainer's nsView is set.
The text was updated successfully, but these errors were encountered: