Re: beginSheetModalForWindow: and Distributed Objects
Re: beginSheetModalForWindow: and Distributed Objects
- Subject: Re: beginSheetModalForWindow: and Distributed Objects
- From: "Michael Ash" <email@hidden>
- Date: Wed, 30 Apr 2008 18:31:50 -0400
On Wed, Apr 30, 2008 at 5:29 PM, Andrew Kimpton <email@hidden> wrote:
>
> On Apr 30, 2008, at 3:59 PM, Michael Vannorsdel wrote:
>
>
> > This is true of course but since he's getting loop mode issues I'm just
> assuming either he's actually running a modal window or displaying a sheet
> on a modal window. If it's a normal stock sheet there would have been no
> issues with NSConnection.
> >
>
> I'm simply calling beginSheetModalForWindow: on a 'regular' window (this
> isn't a document based app - but the window in question isn't modal either).
>
> So from Mike Ash's comments it seems like something else must be going on.
> What set me down this path is the comment in the docs for [NSApplcation
> beginSheet: modalForWindow: ...] (which I assume [NSAlert
> beginSheetModalForWindow: calls ?)
>
> Use this method in cases where you do not need to do any additional
> background processing while your sheet runs. This method consumes only
> enough CPU time to process events and dispatch them to the action methods
> associated with the sheet. If you want to perform additional background
> processing, use runModalSession:together with an NSModalSession object
> instead.
>
> The comment about additional background processing is confusing to me. Does
> handling messages on an NSConnection count as background processing ? Do I
> have to go to the expense of using runModalSession: (Mike Ash's comments
> seem to suggest not, it should 'just work')
This comment is completely bizarre. It looks like it was lifted
straight out of runModalForWindow:, where it actually makes sense, and
pasted into a completely different method where it makes no sense.
Anyway, yes, it should just work. To find out what's causing it not
to, I suggest installing a timer that just logs a message or something
similar. If it keeps firing while your sheet is up then you know the
runloop isn't being blocked and your problem is caused by something
else. If it stops firing then you know that something is blocking your
runloop and you need to find out what it is. In this case, pausing the
debugger while the sheet is visible and examining the call stack
should tell you what's blocking it.
Mike
_______________________________________________
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