Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: NSArrayController & bindings: next hurdle.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController & bindings: next hurdle.




On 23 Sep, 2009, at 04:46, Kyle Sluder wrote:

On Tue, Sep 22, 2009 at 7:21 PM, Colin Howarth <email@hidden> wrote:
So, I have an NSArrayController (in IB). Its Content Array is bound to an
NSMutableArray (of 'Element') instance in my AppDelegate.

No. It's bound to a property of some object. Please be precise; NSMutableArray isn't KVO-compliant, so if you have indeed bound to a property of an array then you're going to have problems.

So please describe the ordered collection property to which you've
bound your array controller.  Are you exposing it as an
NSMutableArray?  Just an NSArray?  Or are you using the ordered
to-many accessor methods?

--Kyle Sluder


I was trying to be precise :-)


Array Controller Attributes: Object Controller: Mode: Object Class: LensElement Prepares Content: yes Editable: yes

Array Controller Bindings:
	Controller Content:
		Content Array (Trace App Delegate.elements)
			Bind to: Trace App Delegate
			Model Key Path: elements

Array Controller Connections:
	Received Actions:
		remove:       ---     Push Button (Delete Element)
		...
	Bindings:
		Content Array    ---    Trace App Delegate / elements
	Referencing Bindings:
		arrangedObjects.radius    ---    Value / Table Column (radius)
		...
	


elements is an instance of an NSMutableArray. The members of the array are instances of LensElement:



@interface LensElement : NSObject {

	NSNumber		*radius;
	...
}
@property (copy, nonatomic) NSNumber	*radius;
@end



@interface TraceAppDelegate : NSObject <NSApplicationDelegate> {
	NSWindow		*window;
	NSMutableArray	*elements;
	LensElement		*element;
}
@property (assign) IBOutlet NSWindow *window;
@property (assign) NSMutableArray  *elements;
@property (assign) LensElement  *element;
@end






_______________________________________________

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: 
 >NSArrayController & bindings: next hurdle. (From: Colin Howarth <email@hidden>)
 >Re: NSArrayController & bindings: next hurdle. (From: Kyle Sluder <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.