• 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
Re: Loading data in a background thread and displaying it with Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading data in a background thread and displaying it with Bindings


  • Subject: Re: Loading data in a background thread and displaying it with Bindings
  • From: "Paulo F. Andrade" <email@hidden>
  • Date: Thu, 9 Aug 2007 11:50:36 +0100

Hi,
I finally got it working.
I was using a wrong predicate (I really should not code past midnight, everything starts going wrong). Now it is working.


Thanks for the tip.

BTW can the predicate set in IB for NSArrayControllers have arguments?

Paulo F. Andrade 52439@IST
mailto: email@hidden



On 2007/08/09, at 00:54, Paulo F. Andrade wrote:

I've tried that, and couldn't get it working.

I think the problem is that my itemsArrayController is bound to the selection.items of listArrayController. I'm using a master/detail interface.

Programatically i've set the entityName and the fetchPredicate (@"inList = %@", currentList) on the itemsArrayController followed by a fetch:, but the NSTableView isn't updated.


As an update to my previous e-mail.

I said I had it working by passing all the objectIDs of objects that where inserted and updated on the background thread to the main thread. And then issuing a refreshObject:mergeChanges: on the main thread to every one of those objects.

This is slow and I know I'm doing unnecessary work. As an attempt to speed this up, I've tried issuing that refreshObject:mergeChanges: only to "Item" objects, and it doesn't work anymore. The view isn't updated.

I am now very confused...

<joke>
Maybe I could tell my users that the fastest way to see the changes the background thread did is to restart the application :P
</joke>


Paulo F. Andrade 52439@IST
mailto: email@hidden



On 2007/08/09, at 00:02, mmalc crawford wrote:


On Aug 8, 2007, at 2:51 PM, Paulo F. Andrade wrote:

So... how can I tell my NSArrayController (the one bound to Items and the NSTableView) to forget what he has and fetch everything again? An [arrayController reload] would be great!!

fetch:?
<http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/Classes/NSObjectController_Class/Reference/ Reference.html#//apple_ref/occ/instm/NSObjectController/fetch:>


mmalc


_______________________________________________

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:
40mega.ist.utl.pt


This email sent to email@hidden

_______________________________________________

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


References: 
 >Loading data in a background thread and displaying it with Bindings (From: "Paulo F. Andrade" <email@hidden>)
 >Re: Loading data in a background thread and displaying it with Bindings (From: mmalc crawford <email@hidden>)
 >Re: Loading data in a background thread and displaying it with Bindings (From: "Paulo F. Andrade" <email@hidden>)

  • Prev by Date: Re: Integrating Unix scripting in Cocoa app
  • Next by Date: How to store the values of a NSForm in the user defaults as an array?
  • Previous by thread: Re: Loading data in a background thread and displaying it with Bindings
  • Next by thread: mouseMoved: or multiple trackingRects?
  • Index(es):
    • Date
    • Thread