Re: Bindings delay issues
Re: Bindings delay issues
- Subject: Re: Bindings delay issues
- From: Bryan Hansen <email@hidden>
- Date: Tue, 10 Apr 2007 22:02:21 -0700
Setting up entryStatusImagePath as a dependent key on
successfulEntry did the trick. setNeedsDisplay:YES seemed awkward
because my understanding is that bindings should take care of that
and the NSTableView is in another class.
Thanks though, that first part seems to have done the trick!
Bryan
On Apr 10, 2007, at 3:28 PM, Ricky Sharp wrote:
On Apr 10, 2007, at 5:15 PM, Bryan Hansen wrote:
I am working on project that uses an NSTableColumn to mark valid/
invalid entries in a NSScrollView by displaying a tif image in the
column as a warning. I'm using bindings to call a method that gets
the appropriate path to the image to set in the column (nil if the
entry is valid). I also have a BOOL value and setter method which
is manipulated after checking validity. The BOOL value is used in
the getPath method to determine what will be returned.
My problem is that there is a delay in the bindings method
invocation to retrieve the path. If a row is invalid and becomes
marked as such, but then becomes valid the image is not cleared at
the right time. A delay occurs where the warning tif is cleared
after the next interaction with the interface, even UI elements
not associated with the binding or ScrollView. I'm not sure if
there is something that I'm doing to delay the bindings or
something I could do to force an update at the right time.
Heres the pertinent code:
- (BOOL)successfulEntry { return successfulEntry; }
- (void)setSuccessfulEntry:(BOOL)yn
{
[[ABCLogger defaultLogger] logDebug:@"setSuccessfulEntry: %d",
yn];
successfulEntry = yn;
}
- (NSString *)entryStatusImagePath
{
[[ABCLogger defaultLogger] logDebug:@"entryStatusImagePath: %
d", successfulEntry];
// if successful entry we're not going to set an image
if (successfulEntry)
{
return nil;
//NSBundle *thisBundle = [NSBundle bundleForClass:
[ApplicationController class]];
//[[ABCLogger defaultLogger] logDebug:@"return
successfulEntry tif: %@",[thisBundle
pathForResource:@"successfulEntry" ofType:@"tif"]];
//return [thisBundle pathForResource:@"successfulEntry"
ofType:@"tif"];
}
// for a failed entry we're doing to return a red bullet for
display
NSBundle *thisBundle = [NSBundle bundleForClass:
[ApplicationController class]];
[[ABCLogger defaultLogger] logDebug:@"return failedEntry tif: %
@",[thisBundle pathForResource:@"failedEntry" ofType:@"tif"]];
return [thisBundle pathForResource:@"failedEntry" ofType:@"tif"];
}
Do you have entryStatusImagePath set up as a dependent key on
successfulEntry? Also, ensure your views are receiving updates
when needed (i.e. are you calling setNeedsDisplay:YES as needed?)
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
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