<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>NSLog</title>
	
	<link>http://nslog.de</link>
	<description>[knowledge dump];</description>
	<lastBuildDate>Wed, 01 Feb 2012 18:49:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/nslog-de" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="nslog-de" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Debug broken code highlighting in Xcode 4</title>
		<link>http://nslog.de/posts/141</link>
		<comments>http://nslog.de/posts/141#comments</comments>
		<pubDate>Wed, 01 Feb 2012 16:50:42 +0000</pubDate>
		<dc:creator>toto</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[Voodoo]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://nslog.de/?p=141</guid>
		<description><![CDATA[If you use Xcode 4 a lot this might have happened to you, too: Coloring and code completion fail and do not come back. Which makes working with Xcode almost impossible This happens when Xcode&#8217;s indexing process fails for some reason. This can be a header file is missing to code highlighting (which can be [...]]]></description>
			<content:encoded><![CDATA[<p>If you use Xcode 4 a lot this might have happened to you, too: Coloring and code completion fail and do not come back. Which makes working with Xcode almost impossible</p>
<p>This happens when Xcode&#8217;s indexing process fails for some reason. This can be a header file is missing to code highlighting (which can be different from the compiler in some cases) or in some cases a bad <code>#define</code>. The problem is that it fails silently so you cannot fix it.</p>
<p>After having this problem with a big project I stumbled onto the magic <a href="http://stackoverflow.com/questions/2138047/xcode-code-loses-syntax-coloring">hint on Stack Overflow</a>.  After you quit Xcode enter this into a shell:</p>
<blockquote><p><code>defaults write com.apple.dt.Xcode IDEIndexingClangInvocationLogLevel 3</code></p></blockquote>
<p>After this you should open the project and see messages like this:</p>
<blockquote><p><code>Xcode: IDEIndexingClangInvocation: Failed to save PCH file: /Users/user/Library/Developer/Xcode/DerivedData/Project-drsrrgaenperjadmqslqfxyqcqyt/Index/PrecompiledHeaders/Some-Prefix-cgepzuvkwimbsvcmqrbbpeoyhdpz_ast/Some-Prefix.pch.pth</code></p></blockquote>
<p>Looking through these messages will show you what goes on and might help you finding the problem.</p>
<p>For me it was just copying header files from a framework on the place the Clang parser was looking for them.</p> <p><a href="http://nslog.de/?flattrss_redirect&amp;id=141&amp;md5=b4d6007bab3719d9c12d5c1fa1c8ec01" title="Flattr" target="_blank"><img src="http://nslog.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://nslog.de/posts/141/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote Web Inspector Pt. 2</title>
		<link>http://nslog.de/posts/130</link>
		<comments>http://nslog.de/posts/130#comments</comments>
		<pubDate>Wed, 07 Dec 2011 11:45:29 +0000</pubDate>
		<dc:creator>Ullrich</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[iPhone Simulator]]></category>
		<category><![CDATA[Voodoo]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://nslog.de/?p=130</guid>
		<description><![CDATA[It gets even better, because this also works in Mobile Safari on the iOS 5 Simulator! Here&#8217;s a little script you can run, that enables the remote Web Inspector via gdb (via @atnan). Here&#8217;s to all the mobile devs!]]></description>
			<content:encoded><![CDATA[<p>It gets even better, because <a href="http://nslog.de/posts/124">this</a> also works in Mobile Safari on the iOS 5 Simulator!</p>
<p>Here&#8217;s a <a href="https://gist.github.com/947051463dfb8055a9d8">little script</a> you can run, that enables the remote Web Inspector via gdb (via <a href="http://atnan.com/blog/2011/11/17/enabling-remote-debugging-via-private-apis-in-mobile-safari/ ">@atnan</a>).</p>
<p>Here&#8217;s to all the mobile devs!</p> <p><a href="http://nslog.de/?flattrss_redirect&amp;id=130&amp;md5=81d20bded6862c98299b54489c007f2f" title="Flattr" target="_blank"><img src="http://nslog.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://nslog.de/posts/130/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote Web Inspector</title>
		<link>http://nslog.de/posts/124</link>
		<comments>http://nslog.de/posts/124#comments</comments>
		<pubDate>Wed, 07 Dec 2011 11:07:40 +0000</pubDate>
		<dc:creator>Ullrich</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[iPhone Simulator]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://nslog.de/?p=124</guid>
		<description><![CDATA[We recently stumbled across a blog post mentioning a way to enable a remote interface to a web inspector that is hidden inside the WebKit on iOS 5. Here&#8217;s how it&#8217;s done. In your Application Delegate add the following code: + (void)initialize; { [NSClassFromString(@"WebView") performSelector:@selector(_enableRemoteInspector)]; } With this you can direct your browser to http://localhost:9999 to [...]]]></description>
			<content:encoded><![CDATA[<p>We recently stumbled across a <a href="http://hiediutley.com/2011/11/22/debugging-ios-apps-using-safari-web-inspector/">blog post</a> mentioning a way to enable a remote interface to a web inspector that is hidden inside the WebKit on iOS 5.</p>
<p>Here&#8217;s how it&#8217;s done. In your Application Delegate add the following code:</p>
<pre>+ (void)initialize;
{
    [NSClassFromString(@"WebView") performSelector:@selector(_enableRemoteInspector)];
}</pre>
<p>With this you can direct your browser to <a href="http://localhost:9999">http://localhost:9999</a> to open the web inspector.</p>
<p>Have fun!</p>
<pre></pre> <p><a href="http://nslog.de/?flattrss_redirect&amp;id=124&amp;md5=8f9381bd04d8e492ee1e7d642988e367" title="Flattr" target="_blank"><img src="http://nslog.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://nslog.de/posts/124/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Symbolicating without Xcode</title>
		<link>http://nslog.de/posts/120</link>
		<comments>http://nslog.de/posts/120#comments</comments>
		<pubDate>Tue, 27 Sep 2011 16:26:37 +0000</pubDate>
		<dc:creator>Ullrich</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Bughunting]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://nslog.de/?p=120</guid>
		<description><![CDATA[Ever wanted to symbolicate a incomplete crash file (i.e. the logs you get from TestFlight)? You can symbolicate individual addresses from the crashlog in the terminal using a command named `atos` (if you&#8217;ve got the dSYM file for your build). Here&#8217;s an example: atos -arch armv7 -o MyApp.app.dSYM/Contents/Resources/DWARF/MyApp 0x0000babe This will output you the line [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to symbolicate a incomplete crash file (i.e. the logs you get from <a href="http://testflightapp.com/" target="_blank">TestFlight</a>)?</p>
<p>You can symbolicate individual addresses from the crashlog in the terminal using a command named `atos` (if you&#8217;ve got the dSYM file for your build). Here&#8217;s an example:</p>
<pre>atos -arch armv7 -o MyApp.app.dSYM/Contents/Resources/DWARF/MyApp 0x0000babe</pre>
<p>This will output you the line of code related to this address. I.e.:</p>
<pre>+[MyHappyClass fullOfFail] (in MyApp) + 429</pre>
<p>Pro Tip: not entering the address when calling the atos command leaves you in STDIN mode. Here you can add multiple addresses without restarting the tool.</p> <p><a href="http://nslog.de/?flattrss_redirect&amp;id=120&amp;md5=aba25063942c8915eb5d1718e95c4de9" title="Flattr" target="_blank"><img src="http://nslog.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://nslog.de/posts/120/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH and Back to My Mac</title>
		<link>http://nslog.de/posts/116</link>
		<comments>http://nslog.de/posts/116#comments</comments>
		<pubDate>Thu, 24 Mar 2011 09:31:32 +0000</pubDate>
		<dc:creator>Ullrich</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[BTMM]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://nslog.de/?p=116</guid>
		<description><![CDATA[Ever wanted to ssh into your mac from a remote location? Here&#8217;s how: ssh [name of your mac].[mobile me username].members.mac.com If you have a dot in your username you can escape it by prefixnig it with \\. So if your hostname would be Mainbrain and your mobileMe username is jon.doe the terminal command would look [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to ssh into your mac from a remote location? Here&#8217;s how:</p>
<pre>ssh [name of your mac].[mobile me username].members.mac.com</pre>
<p>If you have a dot in your username you can escape it by prefixnig it with \\. So if your hostname would be <em>Mainbrain</em> and your mobileMe username is <em>jon.doe</em> the terminal command would look as following:</p>
<pre>ssh mainbrain.jon\\.doe.members.mac.com</pre> <p><a href="http://nslog.de/?flattrss_redirect&amp;id=116&amp;md5=bbe99e36344ab74aab8e637ae34a71bd" title="Flattr" target="_blank"><img src="http://nslog.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://nslog.de/posts/116/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A little off topic this time but here…</title>
		<link>http://nslog.de/posts/113</link>
		<comments>http://nslog.de/posts/113#comments</comments>
		<pubDate>Mon, 01 Nov 2010 22:19:11 +0000</pubDate>
		<dc:creator>Ullrich</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Padrino]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://nslog.de/?p=113</guid>
		<description><![CDATA[A little off topic this time, but here is a little script that adds padrino completion to your zshell. function _padrino () { reply=( `padrino &#124; awk '/padrino/ {print $2}'` ) } compctl -K _padrino padrino]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">A little off topic this time, but here is a little script that adds <a href="http://www.padrinorb.com/" target="_blank">padrino</a> completion to your <a href="http://www.zsh.org/" target="_blank">zshell</a>.</div>
<div>
<pre>function _padrino () {
	reply=( `padrino | awk '/padrino/ {print $2}'` )
}
compctl -K _padrino padrino</pre>
</div> <p><a href="http://nslog.de/?flattrss_redirect&amp;id=113&amp;md5=d439a7a840bd5bfcc09dd5466567732f" title="Flattr" target="_blank"><img src="http://nslog.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://nslog.de/posts/113/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to slow down Simulator Animations</title>
		<link>http://nslog.de/posts/106</link>
		<comments>http://nslog.de/posts/106#comments</comments>
		<pubDate>Wed, 20 Oct 2010 09:16:54 +0000</pubDate>
		<dc:creator>Gernot</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Animations]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Simulator]]></category>

		<guid isPermaLink="false">http://nslog.de/?p=106</guid>
		<description><![CDATA[There&#8217;s a new way to slow down simulator which is really handy in case you want to debug rotation animations: In the Hardware menu, enable &#8220;Simulate Hardware Keyboard&#8221;. Hit the shift key three times in a row Now all the animations are slowed down for debugging. Triple-hit Shift again to deactivate.]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a new way to slow down simulator which is really handy in case you want to debug rotation animations:</p>
<ul>
<li>In the Hardware menu, enable &#8220;Simulate Hardware Keyboard&#8221;.</li>
<li>Hit the shift key three times in a row</li>
</ul>
<p>Now all the animations are slowed down for debugging. Triple-hit Shift again to deactivate.</p> <p><a href="http://nslog.de/?flattrss_redirect&amp;id=106&amp;md5=8f8a25506f818fde6e74de8dd0c8e232" title="Flattr" target="_blank"><img src="http://nslog.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://nslog.de/posts/106/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Colliding Category Methods</title>
		<link>http://nslog.de/posts/101</link>
		<comments>http://nslog.de/posts/101#comments</comments>
		<pubDate>Thu, 14 Oct 2010 07:14:18 +0000</pubDate>
		<dc:creator>Ullrich</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Bughunting]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[ObjC]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://nslog.de/?p=101</guid>
		<description><![CDATA[After multiple years of Objective-C experience yesterday was the first time that we actually ran into problems with colliding methods in categories. Here&#8217;s the story (you may skip this part): The issue was, that we added a method -setParameters: to NSMutableURLRequest which takes a dictionary and set&#8217;s it as query string or multipart form body [...]]]></description>
			<content:encoded><![CDATA[<p>After multiple years of Objective-C experience yesterday was the first time that we actually ran into problems with colliding methods in categories.</p>
<p>Here&#8217;s the story (you may skip this part): The issue was, that we added a method -setParameters: to NSMutableURLRequest which takes a dictionary and set&#8217;s it as query string or multipart form body depending on the HTTP Method used for sending the request. This method sadly conflicted with a category on the same class defined in a library called OAuthConsumer which doesn&#8217;t take a dictionary as argument but rather an array of key-value pairs. Both categories we&#8217;re linked to our application as static libraries.</p>
<p>The result was that our -setParameters: was called with an array although a dictionary was expected. We noticed the problem since NSArray is not responding to -allKeys. It could have gone would have not noticed the problem. Just imagine trying to debug a misbehavior when you&#8217;re looking at the wrong piece of code.</p>
<p>The quintessence, and what basically helped us finding the issue is a environment variable named OBJC_PRINT_REPLACED_METHODS. Similar to NSZombieEnabled you set it in the Arguments tab of your executable info as variable set to environment. Just like this:<a href="http://nslog.de/wp-content/uploads/2010/10/Executable-Info.png"></a></p>
<p><a href="http://nslog.de/wp-content/uploads/2010/10/Executable-Info.png"><img class="aligncenter size-full wp-image-104" title="Executable Info" src="http://nslog.de/wp-content/uploads/2010/10/Executable-Info.png" alt="" width="531" height="276" /></a></p> <p><a href="http://nslog.de/?flattrss_redirect&amp;id=101&amp;md5=eca7bc912967b3026269a441233b8f0b" title="Flattr" target="_blank"><img src="http://nslog.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://nslog.de/posts/101/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zombies</title>
		<link>http://nslog.de/posts/93</link>
		<comments>http://nslog.de/posts/93#comments</comments>
		<pubDate>Mon, 27 Sep 2010 13:27:39 +0000</pubDate>
		<dc:creator>Ullrich</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Bughunting]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[ObjC]]></category>

		<guid isPermaLink="false">http://nslog.de/?p=93</guid>
		<description><![CDATA[Everyone should know the NSZombieEnabled environment variable. Set it to YES to temporarily disable deallocation of objects which reach a retain count of zero. You then can set breakpoints to common methods such as: fb -[_NSZombie init] fb -[_NSZombie retainCount] fb -[_NSZombie retain] fb -[_NSZombie release] fb -[_NSZombie autorelease] fb -[_NSZombie methodSignatureForSelector:] fb -[_NSZombie respondsToSelector:] [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone should know the NSZombieEnabled environment variable. Set it to YES to temporarily disable deallocation of objects which reach a retain count of zero. You then can set breakpoints to common methods such as:</p>
<pre>fb -[_NSZombie init]
fb -[_NSZombie retainCount]
fb -[_NSZombie retain]
fb -[_NSZombie release]
fb -[_NSZombie autorelease]
fb -[_NSZombie methodSignatureForSelector:]
fb -[_NSZombie respondsToSelector:]
fb -[_NSZombie forwardInvocation:]
fb -[_NSZombie class]
fb -[_NSZombie dealloc]</pre>
<p>But you should also know that this only works on NS classes. To have a similar effect on CoreFoundation classes use CFZombieLevel. The value of CFZombieLevel is defined by a bit array. See the following table. A good value is 5 <img src='http://nslog.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre>Bit	Action
0	scribble deallocated CF memory
1	when scribbling deallocated CF memory, don't scribble object header (CFRuntimeBase)
4	never free memory used to hold CF objects
7	if set, scribble deallocations using bits 8..15, otherwise use 0xFC
8..15	if bit 7 is set, scribble deallocations using this value
16	scribble allocated CF memory
23	if set, scribble allocations using bits 24..31, otherwise use 0xCF
24..31	if bit 16 is set, scribble allocations using this value</pre> <p><a href="http://nslog.de/?flattrss_redirect&amp;id=93&amp;md5=3655bf74da567ff2fef53d200b67b8a7" title="Flattr" target="_blank"><img src="http://nslog.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://nslog.de/posts/93/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedded Frameworks</title>
		<link>http://nslog.de/posts/80</link>
		<comments>http://nslog.de/posts/80#comments</comments>
		<pubDate>Wed, 01 Sep 2010 13:57:57 +0000</pubDate>
		<dc:creator>Ullrich</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Voodoo]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://nslog.de/?p=80</guid>
		<description><![CDATA[When embedding frameworks to your Mac app there might be problems of finding a header file. There are three things to check for: The framework needs to have @executable_path/../Frameworks as Installation Directory in it&#8217;s build settings. The app should include the following in its framework search path: &#8220;$(CONFIGURATION_BUILD_DIR)/$(CONTENTS_FOLDER_PATH)/Frameworks&#8221; (including the quotes!) Also make sure to have [...]]]></description>
			<content:encoded><![CDATA[<p>When embedding frameworks to your Mac app there might be problems of finding a header file. There are three things to check for:</p>
<ul>
<li>The framework needs to have <strong>@executable_path/../Frameworks</strong> as Installation Directory in it&#8217;s build settings.</li>
<li>The app should include the following in its framework search path: <strong> &#8220;$(CONFIGURATION_BUILD_DIR)/$(CONTENTS_FOLDER_PATH)/Frameworks&#8221; </strong> (including the quotes!)</li>
<li>Also make sure to have a <strong>Copy Frameworks</strong> build phase and that your famework is added to it.</li>
</ul> <p><a href="http://nslog.de/?flattrss_redirect&amp;id=80&amp;md5=6b22e4667919081b7ae06633626dde62" title="Flattr" target="_blank"><img src="http://nslog.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://nslog.de/posts/80/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 0.967 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-02-01 21:22:03 -->

