Posts

Post marked as solved
4 Replies
772 Views
Hello, I have a main window with a vertical split view. The NSSplitView has an NSOutlineView on the left and an empty space on the right. When the user clicks on a filename in the outline view, an NSTextView is created dynamically from a nib and displayed on the right side of the NSSplitView. The NSTextView controller also dynamically creates an NSRulerView in its viewDidLoad and adds the ruler to the NSTextView's NSScrollView. Oddly, I've noticed that if I have the mouse pointer in the NSTextView's area and move it left into the NSRulerView's area, the pointer changes from an I-Beam to an arrow, as expected. If I move the mouse pointer from the NSOutlineView and to the right, over the NSSplitView divider and into the NSRulerView, the pointer immediately turns into an I-Beam when it reaches the NSRulerView. I experimented a little bit with resetCursorRects with no luck. Anyone have any ideas how to get the expected behavior of the pointer to turning to an arrow when coming from the left... or even how to approach debugging this? Thank you!
Posted
by yoppeh.
Last updated
.
Post marked as solved
3 Replies
596 Views
I'm writing a Mac OS app in Objective-C. The mainWindowController has a vertical NSSplitView in the application's window. This split view is in the mainWindowController's nib file. In mainWindowController's viewDidLoad, I instantiate two child controllers--call them A and B. A and B each have their own nib that contains nothing but an NSView. Later, A and B will instantiate children objects in their own viewDidLoad, giving a hierarchy. As you may expect, A's view and B's view form the left and right panes of the mainWindowController's split view. Herein lies the problem. When I instantiate each object in mainWindowController, I don't know if their views actually exist after the alloc/init call. In fact, I believe I should assume they do not yet exist. mainWindowController must add A and B to its split view and then create the autolayout constraints for both A and B, since they are relative to each other. So, in mainWindowController, how can I know when A and B have loaded their views so that I can add them to the split view and setup the proper autolayout constraints? I can think of some ways to implement this, but each solution is uglier than the last. What is the best practice here? As I mentioned, A and B will be creating their own subviews, etc, so this is a general problem I will have to deal with in this app. I appreciate any input!
Posted
by yoppeh.
Last updated
.