In article
<952e0b15-fd92-4795-966e-5e6b8b53433d@[EMAIL PROTECTED]
>,
JoeG <joe.garifo@[EMAIL PROTECTED]
> wrote:
> On Jul 1, 10:56 am, Gregory Weston <u...@[EMAIL PROTECTED]
> wrote:
> > In article
> > <8b480d16-aafe-4baa-8b32-af0eac0fd...@[EMAIL PROTECTED]
>,
> >
> > JoeG <joe.gar...@[EMAIL PROTECTED]
> wrote:
> > > I am writing a program that calculates the various scores needed to
> > > construct a DnD character. While doing the calculations, I ask the
> > > user what skills they want trained by popping up a dialog panel. I
> > > need to pause the rest of the calculations until the user pressed
the
> > > button in the dialog giving his choice. Everything I have tried so
far
> > > results in an infinite loop. Do I need to implement threading here,
or
> > > is there another option? Any suggestions would be greatly
appreciated.
> > > Thanks
> >
> > This isn't the problem threading was invented to solve; it's really
> > almost the opposite. Essentially what you need to do is put the
> > calculations on hold while collecting the new input. Just cache
whatever
> > you've got, display the dialog and let the normal event loop go. Then
> > use the dismissal of the dialog as the signal to retrieve your cached
> > information and resume the calc.
> >
> > The specific technique for doing that depends on information about
your
> > project which you haven't told us. The big question is: are you using
> > Carbon or Cocoa?
>
> I am using Cocoa and Xcode 3.0 to do this. This is also the first time
> I've used Cocoa and Objective C to do this kind of project.
So do as much work as you can/want-to up front, cache your data and/or
partial results, display the sheet, and have the did-end method you
designated gather the rest of the data from the sheet and kick off the
next phase of the calculation.
<http://developer.apple.com/do***entation/Cocoa/Conceptual/Sheets/Tasks/U
singCustomSheets.html#//apple_ref/doc/uid/20001290>
I'm not sure how to take the "to do this kind of project" phrase. If
you're fairly new to Objective-C, I'd recommend you spend the money to
get a copy of Aaron Hillegass' "Cocoa Programming for Mac OS X."
<http://www.bookpool.com/ss?qs=0321503619>
--
"Harry?" Ron's voice was a mere whisper. "Do you smell something ...
burning?"
- Harry Potter and the Odor of the Phoenix


|