Re: Binding both animate and isIndeterminate on NSProgressIndicator (SOLVED)
Re: Binding both animate and isIndeterminate on NSProgressIndicator (SOLVED)
- Subject: Re: Binding both animate and isIndeterminate on NSProgressIndicator (SOLVED)
- From: Aaron Burghardt <email@hidden>
- Date: Fri, 12 Jan 2007 09:57:22 -0500
On Jan 12, 2007, at 8:51 AM, Jim Correia wrote:
On Jan 11, 2007, at 11:20 PM, Aaron Burghardt wrote:
I think I have resolved the issue. Originally, I had bound the
NSProgressIndicator bindings directly to my app controller object,
but I had the problem described below. I was able to get it to
work by adding an NSObjectController instance to the NIB,
connecting content outlet to the app controller, then binding all
of the progress indicator bindings to the NSObjectController. It
now works as expected, but I'm curious--is the NSObjectController
required?
Without seeing the code, it isn't possible to tell precisely what
the problem was.
Here are snippets of the two attributes involved. The attributes are
set with generic accessors:
@interface AppController : NSObject
id currentTask;
@end
@implementation AppController
- (void)setCurrentTask:(id)newTask {
if (newTask != currentTask) {
[currentTask release];
currentTask = [newTask retain];
}
}
....
@interface Task : NSObject
BOOL paused;
@end
@implementation Task
- (void)setPaused:(BOOL)flag {
paused = flag;
}
The exception occurs when setPaused: is called.
Generally you're strongly discouraged from binding from a view
directly to a model. The Controller is the C in the Model-View-
Controller triumvirate.
Yeah, evidently I was by-passing some controller magic. I re-read
this introduction to bindings, which encourages binding to sub-classes
of NSController (which my AppController is not):
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/WhatAreBindings.html
Thanks,
Aaron
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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