<?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>W2OM - iPhone by code</title>
	<atom:link href="http://w2om.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://w2om.com</link>
	<description>XCode, ios, objective C, sdk, source code, examples, tutorials and more</description>
	<lastBuildDate>Sun, 14 Aug 2011 18:20:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>How to know orientation iOs ?</title>
		<link>http://w2om.com/how-to-know-orientation-ios/</link>
		<comments>http://w2om.com/how-to-know-orientation-ios/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 17:50:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://w2om.com/?p=512</guid>
		<description><![CDATA[After several tries, I found the next to work the best : - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { if((toInterfaceOrientation == UIDeviceOrientationLandscapeLeft) &#124;&#124; (toInterfaceOrientation == UIDeviceOrientationLandscapeRight)) { NSLog(@&#8221;didRotateFromInterfaceOrientation Landscape&#8221;); isPortrait = NO; //Global variable } else { NSLog(@&#8221;didRotateFromInterfaceOrientation Potrait&#8221;); isPortrait = YES; }]]></description>
			<content:encoded><![CDATA[<p>After several tries, I found the next to work the best :</p>
<p>- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {</p>
<p>if((toInterfaceOrientation == UIDeviceOrientationLandscapeLeft) || (toInterfaceOrientation == UIDeviceOrientationLandscapeRight)) {<br />
NSLog(@&#8221;didRotateFromInterfaceOrientation Landscape&#8221;);<br />
isPortrait = NO; //Global variable<br />
}<br />
else {<br />
NSLog(@&#8221;didRotateFromInterfaceOrientation Potrait&#8221;);<br />
isPortrait = YES;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://w2om.com/how-to-know-orientation-ios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stack trace or more info on unhandled exception in Xcode/iPhone</title>
		<link>http://w2om.com/stack-trace-or-more-info-on-unhandled-exception-in-xcodeiphone/</link>
		<comments>http://w2om.com/stack-trace-or-more-info-on-unhandled-exception-in-xcodeiphone/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 20:01:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>

		<guid isPermaLink="false">http://w2om.com/?p=505</guid>
		<description><![CDATA[1) If you add two breakpoints, you should be able to debug these exceptions. To do this, go to Run &#124; Show &#124; Breakpoints and create two global breakpoints (I do them globally because they are so useful in all my applications). The first should be named "objc_exception_throw" and its location should be "libobjc.A.dylib". The <a href='http://w2om.com/stack-trace-or-more-info-on-unhandled-exception-in-xcodeiphone/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<div style="text-align: left;">
<pre>1)

If you add two breakpoints, you should be able to debug these exceptions.
To do this, go to Run | Show | Breakpoints and create two global breakpoints
(I do them globally because they are so useful in all my applications).
The first should be named "objc_exception_throw" and its location should be "libobjc.A.dylib".
The second should be "-[NSException raise]" and its location should be "CoreFoundation".
Now, if you start debugging your application with breakpoints enabled,
it should break on the throw of these exceptions.
You should then be able to see the chain of events that led to the exception within the debugger.

2)
int main(int argc, char *argv[]) {
 int retVal;
 NSAutoreleasePool * pool;
 @try
 {
 pool = [[NSAutoreleasePool alloc] init];
 retVal = UIApplicationMain(argc, argv, nil, nil);
 }
 @catch(NSException* e)
 {
 NSLog(@"%@", e.reason);
 }
 @finally
 {
 [pool release];
 }
 return retVal;
}

3) Check the stack trace on the left side :

http://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/Debugging/Debugging.html

<a href="http://w2om.com/wp-content/uploads/2011/08/xcode4_stack_trace.tiff"><img class="alignnone size-full wp-image-508" title="xcode4_stack_trace" src="http://w2om.com/wp-content/uploads/2011/08/xcode4_stack_trace.tiff" alt="" /></a></pre>
</div>
<table>
<tbody>
<tr>
<td style="text-align: left;"></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://w2om.com/stack-trace-or-more-info-on-unhandled-exception-in-xcodeiphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>show method name and line in debug</title>
		<link>http://w2om.com/show-method-name-and-line-in-debug/</link>
		<comments>http://w2om.com/show-method-name-and-line-in-debug/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 14:50:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>

		<guid isPermaLink="false">http://w2om.com/?p=502</guid>
		<description><![CDATA[Here are some useful macros around NSLog I use a lot: #ifdef DEBUG #   define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); #else #   define DLog(...) #endif // ALog always displays output regardless of the DEBUG setting #define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); The DLog <a href='http://w2om.com/show-method-name-and-line-in-debug/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Here are some useful macros around NSLog I use a lot:</p>
<pre><code>#ifdef DEBUG
#   define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#   define DLog(...)
#endif

// ALog always displays output regardless of the DEBUG setting
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
</code></pre>
<p>The DLog macro is used to only output when the DEBUG variable is set  (-DDEBUG in the projects&#8217;s C flags for the debug confirguration).</p>
<p>ALog will always output text (like the regular NSLog).</p>
<p>The output (e.g. ALog(@&#8221;Hello world&#8221;) ) will look like this:</p>
<pre><code>-[LibraryController awakeFromNib] [Line 364] Hello world</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://w2om.com/show-method-name-and-line-in-debug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean MAC space</title>
		<link>http://w2om.com/clean-mac-space/</link>
		<comments>http://w2om.com/clean-mac-space/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 17:53:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>

		<guid isPermaLink="false">http://w2om.com/?p=499</guid>
		<description><![CDATA[At last I find a good tool to diagnose why my disk is getting full : http://download.cnet.com/OmniDiskSweeper/3000-18512_4-6226.html &#160; And it&#8217;s free&#8230;]]></description>
			<content:encoded><![CDATA[<p>At last I find a good tool to diagnose why my disk is getting full :</p>
<p>http://download.cnet.com/OmniDiskSweeper/3000-18512_4-6226.html</p>
<p>&nbsp;</p>
<p>And it&#8217;s free&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://w2om.com/clean-mac-space/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make an iPhone game without coding ?</title>
		<link>http://w2om.com/how-to-make-an-iphone-game-without-coding/</link>
		<comments>http://w2om.com/how-to-make-an-iphone-game-without-coding/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 06:23:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://w2om.com/?p=495</guid>
		<description><![CDATA[Amaze your friends with games you create. Get your game played by thousands of people and earn money. With 'Game Creator' application for iPhone or iPod, you can create games without the need of coding. Try it now - Press this link]]></description>
			<content:encoded><![CDATA[<pre id="line131">Amaze your friends with games you create.
Get your game played by thousands of people and earn money.

With 'Game Creator' application for iPhone or iPod, you can create games without
the need of coding.

<a href="http://w2om.com/wp-content/uploads/2011/06/a_Loading_1.png"><img class="alignnone size-medium wp-image-496" title="create iphone game" src="http://w2om.com/wp-content/uploads/2011/06/a_Loading_1-300x200.png" alt="" width="300" height="200" /></a>

<a title="Game Creator" href="http://itunes.apple.com/us/app/game-creator/id441117302?mt=8&amp;ls=1">Try it now - Press this link</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://w2om.com/how-to-make-an-iphone-game-without-coding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to understand crash report</title>
		<link>http://w2om.com/how-to-understand-crash-report/</link>
		<comments>http://w2om.com/how-to-understand-crash-report/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 18:32:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>

		<guid isPermaLink="false">http://w2om.com/?p=491</guid>
		<description><![CDATA[1) Connect the iPhone to the MAC 2) In itunes press sync 3) Drag the crashReport file to the xcode organizer (From ~/Library/Logs/CrashReporter/MobileDevice/&#60;DEVICE_NAME&#62;) 4) Press the &#8216;Device Logs&#8217; on the right side in the organizer &#160;]]></description>
			<content:encoded><![CDATA[<p>1) Connect the iPhone to the MAC</p>
<p>2) In itunes press sync</p>
<p>3) Drag the crashReport file to the xcode organizer (From <code>~/Library/Logs/CrashReporter/MobileDevice/&lt;DEVICE_NAME&gt;</code>)</p>
<p>4) Press the &#8216;Device Logs&#8217; on the right side in the organizer</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://w2om.com/how-to-understand-crash-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 Stars</title>
		<link>http://w2om.com/5-stars/</link>
		<comments>http://w2om.com/5-stars/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 14:20:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>

		<guid isPermaLink="false">http://w2om.com/?p=486</guid>
		<description><![CDATA[http://itunes.apple.com/us/app/5-stars/id431945200?mt=8&#38;ls=1# Celebrating the 50th anniversary of the first human spaceflight !&#160; *** A 40 stages game *** 5 stars will bring you lot of original and crazy levels. Playing an astronaut who should get the flag while searching a path and escaping from rockets, black holes and aliens. *** Test your astronaut skills now ! <a href='http://w2om.com/5-stars/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a title="5 Stars" href="http://itunes.apple.com/us/app/5-stars/id431945200?mt=8&amp;ls=1#" target="_blank">http://itunes.apple.com/us/app/5-stars/id431945200?mt=8&amp;ls=1#</a></p>
<div>Celebrating the 50th anniversary of the first human spaceflight !&nbsp;</p>
<p>*** A 40 stages game ***</p>
<p>5 stars will bring you lot of original and crazy levels.</p>
<p>Playing an astronaut who should get the flag while searching a path and escaping from rockets, black holes and aliens.</p>
<p>*** Test your astronaut skills now !</p>
<p>&nbsp;</p>
<p><a href="http://w2om.com/wp-content/uploads/2011/04/5stars.png"><img class="alignnone size-medium wp-image-488" title="5 Stars" src="http://w2om.com/wp-content/uploads/2011/04/5stars-300x200.png" alt="5 Stars" width="300" height="200" /></a></p>
</div>
<div>
<p><a title="5 Stars" href="http://itunes.apple.com/us/app/5-stars/id431945200?mt=8&amp;ls=1#" target="_blank">http://itunes.apple.com/us/app/5-stars/id431945200?mt=8&amp;ls=1#</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://w2om.com/5-stars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cocos2D icon files are not working</title>
		<link>http://w2om.com/cocos2d-icon-files-are-not-working/</link>
		<comments>http://w2om.com/cocos2d-icon-files-are-not-working/#comments</comments>
		<pubDate>Sun, 10 Apr 2011 18:40:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>

		<guid isPermaLink="false">http://w2om.com/?p=482</guid>
		<description><![CDATA[Rename the Icon files (in the plist file) to CFBundleIconFiles. Clean all targets and rebuild.]]></description>
			<content:encoded><![CDATA[<p>Rename the Icon files (in the plist file) to CFBundleIconFiles.</p>
<p>Clean all targets and rebuild.</p>
]]></content:encoded>
			<wfw:commentRss>http://w2om.com/cocos2d-icon-files-are-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to upload binary for new app to app store review</title>
		<link>http://w2om.com/how-to-upload-binary-for-new-app-to-app-store-review/</link>
		<comments>http://w2om.com/how-to-upload-binary-for-new-app-to-app-store-review/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 12:52:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>

		<guid isPermaLink="false">http://w2om.com/?p=479</guid>
		<description><![CDATA[Find the &#8216;Application Loader&#8217; under the Applications folder on your MAC. &#160;]]></description>
			<content:encoded><![CDATA[<p>Find the &#8216;Application Loader&#8217; under the Applications folder on your MAC.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://w2om.com/how-to-upload-binary-for-new-app-to-app-store-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A bit of photoshop &#8211; Ball of fire</title>
		<link>http://w2om.com/a-bit-of-photoshop-ball-of-fire/</link>
		<comments>http://w2om.com/a-bit-of-photoshop-ball-of-fire/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 21:55:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>

		<guid isPermaLink="false">http://w2om.com/?p=476</guid>
		<description><![CDATA[http://www.funphotoart.com/drawings/create-a-fireball-or-mars-like-planet]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.funphotoart.com/drawings/create-a-fireball-or-mars-like-planet" target="_blank">http://www.funphotoart.com/drawings/create-a-fireball-or-mars-like-planet</a></p>
]]></content:encoded>
			<wfw:commentRss>http://w2om.com/a-bit-of-photoshop-ball-of-fire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

