<?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: NSView and Autresizing.  Yes, Again.</title>
	<atom:link href="http://katidev.com/blog/2008/03/20/nsview-and-autresizing-yes-again/feed/" rel="self" type="application/rss+xml" />
	<link>http://katidev.com/blog/2008/03/20/nsview-and-autresizing-yes-again/</link>
	<description>Developing Interfaces with Cocoa</description>
	<pubDate>Fri, 05 Sep 2008 19:42:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Ramin</title>
		<link>http://katidev.com/blog/2008/03/20/nsview-and-autresizing-yes-again/#comment-163</link>
		<dc:creator>Ramin</dc:creator>
		<pubDate>Thu, 17 Apr 2008 21:01:51 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=86#comment-163</guid>
		<description>Great blog. Went right into my RSS reader.

A small tip (that someone else handed to me). If you're going to post bug-report numbers publicly, you might want to use the 'rdar' URL. Supposedly, it'll help Apple folks find quickly look up bug reports. Details here: http://rentzsch.com/notes/rdarUrls</description>
		<content:encoded><![CDATA[<p>Great blog. Went right into my RSS reader.</p>
<p>A small tip (that someone else handed to me). If you&#8217;re going to post bug-report numbers publicly, you might want to use the &#8216;rdar&#8217; URL. Supposedly, it&#8217;ll help Apple folks find quickly look up bug reports. Details here: <a href="http://rentzsch.com/notes/rdarUrls" rel="nofollow">http://rentzsch.com/notes/rdarUrls</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://katidev.com/blog/2008/03/20/nsview-and-autresizing-yes-again/#comment-122</link>
		<dc:creator>John</dc:creator>
		<pubDate>Fri, 28 Mar 2008 19:43:48 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=86#comment-122</guid>
		<description>I don't understand what is the framework that "shall not be named". Cocoa touch clearly has a name already. (?)  And Cathy, please post your NSView layout manager for others to use. :-)</description>
		<content:encoded><![CDATA[<p>I don&#8217;t understand what is the framework that &#8220;shall not be named&#8221;. Cocoa touch clearly has a name already. (?)  And Cathy, please post your NSView layout manager for others to use. <img src='http://katidev.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John C. Randolph</title>
		<link>http://katidev.com/blog/2008/03/20/nsview-and-autresizing-yes-again/#comment-109</link>
		<dc:creator>John C. Randolph</dc:creator>
		<pubDate>Tue, 25 Mar 2008 09:04:19 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=86#comment-109</guid>
		<description>I've been using the AppKit since 1989, and I'm glad to see that Apple's taking a long hard look at  what we've learned from it, and how  a  new UI framework should be implemented.  I'm not sure that we're looking  at the "beginning of the end of the AppKit", but if we are, that's probably a good thing.

I do hope that CocoaTouch is made available for Mac apps to use.  It's a better  implementation in many ways, and it was designed by people who lived and breathed the AppKit for decades.

-jcr</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been using the AppKit since 1989, and I&#8217;m glad to see that Apple&#8217;s taking a long hard look at  what we&#8217;ve learned from it, and how  a  new UI framework should be implemented.  I&#8217;m not sure that we&#8217;re looking  at the &#8220;beginning of the end of the AppKit&#8221;, but if we are, that&#8217;s probably a good thing.</p>
<p>I do hope that CocoaTouch is made available for Mac apps to use.  It&#8217;s a better  implementation in many ways, and it was designed by people who lived and breathed the AppKit for decades.</p>
<p>-jcr</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cathy</title>
		<link>http://katidev.com/blog/2008/03/20/nsview-and-autresizing-yes-again/#comment-107</link>
		<dc:creator>Cathy</dc:creator>
		<pubDate>Tue, 25 Mar 2008 01:50:47 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=86#comment-107</guid>
		<description>Hi twobyte,

I could subclass each of the views in my example project from the first post and hard code the resizing behavior using these methods.  It would work in this case.

The one that stays centered is easy, but for the one that resizes with the window, I'll have to make some iVars to keep track of the margins I'm trying to maintain since I can't get them from NSView.  I'll also want to subclass the setAutoresizingMask method in case that information changes during runtime.  Already, things are getting a little messy, but  that's fine, there are two views in that example.   

In a medium to large interface project, this kind of approach isn't really maintainable and really susceptible to bugs.

I think that if you want to define your own layout behavior for NSView, it's cleaner and easier to debug if you make some sort of layout class that you keep in NSView instead of using the built-in autoresizing.  You could still use the masks, but why limit yourself to those options at that point?

Also, this still doesn't change the issue I'm ranting about in this post, which is, I think, the harder thing to deal with when you have a view hierarchy that changes while the app is running.  A constraints based system is a much nicer way to define a layout for a view hierarchy that is going to change during runtime.</description>
		<content:encoded><![CDATA[<p>Hi twobyte,</p>
<p>I could subclass each of the views in my example project from the first post and hard code the resizing behavior using these methods.  It would work in this case.</p>
<p>The one that stays centered is easy, but for the one that resizes with the window, I&#8217;ll have to make some iVars to keep track of the margins I&#8217;m trying to maintain since I can&#8217;t get them from NSView.  I&#8217;ll also want to subclass the setAutoresizingMask method in case that information changes during runtime.  Already, things are getting a little messy, but  that&#8217;s fine, there are two views in that example.   </p>
<p>In a medium to large interface project, this kind of approach isn&#8217;t really maintainable and really susceptible to bugs.</p>
<p>I think that if you want to define your own layout behavior for NSView, it&#8217;s cleaner and easier to debug if you make some sort of layout class that you keep in NSView instead of using the built-in autoresizing.  You could still use the masks, but why limit yourself to those options at that point?</p>
<p>Also, this still doesn&#8217;t change the issue I&#8217;m ranting about in this post, which is, I think, the harder thing to deal with when you have a view hierarchy that changes while the app is running.  A constraints based system is a much nicer way to define a layout for a view hierarchy that is going to change during runtime.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: twobyte</title>
		<link>http://katidev.com/blog/2008/03/20/nsview-and-autresizing-yes-again/#comment-104</link>
		<dc:creator>twobyte</dc:creator>
		<pubDate>Tue, 25 Mar 2008 00:44:31 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=86#comment-104</guid>
		<description>The solution to your problems is quite simple and described in "View Programming Guide" in the same section you quoted in your first blog:

"When you turn off a view's autoresizing, all of its descendants are likewise shielded from changes in the superview. Changes to subviews, however, can still percolate downward. Similarly, if a subview has no autoresize mask, it won’t change in size, and therefore none of its subviews autoresize.

A subclass can override resizeSubviewsWithOldSize: or resizeWithOldSuperviewSize: to customize the autoresizing behavior for a view. "</description>
		<content:encoded><![CDATA[<p>The solution to your problems is quite simple and described in &#8220;View Programming Guide&#8221; in the same section you quoted in your first blog:</p>
<p>&#8220;When you turn off a view&#8217;s autoresizing, all of its descendants are likewise shielded from changes in the superview. Changes to subviews, however, can still percolate downward. Similarly, if a subview has no autoresize mask, it won’t change in size, and therefore none of its subviews autoresize.</p>
<p>A subclass can override resizeSubviewsWithOldSize: or resizeWithOldSuperviewSize: to customize the autoresizing behavior for a view. &#8220;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cathy</title>
		<link>http://katidev.com/blog/2008/03/20/nsview-and-autresizing-yes-again/#comment-88</link>
		<dc:creator>Cathy</dc:creator>
		<pubDate>Sun, 23 Mar 2008 10:57:43 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=86#comment-88</guid>
		<description>Haha, no I don't want to get rid of AppKit,  but I do want a refreshed/updated view API.  I don't think that's any secret : )</description>
		<content:encoded><![CDATA[<p>Haha, no I don&#8217;t want to get rid of AppKit,  but I do want a refreshed/updated view API.  I don&#8217;t think that&#8217;s any secret : )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Stevenson</title>
		<link>http://katidev.com/blog/2008/03/20/nsview-and-autresizing-yes-again/#comment-86</link>
		<dc:creator>Scott Stevenson</dc:creator>
		<pubDate>Sun, 23 Mar 2008 09:32:40 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=86#comment-86</guid>
		<description>I don't think you really want to get rid of AppKit.  :)

That would mean getting rid of all 177 public classes listed in the AppKit headers, many of which solve some very tricky programming problems. Practically every modern piece of Mac software in use or currently in development (with a few notable exceptions) is based on AppKit.

It sounds like what you want is an updated/refreshed view API, which is totally reasonable and possible to do without tossing out the entire framework. The layout techniques in NSView are one part of a much larger body of code.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think you really want to get rid of AppKit.  <img src='http://katidev.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>That would mean getting rid of all 177 public classes listed in the AppKit headers, many of which solve some very tricky programming problems. Practically every modern piece of Mac software in use or currently in development (with a few notable exceptions) is based on AppKit.</p>
<p>It sounds like what you want is an updated/refreshed view API, which is totally reasonable and possible to do without tossing out the entire framework. The layout techniques in NSView are one part of a much larger body of code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cathy</title>
		<link>http://katidev.com/blog/2008/03/20/nsview-and-autresizing-yes-again/#comment-78</link>
		<dc:creator>Cathy</dc:creator>
		<pubDate>Thu, 20 Mar 2008 14:20:35 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=86#comment-78</guid>
		<description>Yeah, after taking a look at the other framework I also can't help but thinking that this is the beginning of the end of AppKit.  But I imagine that it'll take a long time.  Hope that other framework gets a different license agreement before then ; )</description>
		<content:encoded><![CDATA[<p>Yeah, after taking a look at the other framework I also can&#8217;t help but thinking that this is the beginning of the end of AppKit.  But I imagine that it&#8217;ll take a long time.  Hope that other framework gets a different license agreement before then ; )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wight</title>
		<link>http://katidev.com/blog/2008/03/20/nsview-and-autresizing-yes-again/#comment-77</link>
		<dc:creator>Jonathan Wight</dc:creator>
		<pubDate>Thu, 20 Mar 2008 14:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://katidev.com/blog/?p=86#comment-77</guid>
		<description>After playing (well working) with the framework that shall not be named for a while I'm really hoping that AppKit will be put to pasture sooner rather than later. Although it does have layout limitations, obviously because of limitations of the device it is running on, things are so much cleaner.

I'm a big fan of CALayer's layout options, it is really as simple or as complex as you need it to be, and that's a big plus. Good luck with your bug!</description>
		<content:encoded><![CDATA[<p>After playing (well working) with the framework that shall not be named for a while I&#8217;m really hoping that AppKit will be put to pasture sooner rather than later. Although it does have layout limitations, obviously because of limitations of the device it is running on, things are so much cleaner.</p>
<p>I&#8217;m a big fan of CALayer&#8217;s layout options, it is really as simple or as complex as you need it to be, and that&#8217;s a big plus. Good luck with your bug!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

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