• 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
NSThread vs NSTimer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSThread vs NSTimer


  • Subject: NSThread vs NSTimer
  • From: Jeff Evans <email@hidden>
  • Date: Fri, 11 Oct 2002 15:47:00 -0500

I'm hoping someone else has come across this problem and solved it, since it's been bugging me for months, and I haven't found the answer anywhere.

I've got an application that is hooked up to the cable tv network on campus to become the preview channel. The top half shows messages that get updated once every 5 seconds (not often) while the bottom half scrolls an NSImage containing the show schedule. I want the show part to scroll quickly, and not get interrupted by the message part updating. At first I tried using threads, but found out at the end of the project that the AppKit, while claiming to be cool with threads, didn't like them with views. My program would work for a while, then mysteriously crash or block on a internal apple lock. Now, I've redesgned it to use timers, but my show scrolling image stutters when both it and the message area copy their image to the window. I implement scrolling by updating the frame of an NSView that uses compositeToPoint to copy its NSImage to the window (I know I could use NSImageView, but I don't want to make assumptions on how I or someone else might implement more view types).

One solution would seem to be have my plugins (that create the nsview that draws the nsimage) return a nsimage instead of view. Then, I can use threads again, right? Well, I'd like to be able to include animations or movies inside the views, as in while it's scrolling, there's something inside it changing.

So, if threads are cause lockups, and timers are sychronous, what can I do? Please help!

-Jeff
_______________________________________________
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: NSThread vs NSTimer
      • From: Cameron Hayne <email@hidden>
  • Prev by Date: Re: East Coast Cocoa Retreat? Re: Toronto cocoa programmers?
  • Next by Date: looking for code snippet
  • Previous by thread: Re: [OT] swapfile on other partition
  • Next by thread: Re: NSThread vs NSTimer
  • Index(es):
    • Date
    • Thread