<?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 for Cocoaphony</title>
	<atom:link href="http://robnapier.net/blog/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://robnapier.net/blog</link>
	<description>Mac and iPhone, on the brain</description>
	<lastBuildDate>Tue, 17 Aug 2010 20:33:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>Comment on PandoraBoy 0.8.2 &#8211; Fixes Flash by Jason</title>
		<link>http://robnapier.net/blog/pandoraboy-082-fixes-flash-523/comment-page-1#comment-2185</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Tue, 17 Aug 2010 20:33:18 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=523#comment-2185</guid>
		<description>&lt;p&gt;I think I got pointed to sendEvent: by the response to a question you asked somewhere, perhaps on the cocoa-dev mailing list? Saved my butt too—the initial (WebHostedNetscapePluginView) clause is the one that works on my machine; I was baffled when my testers told me it didn&#039;t work on theirs.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I think I got pointed to sendEvent: by the response to a question you asked somewhere, perhaps on the cocoa-dev mailing list? Saved my butt too—the initial (WebHostedNetscapePluginView) clause is the one that works on my machine; I was baffled when my testers told me it didn&#8217;t work on theirs.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PandoraBoy 0.8.2 &#8211; Fixes Flash by Rob Napier</title>
		<link>http://robnapier.net/blog/pandoraboy-082-fixes-flash-523/comment-page-1#comment-2183</link>
		<dc:creator>Rob Napier</dc:creator>
		<pubDate>Tue, 17 Aug 2010 18:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=523#comment-2183</guid>
		<description>&lt;p&gt;Interesting. This is extremely similar to the old technique that PB used (and that didn&#039;t work if the window was minimized, but did if it was hidden). I was using Carbon events rather than CGEvents as I recall, but the rest looks the same. Let me compare this code to my old code and see if I can find something even better.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Interesting. This is extremely similar to the old technique that PB used (and that didn&#8217;t work if the window was minimized, but did if it was hidden). I was using Carbon events rather than CGEvents as I recall, but the rest looks the same. Let me compare this code to my old code and see if I can find something even better.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PandoraBoy 0.8.2 &#8211; Fixes Flash by Jason</title>
		<link>http://robnapier.net/blog/pandoraboy-082-fixes-flash-523/comment-page-1#comment-2182</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Tue, 17 Aug 2010 17:49:13 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=523#comment-2182</guid>
		<description>&lt;p&gt;I seem to recall trying this approach, and if I remember correctly it doesn&#039;t work if the window is hidden or minimized. Is that right? I&#039;ll have to try it again and see—big headsmack if I&#039;m wrong.&lt;/p&gt;

&lt;p&gt;In case I&#039;m not: I just posted the code I&#039;m using in Musicality over on StackOverflow...it calls right into the plugin directly (as it sounds like you were doing before), and works even with hidden windows.&lt;/p&gt;

&lt;p&gt;http://stackoverflow.com/questions/2128235/how-do-i-send-key-events-to-a-flash-movie-in-webkit&lt;/p&gt;

&lt;p&gt;For the life of me I can&#039;t seem to make it accept modifier keys though (Command in particular, needed to advance the song on Grooveshark).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I seem to recall trying this approach, and if I remember correctly it doesn&#8217;t work if the window is hidden or minimized. Is that right? I&#8217;ll have to try it again and see—big headsmack if I&#8217;m wrong.</p>

<p>In case I&#8217;m not: I just posted the code I&#8217;m using in Musicality over on StackOverflow&#8230;it calls right into the plugin directly (as it sounds like you were doing before), and works even with hidden windows.</p>

<p><a href="http://stackoverflow.com/questions/2128235/how-do-i-send-key-events-to-a-flash-movie-in-webkit" rel="nofollow">http://stackoverflow.com/questions/2128235/how-do-i-send-key-events-to-a-flash-movie-in-webkit</a></p>

<p>For the life of me I can&#8217;t seem to make it accept modifier keys though (Command in particular, needed to advance the song on Grooveshark).</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Pandora&#8217;s &#8220;Profile&#8221; pop-up by Jeremy</title>
		<link>http://robnapier.net/blog/pandoras-profile-popup-529/comment-page-1#comment-2176</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Tue, 17 Aug 2010 06:17:24 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=529#comment-2176</guid>
		<description>&lt;p&gt;Thanks for the post man.  Just found this program and was wondering why I was getting that.  Wish I could code so I could help, but if you need docs support I&#039;m game.&lt;/p&gt;

&lt;p&gt;JT&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the post man.  Just found this program and was wondering why I was getting that.  Wish I could code so I could help, but if you need docs support I&#8217;m game.</p>

<p>JT</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Scripting Bridge by Pete Siemsen</title>
		<link>http://robnapier.net/blog/scripting-bridge-265/comment-page-1#comment-2076</link>
		<dc:creator>Pete Siemsen</dc:creator>
		<pubDate>Wed, 04 Aug 2010 13:56:37 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=265#comment-2076</guid>
		<description>&lt;p&gt;Rob,&lt;/p&gt;

&lt;p&gt;What would be the Scripting Bridge equivalent of the following AppleScript?&lt;/p&gt;

&lt;p&gt;set previousApp to the name of the current application
   -- some app gets activated here, raising is window(s) to the front
   tell application previousApp to activate&lt;/p&gt;

&lt;p&gt;My attempt, which probably just shows that a little knowledge is dangerous, partially works:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;&lt;code&gt;NSString *systemEventsAppName = @&quot;com.apple.SystemEvents&quot;;
systemEventsApp = [SBApplication applicationWithBundleIdentifier:systemEventsAppName];
if (systemEventsApp == nil) {
    prependMessageToErrorChain(&quot;couldn&#039;t find an app named \&quot;%s\&quot;&quot;, [systemEventsAppName UTF8String]);
    return FAILURE;
}
if ( [systemEventsApp isRunning] ) {
    for (SystemEventsItem *systemEventsProcess in [systemEventsApp processes]) {
        NSDictionary *processProperties = [systemEventsProcess properties];
        NSString *processName    = [processProperties objectForKey:@&quot;name&quot;];
        NSString *processIsFront = [processProperties objectForKey:@&quot;frontmost&quot;];
        NSLog(@&quot;getPreviousApp: processName = \&quot;%@\&quot;, processIsFront = \&quot;%@\&quot;&quot;, processName, processIsFront);
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;Although this identifies the app that has focus, it seems like this is the wrong approach - the loop through the processes is slow - it stops for a second or two on one of the processes.  Is there somewhere I can look for guidance?  A mailing list?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;-- Pete&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Rob,</p>

<p>What would be the Scripting Bridge equivalent of the following AppleScript?</p>

<p>set previousApp to the name of the current application
   &#8212; some app gets activated here, raising is window(s) to the front
   tell application previousApp to activate</p>

<p>My attempt, which probably just shows that a little knowledge is dangerous, partially works:</p>

<p><pre><code>NSString *systemEventsAppName = @"com.apple.SystemEvents";
systemEventsApp = [SBApplication applicationWithBundleIdentifier:systemEventsAppName];
if (systemEventsApp == nil) {
    prependMessageToErrorChain("couldn't find an app named \"%s\"", [systemEventsAppName UTF8String]);
    return FAILURE;
}
if ( [systemEventsApp isRunning] ) {
    for (SystemEventsItem *systemEventsProcess in [systemEventsApp processes]) {
        NSDictionary *processProperties = [systemEventsProcess properties];
        NSString *processName    = [processProperties objectForKey:@"name"];
        NSString *processIsFront = [processProperties objectForKey:@"frontmost"];
        NSLog(@"getPreviousApp: processName = \"%@\", processIsFront = \"%@\"", processName, processIsFront);
    }
}
</code></pre></p>

<p>Although this identifies the app that has focus, it seems like this is the wrong approach &#8211; the loop through the processes is slow &#8211; it stops for a second or two on one of the processes.  Is there somewhere I can look for guidance?  A mailing list?</p>

<p>Thanks,</p>

<p>&#8211; Pete</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on PandoraBoy 0.8.2 &#8211; Fixes Flash by Alex Wayne</title>
		<link>http://robnapier.net/blog/pandoraboy-082-fixes-flash-523/comment-page-1#comment-1958</link>
		<dc:creator>Alex Wayne</dc:creator>
		<pubDate>Wed, 21 Jul 2010 17:02:58 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=523#comment-1958</guid>
		<description>&lt;p&gt;You are my hero.  The broken keyboard hotkeys were driving me crazy.  THank you so much for your work on this app!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You are my hero.  The broken keyboard hotkeys were driving me crazy.  THank you so much for your work on this app!</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building the Build System &#8211; Part 1 &#8211; Abandoning the Build Panel by Rob Napier</title>
		<link>http://robnapier.net/blog/build-system-1-build-panel-360/comment-page-1#comment-1875</link>
		<dc:creator>Rob Napier</dc:creator>
		<pubDate>Fri, 09 Jul 2010 12:46:24 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=360#comment-1875</guid>
		<description>&lt;p&gt;Thanks for the tip. The SDK is one of the few things I recommend setting outside of the xcconfig files. I set it in the General pane (rather than the build pane, though doing so updates the build pane). It seems to be used by a lot of things in Xcode.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the tip. The SDK is one of the few things I recommend setting outside of the xcconfig files. I set it in the General pane (rather than the build pane, though doing so updates the build pane). It seems to be used by a lot of things in Xcode.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Building the Build System &#8211; Part 1 &#8211; Abandoning the Build Panel by clozach</title>
		<link>http://robnapier.net/blog/build-system-1-build-panel-360/comment-page-1#comment-1871</link>
		<dc:creator>clozach</dc:creator>
		<pubDate>Fri, 09 Jul 2010 05:07:08 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=360#comment-1871</guid>
		<description>&lt;p&gt;This is awesome...great to actually have this info humanely accessible to version control! One caveat worth appending to your instructions: Xcode 3.2.3 appears to have a bug whereby the option to select between Device and Simulator disappears from the &quot;Overview&quot; target menu if you delete &#039;Base SDK&#039; (i.e., SDKROOT) from the project info&#039;s Build settings.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is awesome&#8230;great to actually have this info humanely accessible to version control! One caveat worth appending to your instructions: Xcode 3.2.3 appears to have a bug whereby the option to select between Device and Simulator disappears from the &#8220;Overview&#8221; target menu if you delete &#8216;Base SDK&#8217; (i.e., SDKROOT) from the project info&#8217;s Build settings.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Hijacking with method_exchangeImplementations() by Rob Napier</title>
		<link>http://robnapier.net/blog/hijacking-methodexchangeimplementations-502/comment-page-1#comment-1863</link>
		<dc:creator>Rob Napier</dc:creator>
		<pubDate>Thu, 08 Jul 2010 01:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=502#comment-1863</guid>
		<description>&lt;p&gt;The trade-off here is whether you want your test code to be something that magically infects your program just by being compiled, or if you want it to set off the warning flares that a commit into main.m cause vs a more straightforward approach like AppDelegate&#039;s -init. There are pros and cons of +load, but I&#039;ve seen this kind of code accidentally left in products (I just pulled out a leak detector a couple of months ago that no one had realized was in there, shouldn&#039;t have been in there, and was injected in a way similar to this so no one had noticed it). On the other hand, it means you can inject debug magic without making any changes to the target code at all, which is nice, as long as you&#039;re very careful not to commit it.&lt;/p&gt;

&lt;p&gt;My style is often very tempered by working in a large team with a very wide range of skills, so I work very hard to isolate magic into places that I will notice in the subversion commit logs. Those who work on solo projects or with smaller teams of highly skilled developers definitely may benefit from other styles.&lt;/p&gt;

&lt;p&gt;For those reading along at home, +load is basically a super-magical form of +initialize that gets called at load time (rather than at first method send), and is so special-cased in the runtime that multiple categories can implement it and they all will run correctly. It is wonderfully useful when you need it. Thanks for mentioning it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The trade-off here is whether you want your test code to be something that magically infects your program just by being compiled, or if you want it to set off the warning flares that a commit into main.m cause vs a more straightforward approach like AppDelegate&#8217;s -init. There are pros and cons of +load, but I&#8217;ve seen this kind of code accidentally left in products (I just pulled out a leak detector a couple of months ago that no one had realized was in there, shouldn&#8217;t have been in there, and was injected in a way similar to this so no one had noticed it). On the other hand, it means you can inject debug magic without making any changes to the target code at all, which is nice, as long as you&#8217;re very careful not to commit it.</p>

<p>My style is often very tempered by working in a large team with a very wide range of skills, so I work very hard to isolate magic into places that I will notice in the subversion commit logs. Those who work on solo projects or with smaller teams of highly skilled developers definitely may benefit from other styles.</p>

<p>For those reading along at home, +load is basically a super-magical form of +initialize that gets called at load time (rather than at first method send), and is so special-cased in the runtime that multiple categories can implement it and they all will run correctly. It is wonderfully useful when you need it. Thanks for mentioning it.</p>]]></content:encoded>
	</item>
	<item>
		<title>Comment on Hijacking with method_exchangeImplementations() by Nathan de Vries</title>
		<link>http://robnapier.net/blog/hijacking-methodexchangeimplementations-502/comment-page-1#comment-1859</link>
		<dc:creator>Nathan de Vries</dc:creator>
		<pubDate>Wed, 07 Jul 2010 22:33:56 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=502#comment-1859</guid>
		<description>&lt;p&gt;One change you could made which would do away with the need to call [NSNotificationCenter hijack] early on in your program is to swizzle removeObserver: in a +load method on your category. This would be called automatically for you.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>One change you could made which would do away with the need to call [NSNotificationCenter hijack] early on in your program is to swizzle removeObserver: in a +load method on your category. This would be called automatically for you.</p>]]></content:encoded>
	</item>
</channel>
</rss>
