Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password

Mac > Mac Programmer Help > Re: Delay help
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 3789 of 3849
Post > Topic >>

Re: Delay help

by Gregory Weston <uce@[EMAIL PROTECTED] > Jul 2, 2008 at 02:42 PM

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
 



 5 Posts in Topic:
Delay help
JoeG <joe.garifo@[EMAI  2008-06-30 19:51:22 
Re: Delay help
Gregory Weston <uce@[E  2008-07-01 10:56:59 
Re: Delay help
JoeG <joe.garifo@[EMAI  2008-07-02 06:54:48 
Re: Delay help
Gregory Weston <uce@[E  2008-07-02 14:42:42 
Re: Delay help
Simon Slavin <slavins.  2008-07-03 21:20:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 7 19:00:43 CDT 2008.