• 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
NSArrayController not rearranging correctly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArrayController not rearranging correctly


  • Subject: NSArrayController not rearranging correctly
  • From: Markus Spoettl <email@hidden>
  • Date: Tue, 17 Jul 2012 23:41:56 +0200

Hello,

I have an NSArrayController (automaticallyRearrangesObjects = YES) on which I set a filterPredicate in code (not through bindings). Most of the time, rearranging works but in one 100% reproducible case, the controller produces an empty arrangedObjects array when it should produce a non-empty one.

It always happens if a certain predicate (A) was set before the predicate that produces the wrong result (B) is set. If any another predicate (or none) is set when setting (B), arrangedObjects is correctly populated. This is completely reproducible.

When I call rearrangeObjects on the array controller, the result gets rectified. However, even with automaticallyRearrangesObjects = NO, the array controller rearranges automatically so when I rearrange manually after setting the filter, I get two KVO change notifications for arrangedObjects which can be very costly and I'd really like to avoid that.

Any ideas on how to force NSArrayController to (1) either produce a correct result automatically or (2) prevent to do any rearranging by itself when a filterPredicate is set?

Regards
Markus
--
__________________________________________
Markus Spoettl

_______________________________________________

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

  • Follow-Ups:
    • Re: NSArrayController not rearranging correctly
      • From: Markus Spoettl <email@hidden>
    • Re: NSArrayController not rearranging correctly
      • From: Mike Abdullah <email@hidden>
    • Re: NSArrayController not rearranging correctly
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Sensible NSMultipleValuesMarker placeholder alternatives?
  • Next by Date: How can I convince an NSBigMutableString to become a mere NSAttributedString ?
  • Previous by thread: Re: How to get a Service into the "Search" group?
  • Next by thread: Re: NSArrayController not rearranging correctly
  • Index(es):
    • Date
    • Thread