<?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>Apfelsaft &#187; Development</title>
	<atom:link href="http://www.deelen.de/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.deelen.de</link>
	<description>Yet another Mac developer blog</description>
	<lastBuildDate>Sun, 03 Mar 2024 08:13:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Building OpenSSL for iOS with a Run-Script action from within Xcode</title>
		<link>http://www.deelen.de/2014/06/building-openssl-for-ios-with-a-run-script-action-from-within-xcode/</link>
		<comments>http://www.deelen.de/2014/06/building-openssl-for-ios-with-a-run-script-action-from-within-xcode/#comments</comments>
		<pubDate>Fri, 06 Jun 2014 10:21:10 +0000</pubDate>
		<dc:creator>Joachim</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://www.deelen.de/?p=169</guid>
		<description><![CDATA[There are many scripts out there in the Web that help building OpenSSL for iOS and iOS-Simulator for different architectures. For instance https://github.com/x2on/OpenSSL-for-iPhone  and https://gist.github.com/foozmeat/5154962. All of these scripts work fine when invoked from the command line. But as soon as you put them into a run-script action of Xcode, the make process will [...]]]></description>
			<content:encoded><![CDATA[<p>There are many scripts out there in the Web that help building OpenSSL for iOS and iOS-Simulator for different architectures. For instance <a href="https://github.com/x2on/OpenSSL-for-iPhone">https://github.com/x2on/OpenSSL-for-iPhone </a> and <a href="https://gist.github.com/foozmeat/5154962">https://gist.github.com/foozmeat/5154962</a>. All of these scripts work fine when invoked from the command line. But as soon as you put them into a run-script action of Xcode, the make process will fail with different, unspecified errors. Most of the Time  you&#8217;ll get something like:<br />
<code><br />
Undefined symbols for architecture i386:<br />
  "_ENGINE_load_gost", referenced from:<br />
      _ENGINE_load_builtin_engines in libcrypto.a(eng_all.o)<br />
ld: symbol(s) not found for architecture i386<br />
clang: error: linker command failed with exit code 1 (use -v to see invocation)<br />
make[2]: *** [link_app.] Error 1<br />
make[1]: *** [openssl] Error 2<br />
make: *** [build_apps] Error 1<br />
</code><br />
It took me a long time to figure out the problem, but the solution is easier than you would imagine! Just add the following line to the script before &#8220;Configure&#8221; or &#8220;make&#8221; is called:<br />
<code><br />
export COMMAND_MODE=unix2003<br />
</code></p>
<p>That&#8217;s all! Building OpenSSL from within Xcode should now work as expected.</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deelen.de/2014/06/building-openssl-for-ios-with-a-run-script-action-from-within-xcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Focus follows selection and Xcode 4</title>
		<link>http://www.deelen.de/2011/07/focus-follows-selection-and-xcode-4/</link>
		<comments>http://www.deelen.de/2011/07/focus-follows-selection-and-xcode-4/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 11:34:45 +0000</pubDate>
		<dc:creator>Joachim</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.deelen.de/?p=133</guid>
		<description><![CDATA[Since Xcode version 4.3 this is no longer an issue. The &#8220;Focus follows selection&#8221; menu entry has been resuscitated! 
People still using older Versions of Xcode 4, may read on &#8230;
Finally Xcode 4 is here and the days of Version 3 are almost part of history.
There was one nifty feature that I liked very much [...]]]></description>
			<content:encoded><![CDATA[<p>Since Xcode version 4.3 this is no longer an issue. The &#8220;Focus follows selection&#8221; menu entry has been resuscitated! </p>
<p>People still using older Versions of Xcode 4, may read on &#8230;</p>
<p>Finally Xcode 4 is here and the days of Version 3 are almost part of history.</p>
<p>There was one nifty feature that I liked very much in Xcode 3. It&#8217;s &#8220;Focus follows selection&#8221;. This feature was supposed to be in Version 4, since it can be found in the &#8220;Editor Menu&#8221; of Xcode 4, but oddly it&#8217;s always disabled. Even in Xcode 4.1 and 4.2 (beta).</p>
<p><img src="http://www.deelen.de/wordpress/wp-content/uploads/2011/07/FFS_disabled.png" alt="" /></p>
<p>So far for the bad news, but now for the good news: This feature <strong>is</strong> still available and functional in all Versions of Xcode 4. But you just can&#8217;t use the Menu to activate it. You have to open &#8220;Terminal&#8221; to do so. At the command prompt type the following:<br />
<code>defaults write com.apple.dt.Xcode DVTTextCodeFocusFollowsSelection -bool yes</code></p>
<p>Before you do so, make sure Xcode 4 is not running, because the setting may be overwritten when Xcode quits. After restarting Xcode &#8220;Focus follows selection&#8221; should work until you disable it with following command:<br />
<code>defaults write com.apple.dt.Xcode DVTTextCodeFocusFollowsSelection -bool no</code></p>
<p>With &#8220;Focus follows selection&#8221; enabled you can now fully concentrate on the block of code you&#8217;re working on &#8211; Even with Xcode 4!<br />
<img src="http://www.deelen.de/wordpress/wp-content/uploads/2011/07/FFS_InAction.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deelen.de/2011/07/focus-follows-selection-and-xcode-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cocoa Animation Proxy &#8220;woes&#8221;</title>
		<link>http://www.deelen.de/2010/02/cocoa-animation-proxies-woes/</link>
		<comments>http://www.deelen.de/2010/02/cocoa-animation-proxies-woes/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 14:24:45 +0000</pubDate>
		<dc:creator>Joachim</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[animator]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[setHidden]]></category>

		<guid isPermaLink="false">http://www.deelen.de/?p=114</guid>
		<description><![CDATA[Both, NSWindow and NSView offer a convenient way to add animation to your UI by the use of animation proxies. But there are some &#8220;woes&#8221; you have to keep in mind.

E.g. if you want to switch the visibility state you normally use:

[aView setHidden:YES]; // Hide the view
// very important code....
[aView setHidden:NO]; // Un-Hide the view

To [...]]]></description>
			<content:encoded><![CDATA[<p>Both, NSWindow and NSView offer a convenient way to add animation to your UI by the use of animation proxies. But there are some &#8220;woes&#8221; you have to keep in mind.<br />
<span id="more-114"></span><br />
E.g. if you want to switch the visibility state you normally use:</p>
<pre class="brush: objc;">
[aView setHidden:YES]; // Hide the view
// very important code....
[aView setHidden:NO]; // Un-Hide the view
</pre>
<p>To do the same thing with a short and smooth animation, you just have to change the above code to the following:</p>
<pre class="brush: objc;">
[[aView animator] setHidden:YES]; // Hide the view with animation
// very important code....
[[aView animator] setHidden:NO]; // Un-Hide the view with animation
</pre>
<p>(For some animations, like subview transitions, <kbd>aView</kbd> has to be layer-backed which can be accomplished with a call to <kbd>[aView setWantsLayer:YES];</kbd>)</p>
<p>So far so good. But what, if <kbd>aView</kbd> is a custom subclass of NSView, NSBox or whatsoever?</p>
<p>Normally, this is not a problem, since the object returned by <kbd>[aView animator]</kbd> is a proxy object for the original object and can be treated as if it was the original object itself.</p>
<p>But, there is a difference! If you call <kbd>setHidden:YES</kbd> on the original object, it gets called, regardless of the actual &#8220;hidden-state&#8221; of the view. If you call it on the proxy-object, it gets called only, if the value really changes. So calling <kbd>setHidden:YES</kbd> on an animator-proxy, which original-object is already hidden, has no effect at all.</p>
<p>This behavior can be ignored, as long as you do not overwrite any of the methods that change animateable properties, like <kbd>setHidden:</kbd>. But if you do, keep in mind, that your overwritten method may not be called while using the animator-proxy. In some cases, were you depend upon the fact, that your method gets always called, this can be a problem e.g. if you always want to do something in your setter, regardless of what the actual state or value is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deelen.de/2010/02/cocoa-animation-proxies-woes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>+ (void)initialize called only once?</title>
		<link>http://www.deelen.de/2010/02/voidinitialize-called-only-once/</link>
		<comments>http://www.deelen.de/2010/02/voidinitialize-called-only-once/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 15:20:02 +0000</pubDate>
		<dc:creator>Joachim</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[bindings]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[initialize]]></category>
		<category><![CDATA[objectivec]]></category>
		<category><![CDATA[subclass]]></category>

		<guid isPermaLink="false">http://www.deelen.de/?p=65</guid>
		<description><![CDATA[To make a long story short: The answer is no!
Even if you don&#8217;t subclass, there are side effects you&#8217;d never thought possible.

A few days ago I ran into a tricky problem while working on my iTunes-Controller Playwatch. After spending some time debugging I came to the conclusion that only multiple calls to the &#8220;initialize-method&#8221; could [...]]]></description>
			<content:encoded><![CDATA[<p>To make a long story short: The answer is no!</p>
<p>Even if <strong>you</strong> don&#8217;t subclass, there are side effects you&#8217;d never thought possible.<br />
<span id="more-65"></span></p>
<p>A few days ago I ran into a tricky problem while working on my iTunes-Controller Playwatch. After spending some time debugging I came to the conclusion that only multiple calls to the &#8220;initialize-method&#8221; could cause the problem.</p>
<p>Apple’s documentation states, that initialize is called only once. If you create subclasses of your class, initialize gets called for each subclass. If the subclass does not implement it, the call is forwarded to the superclass. This is the exception to the rule. If you subclass, initialize of your superclass maybe called more than once. To avoid double initialization, the documentation recommends to check the class-instance and do initialization only if it’s the correct one.</p>
<p>Here&#8217;s the code:</p>
<pre class="brush: objc;">
@implementation MyClass
+ (void)initialize
{
	if(self == [MyClass class]) {
		// Do initialization here....
	}
}
@end
</pre>
<p>Since I did not have any subclasses, I thought I could run without this check. Far wrong! To find out what was going on, I set a breakpoint at initialize. The debugger stopped once, and a second time. Even with no subclasses. How could that be? A look at the Variable “self” shed some light on this miracle.</p>
<p>The first time the stack and the variable looked like this: (Click on the images to see full resolution)</p>
<p><a href="http://www.deelen.de/wordpress/wp-content/uploads/2010/02/Bildschirmfoto-2010-02-15-um-14.56.20.png"><img src="http://www.deelen.de/wordpress/wp-content/uploads/2010/02/Bildschirmfoto-2010-02-15-um-14.56.20.png" alt="" title="initialized called the first time" width="542" height="330" class="alignnone size-full wp-image-83" /></a></p>
<p>The second time the result was as follows:</p>
<p><a href="http://www.deelen.de/wordpress/wp-content/uploads/2010/02/Bildschirmfoto-2010-02-15-um-14.57.04.png"><img src="http://www.deelen.de/wordpress/wp-content/uploads/2010/02/Bildschirmfoto-2010-02-15-um-14.57.04.png" alt="" title="initialize called a second time" width="556" height="328" class="alignnone size-full wp-image-84" /></a></p>
<p>The first call to initialize is on the class “PWCoverArtAndTracks”. The second one is on the class “NSKVONotifying_PWCoverArtAndTracks”.</p>
<p>All right! The AppKit did create a subclass because I use the tracks-array of “PWCoverArtAndTracks” as the content binding for a NSCollectionView. As you can see at the picture below.</p>
<p><a href="http://www.deelen.de/wordpress/wp-content/uploads/2010/02/Bildschirmfoto-2010-02-15-um-15.18.45.png"><img src="http://www.deelen.de/wordpress/wp-content/uploads/2010/02/Bildschirmfoto-2010-02-15-um-15.18.45.png" alt="" title="Class used for binding in IB" width="968" height="478" class="alignnone size-full wp-image-64" /></a></p>
<p>This is an implementation detail of CocoaBindings. I can remember reading something about this detail in the Apple Docs. But that remembrance was almost vanished at the time I wrote the initialize method.</p>
<p>Here’s my advice: Always check the class within initialize. Even if you don’t have subclasses.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deelen.de/2010/02/voidinitialize-called-only-once/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
