<?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"
	>
<channel>
	<title>Comments on: String Theory</title>
	<atom:link href="http://www.red-sweater.com/blog/98/string-theory/feed" rel="self" type="application/rss+xml" />
	<link>http://www.red-sweater.com/blog/98/string-theory</link>
	<description>Mac &#38; Technology Writings by Daniel Jalkut</description>
	<pubDate>Thu, 20 Nov 2008 22:49:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Daniel Jalkut</title>
		<link>http://www.red-sweater.com/blog/98/string-theory#comment-995</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Mon, 27 Feb 2006 15:31:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/98/string-theory#comment-995</guid>
		<description>Kevin: couldn't they just put padding bytes in for any unused ivars on CFRunLoop?  Not saying they should do so without thinking carefully, but the mere mismatch in ivars doesn't seem like a complete deal breaker.</description>
		<content:encoded><![CDATA[<p>Kevin: couldn&#8217;t they just put padding bytes in for any unused ivars on CFRunLoop?  Not saying they should do so without thinking carefully, but the mere mismatch in ivars doesn&#8217;t seem like a complete deal breaker.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Ballard</title>
		<link>http://www.red-sweater.com/blog/98/string-theory#comment-989</link>
		<dc:creator>Kevin Ballard</dc:creator>
		<pubDate>Mon, 27 Feb 2006 01:44:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/98/string-theory#comment-989</guid>
		<description>Johannes: NSRunLoop is not bridged to CFRunLoop because it's a wrapper, not an equivalency. NSRunLoop has functionality not present in CFRunLoop, which presumably requires extra ivars, which means it cannot be bridged (since bridging objects requires having the same underlying memory structure).</description>
		<content:encoded><![CDATA[<p>Johannes: NSRunLoop is not bridged to CFRunLoop because it&#8217;s a wrapper, not an equivalency. NSRunLoop has functionality not present in CFRunLoop, which presumably requires extra ivars, which means it cannot be bridged (since bridging objects requires having the same underlying memory structure).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johannes Fortmann</title>
		<link>http://www.red-sweater.com/blog/98/string-theory#comment-987</link>
		<dc:creator>Johannes Fortmann</dc:creator>
		<pubDate>Sun, 26 Feb 2006 21:36:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/98/string-theory#comment-987</guid>
		<description>I love bridging: it should be used more thoroughly throughout the API. e.g. why isn't CFRunloop bridged with NSRunloop? Wherever there's a 1:1 relation between objects, there should also be a bridge.

Bridging is very easy, by the way: since an Objective C object is nothing more than a struct with an isa pointer as first member, it's sufficient to just set that right after initialization.

An excerpt from a class I once wrote:
&lt;code&gt;
struct Font
{
public:
	Font(const std::string&#38;,int fontsize);
	void Print(const std::string&#38; text);
private:
	void *isa;
	unsigned int texture;
	unsigned int displaylist;
};
&lt;/code&gt;
This is a C++ class (in a standard cpp file. The constructor sets isa to a Objective C class with the same variable layout. Of course, this doesn't work with "real" C++ classes, which have their vtable in the place where the isa pointer should be for the Objective C class. With this class, you can call [font drawString:@"blah"] as well as font-&#62;Print(std::string("blah").

Now, that was off-topic :-)</description>
		<content:encoded><![CDATA[<p>I love bridging: it should be used more thoroughly throughout the API. e.g. why isn&#8217;t CFRunloop bridged with NSRunloop? Wherever there&#8217;s a 1:1 relation between objects, there should also be a bridge.</p>
<p>Bridging is very easy, by the way: since an Objective C object is nothing more than a struct with an isa pointer as first member, it&#8217;s sufficient to just set that right after initialization.</p>
<p>An excerpt from a class I once wrote:<br />
<code><br />
struct Font<br />
{<br />
public:<br />
	Font(const std::string&amp;,int fontsize);<br />
	void Print(const std::string&amp; text);<br />
private:<br />
	void *isa;<br />
	unsigned int texture;<br />
	unsigned int displaylist;<br />
};<br />
</code><br />
This is a C++ class (in a standard cpp file. The constructor sets isa to a Objective C class with the same variable layout. Of course, this doesn&#8217;t work with &#8220;real&#8221; C++ classes, which have their vtable in the place where the isa pointer should be for the Objective C class. With this class, you can call [font drawString:@"blah"] as well as font-&gt;Print(std::string(&#8221;blah&#8221;).</p>
<p>Now, that was off-topic :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Jalkut</title>
		<link>http://www.red-sweater.com/blog/98/string-theory#comment-986</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Sun, 26 Feb 2006 20:44:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/98/string-theory#comment-986</guid>
		<description>Thanks guys for bringing this to light quickly so we can hopefully avoid an avalanche of comments reminding me that I'm an idiot :) I've updated the original entry above to include a reaction to Michael's comment. Let this be a lesson to all onlookers: blogging is dangerous - especially when you assume a tone of knowing something worth sharing with the world :)</description>
		<content:encoded><![CDATA[<p>Thanks guys for bringing this to light quickly so we can hopefully avoid an avalanche of comments reminding me that I&#8217;m an idiot :) I&#8217;ve updated the original entry above to include a reaction to Michael&#8217;s comment. Let this be a lesson to all onlookers: blogging is dangerous - especially when you assume a tone of knowing something worth sharing with the world :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Liscio</title>
		<link>http://www.red-sweater.com/blog/98/string-theory#comment-985</link>
		<dc:creator>Chris Liscio</dc:creator>
		<pubDate>Sun, 26 Feb 2006 20:39:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/98/string-theory#comment-985</guid>
		<description>Michael: Probably no different, actually.  When Daniel and I originally spoke about this, neither of us even thought to use NSValue.  I just hacked out my own class because I didn't know any better, and using an NSString just seemed wrong for my needs.

So I guess I'm not such a super mega, ultra groovy developer after all...  ;)</description>
		<content:encoded><![CDATA[<p>Michael: Probably no different, actually.  When Daniel and I originally spoke about this, neither of us even thought to use NSValue.  I just hacked out my own class because I didn&#8217;t know any better, and using an NSString just seemed wrong for my needs.</p>
<p>So I guess I&#8217;m not such a super mega, ultra groovy developer after all&#8230;  ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wight</title>
		<link>http://www.red-sweater.com/blog/98/string-theory#comment-984</link>
		<dc:creator>Jonathan Wight</dc:creator>
		<pubDate>Sun, 26 Feb 2006 20:39:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/98/string-theory#comment-984</guid>
		<description>NSValue already has wrappers for NSRect, NSPoint, NSSIze and NSRange. I'd like to think that it is more efficient than converting the structs to strings.</description>
		<content:encoded><![CDATA[<p>NSValue already has wrappers for NSRect, NSPoint, NSSIze and NSRange. I&#8217;d like to think that it is more efficient than converting the structs to strings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Tsai</title>
		<link>http://www.red-sweater.com/blog/98/string-theory#comment-982</link>
		<dc:creator>Michael Tsai</dc:creator>
		<pubDate>Sun, 26 Feb 2006 20:18:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/98/string-theory#comment-982</guid>
		<description>Is Chris's wrapper faster than NSValue?</description>
		<content:encoded><![CDATA[<p>Is Chris&#8217;s wrapper faster than NSValue?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.263 seconds -->
