• 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
Outline view and expanding most recent item
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Outline view and expanding most recent item


  • Subject: Outline view and expanding most recent item
  • From: Andrew Merenbach <email@hidden>
  • Date: Fri, 3 Aug 2007 07:52:38 -0700

Hi, all,

I've worked through my earlier bug from yesterday--partially--and without knowing exactly what I've been doing. The situation as it now stands is:

I have an outline view and I want to expand the most recent item. The addition of the item, to the main NSManagedObjectContext, is done in a separate thread (note that I don't manipulate the app delegate's managed object context from the thread, but rather create a new context with the original's persistent store coordinator, then save it while in the new thread).

The new item shows up, on schedule (as far as I can tell), in the log tree controller. Now, after calling my managed-object-creation code I call another method, to finish the processing of the data, on the main thread. I query the outline view's -numberOfRows, then go through and try to expand the most recent item. But... -numberOfRows returns the old number of rows, so the next-to-last item is expanded (if I clear everything from my tree controller and run my code, I get an error due to the range being messed up)! If I try to get the latest row (by adding one) I of course get an error.

So what might be the problem here? I call -fetch: on my tree controller in my main-thread post-processing code. I can see the new item appear virtually immediately, and I am calling my post- processing code on the main thread, so the new item should be ready and waiting for me, right?

Cheers,
	Andrew
_______________________________________________

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


  • Prev by Date: Re: NSTableView searching and predicates
  • Next by Date: Re: [SOLVED] Loading NSFont from file
  • Previous by thread: Re: NSTableView searching and predicates
  • Next by thread: Making my own constants for Cocoa structs
  • Index(es):
    • Date
    • Thread