<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: A Joyous Crash in removeObserver:forKeyPath: / _NSKeyValueObservationInfoCreateByRemoving</title>
	<atom:link href="http://www.tikirobot.net/wp/2006/10/14/a-joyous-crash-in-removeobserverforkeypath-_nskeyvalueobservationinfocreatebyremoving/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tikirobot.net/wp/2006/10/14/a-joyous-crash-in-removeobserverforkeypath-_nskeyvalueobservationinfocreatebyremoving/</link>
	<description>Mai Tais and Blinky Lights, Ahoy!</description>
	<lastBuildDate>Sat, 28 Jan 2012 06:57:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: killerdemouches</title>
		<link>http://www.tikirobot.net/wp/2006/10/14/a-joyous-crash-in-removeobserverforkeypath-_nskeyvalueobservationinfocreatebyremoving/comment-page-1/#comment-29252</link>
		<dc:creator>killerdemouches</dc:creator>
		<pubDate>Mon, 04 Jun 2007 12:29:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.tikirobot.net/wp/2006/10/14/a-joyous-crash-in-removeobserverforkeypath-_nskeyvalueobservationinfocreatebyremoving/#comment-29252</guid>
		<description>It may interess someone.

I add some problem working arround with this bug, so i decided to fix this issue of NSObject by myself:

//  NSObjectKVOCrashFixer.h


#import 


@interface NSObjectKVOCrashFixer : NSObject {

}

@end

//  NSObjectKVOCrashFixer.m

#import &quot;NSObjectKVOCrashFixer.h&quot;


@implementation NSObjectKVOCrashFixer
- (void)_removeObserver:(NSObject *)anObserver forProperty:(id)property
{
	if([self observationInfo]!=NULL)
		[super _removeObserver:anObserver forProperty:property];
	else
		NSLog(@&quot;Fixed an Apple crash!&quot;);
}
@end


and 

//  main.m
#import 
#import &quot;NSObjectKVOCrashFixer.h&quot;

int main(int argc, char *argv[])
{
	[NSObjectKVOCrashFixer poseAsClass:[NSObject class]];
    return NSApplicationMain(argc,  (const char **) argv);
}

I know this is dirty. But it works and it seems necessary for me until apple check by themselves if value==NULL before doing a CFRelease...</description>
		<content:encoded><![CDATA[<p>It may interess someone.</p>
<p>I add some problem working arround with this bug, so i decided to fix this issue of NSObject by myself:</p>
<p>//  NSObjectKVOCrashFixer.h</p>
<ol>
<li>import
</li>
</ol>
<p>@interface NSObjectKVOCrashFixer : NSObject {</p>
<p>}</p>
<p>@end</p>
<p>//  NSObjectKVOCrashFixer.m</p>
<ol>
<li>import &#8220;NSObjectKVOCrashFixer.h&#8221;
</li>
</ol>
<p>@implementation NSObjectKVOCrashFixer<br />
- (void)_removeObserver:(NSObject *)anObserver forProperty:(id)property<br />
{<br />
	if([self observationInfo]!=NULL)<br />
		[super _removeObserver:anObserver forProperty:property];<br />
	else<br />
		NSLog(@&#8221;Fixed an Apple crash!&#8221;);<br />
}<br />
@end</p>
<p>and </p>
<p>//  main.m</p>
<ol>
<li>import
</li>
<li>import &#8220;NSObjectKVOCrashFixer.h&#8221;
</li>
</ol>
<p>int main(int argc, char *argv[])<br />
{<br />
	[NSObjectKVOCrashFixer poseAsClass:[NSObject class]];<br />
    return NSApplicationMain(argc,  (const char **) argv);<br />
}</p>
<p>I know this is dirty. But it works and it seems necessary for me until apple check by themselves if value==NULL before doing a CFRelease&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

