• 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
@distinctUnionOfArrays problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

@distinctUnionOfArrays problem


  • Subject: @distinctUnionOfArrays problem
  • From: Trygve Inda <email@hidden>
  • Date: Fri, 12 Feb 2010 21:48:23 +0000
  • Thread-topic: @distinctUnionOfArrays problem

I am trying to get @distinctUnionOfArrays to work with bindings.

I have a Master NSArrayController. This contains an array of
NSMutableDictionary objects. Each Dictionary has three NSString keys/fields:
Genre, Artist, Album.

I set the content of the Master Controller to my NSMutableArray and all is
well - the array shows up in an NSTableView.

I then have a single-column TableView "Genre" I have Genre NSArrayController
and I try to bind this array controller to the Master Controler with IB:

Genre, bound to Master

Controller key: arrangedObjects
Model Key Path: @distinctUnionofArrays.Genre

My goal is to get a list of all the Genres in the Master array with no
duplicates... But I get a crash:

abort() called
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[NSCFString count]: unrecognized selector sent to instance
0x10045cc20'
*** Call stack at first throw:
(
    0   CoreFoundation                     0x00007fff86827444
__exceptionPreprocess + 180

    1   libobjc.A.dylib                     0x00007fff818b00f3
objc_exception_throw + 45

    2   CoreFoundation                      0x00007fff868801c0
+[NSObject(NSObject) doesNotRecognizeSelector:] + 0

    3   CoreFoundation                      0x00007fff867fa08f
___forwarding___ + 751

    4   CoreFoundation                      0x00007fff867f61d8
_CF_forwarding_prep_0 + 232

    5   CoreFoundation                      0x00007fff867d3a47
-[NSMutableArray addObjectsFromArray:] + 71

    6   Foundation                          0x00007fff859fdba4
-[NSArray(NSKeyValueCoding) _unionOfArraysForKeyPath:] + 112

    7   Foundation                          0x00007fff859fda74
-[NSArray(NSKeyValueCoding) _distinctUnionOfArraysForKeyPath:] + 28

    8   Foundation                          0x00007fff8598d4d7
-[NSArray(NSKeyValueCoding) valueForKeyPath:] + 566

    9   Foundation                          0x00007fff85930db6
-[NSObject(NSKeyValueCoding) valueForKeyPath:] + 376


Any ideas?

I tired binding in code (rather than IB) and while I made sure to bind Genre
to Master after Master already had it setContent,  got the same result.


_______________________________________________

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: @distinctUnionOfArrays problem
      • From: Trygve Inda <email@hidden>
  • Prev by Date: Connected Objects being allocated
  • Next by Date: Re: get the list of controls in a NSView
  • Previous by thread: Re: Connected Objects being allocated
  • Next by thread: Re: @distinctUnionOfArrays problem
  • Index(es):
    • Date
    • Thread