Re: How do I get indirect binding to work?
Re: How do I get indirect binding to work?
- Subject: Re: How do I get indirect binding to work?
- From: Bob Ueland <email@hidden>
- Date: Fri, 5 Oct 2007 14:38:58 -0700 (PDT)
Keary Suska wrote
why your app is crashing, is anyone's guess, since you haven't
indicated the "why" of the crash--i.e. the error being reported,...
Are you, by chance, explicitly releasing the "book" object in the document
object somewhere, without having explicitly retained it beforehand?
This is the error message I get in the log window
"An instance 0x34a970 of class Book is
being deallocated while key value observers are still registered with
it. Break on _NSKVODeallocateLog to start debugging."
This is how my Book.m file looks like
#import "Book.h"
@implementation Book
// getters and setters
-(NSString *) title
{
return title;
}
-(void)setTitle:(NSString *) titleVal
{
titleVal=[titleVal copy];
[title release];
title=titleVal;
NSLog(@"%@", title);
}
// init and dealloc
-(id) init
{
[super init];
[self setTitle:@"New Title"];
return self;
}
-(void) dealloc
{
[title release];
[super dealloc];
}
@end
Has the problem something to do with [title release]; since title is
under kvo. The crash happens when I choose "Quit New Application". But
I still don't understand why.
Bob
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545433
_______________________________________________
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