<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codec &#187; CALayer</title>
	<atom:link href="http://www.trembl.org/codec/tag/calayer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trembl.org/codec</link>
	<description>A Personal Polylogic Code/Decode &#039;Zettelkasten&#039;</description>
	<lastBuildDate>Thu, 02 Feb 2012 03:38:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting Mouse Position in NSWindow</title>
		<link>http://www.trembl.org/codec/533/</link>
		<comments>http://www.trembl.org/codec/533/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 08:14:53 +0000</pubDate>
		<dc:creator>Georg Tremmel</dc:creator>
				<category><![CDATA[Raw]]></category>
		<category><![CDATA[CALayer]]></category>
		<category><![CDATA[hitTest]]></category>
		<category><![CDATA[mouseDown]]></category>
		<category><![CDATA[NSPoint]]></category>
		<category><![CDATA[NSWindow]]></category>

		<guid isPermaLink="false">http://www.trembl.org/codec/?p=533</guid>
		<description><![CDATA[- &#40;void&#41;mouseDown:&#40;NSEvent *&#41;theEvent &#123; NSPoint mousePoint = &#91;theEvent locationInWindow&#93;; //NSPoint localPoint = [self convertPoint:mousePoint fromView:nil]; CALayer *hitLayer = &#91;&#91;self layer&#93; hitTest:mousePoint&#93;; NSLog&#40;@&#34;MainView, hitLayer: %@&#34;, hitLayer.name&#41;; NSLog&#40;@&#34;mousePoint %f %f&#34;, mousePoint.x, mousePoint.y&#41;; &#125;]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>mouseDown<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSEvent</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>theEvent <span style="color: #002200;">&#123;</span>
 <span style="color: #a61390;">NSPoint</span> mousePoint <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>theEvent locationInWindow<span style="color: #002200;">&#93;</span>;
 <span style="color: #11740a; font-style: italic;">//NSPoint localPoint = [self convertPoint:mousePoint fromView:nil];</span>
 CALayer <span style="color: #002200;">*</span>hitLayer <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self layer<span style="color: #002200;">&#93;</span>  hitTest<span style="color: #002200;">:</span>mousePoint<span style="color: #002200;">&#93;</span>;
 NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;MainView, hitLayer: %@&quot;</span>, hitLayer.name<span style="color: #002200;">&#41;</span>;
 NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;mousePoint %f %f&quot;</span>, mousePoint.x, mousePoint.y<span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.trembl.org/codec/533/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Specifing Values in CALayer</title>
		<link>http://www.trembl.org/codec/47/</link>
		<comments>http://www.trembl.org/codec/47/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 06:26:51 +0000</pubDate>
		<dc:creator>Georg Tremmel</dc:creator>
				<category><![CDATA[Raw]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[CALayer]]></category>
		<category><![CDATA[layer]]></category>
		<category><![CDATA[properties]]></category>

		<guid isPermaLink="false">http://www.trembl.org/codec/?p=47</guid>
		<description><![CDATA[You can not specify a structure field key path using Objective-C 2.0 properties. This will not work: myLayer.transform.rotation.x=0; Instead you must use setValue:forKeyPath: or valueForKeyPath: as shown below: [myLayer setValue:[NSNumber numberWithInt:0] forKeyPath:@"transform.rotation.x"]; brrrrrr. - (id)valueForKey:(NSString *)key - (void)setValue:(id)value forKey:(NSString *)key &#8230; NSKeyValueCoding Protocol Reference]]></description>
			<content:encoded><![CDATA[<p>You can not specify a structure field key path using Objective-C 2.0 properties. This will not work:</p>
<p><del datetime="2009-03-16T06:25:43+00:00"><code>myLayer.transform.rotation.x=0;</code></del></p>
<p>Instead you must use setValue:forKeyPath: or valueForKeyPath: as shown below:</p>
<p><strong><code>[myLayer setValue:[NSNumber numberWithInt:0] forKeyPath:@"transform.rotation.x"]</code>;</strong></p>
<p>brrrrrr.</p>
<p><code>- (id)valueForKey:(NSString *)key<br />
- (void)setValue:(id)value forKey:(NSString *)key</code></p>
<p>&#8230;<br />
NSKeyValueCoding Protocol Reference</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trembl.org/codec/47/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

