• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTimers starting, stopping, pausing...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTimers starting, stopping, pausing...


  • Subject: NSTimers starting, stopping, pausing...
  • From: David Newberry <email@hidden>
  • Date: Sat, 11 May 2002 00:41:51 -0700

Hello all,

I am messing around with making a game, and to draw something repeatedly, I am looking at using an NSTimer to continuously send a message to my NSOpenGLView subclass.

The game basically needs to do three things: Start, Stop and Pause. To start, I call scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:. I'm most unsure about this call... should I not call it after the timer has previously been created and invalidated?

To stop the timer, I send the invalidate message.

To pause or unpause the timer, I set a global BOOL variable to either YES or NO, and check its value in the method which is called by the timer.

At no point (except in the initializing method) do I ever set my timer variable to nil. However, I am getting a EXC_BAD_ACCESS messages. This is confusing to me. Is it because of the invalidate message? Possible to tell from the info I've given?

Thanks all.

Peace,
-David Newberry
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSTimers starting, stopping, pausing...
      • From: Chris Kane <email@hidden>
  • Prev by Date: Re: CICN resource into NSImage?
  • Next by Date: Bundle identifiers
  • Previous by thread: Re: Minor filesize differences between "info" inspector and NSFileManager on SOME files.
  • Next by thread: Re: NSTimers starting, stopping, pausing...
  • Index(es):
    • Date
    • Thread