On 27.03.2010, at 16:57, Ken Thomases wrote:

"separation of concerns" is just the case.

Except the timing does not impact on separation of concerns.

I'm not about timing. I'm just about code separation. Initialization is a part of dialogue, so its window controller is the right place, where this code should be located and where it should be called. But now it is called from the "main" AppController, where the dialogue is created and where runModalForWindow sits. Usually only initialization methods, using some data from the calling object, should be called from the calling object. At least we must do our best to minimize their number. In my case I have to call a pure "inner", I'd even say, "private" object method from outside of the object code. In my opinion it's not correct, though it's not so meaningful in this particular case. I'm just about a good style.

The controller, the C in MVC, should be responsible for the process, whether it is initiated before the window is show or after.

Is "C" the window controller in my case? I believe, it is.

If the modal event loop processed all of the same events as the main event loop, then it wouldn't be modal -- the user would be able to do things outside of the modal window, like clicking on buttons in another window, or selecting menus not related to the modal window. So, I don't know how you expect that to work differently. But this has _nothing_ to do with notifications.

Of course, I had in mind all events, related to the modal window. All other events should be ignored. But windowDidExpose: notification is related to the window, and it is called after I call runModalForWindow: Isn't it? Then why it doesn't reach my window controller, which is set as a window delegate? Where is the logic? It looks as a bug rather than as a feature...

As we saw with NSFileHandle, where necessary it is usually quite easy to ask for an event or runloop source to operate in the modal runloop mode. It's just not a big problem. It seems like you're inventing aggravation for yourself.

There was an explicit method how to call a notification, when we talked about NSFileHandle. But In the case of windowDidExpose: I don't see any way how to tell it to Cocoa that I'd like to get this notification.

Thanks.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to