<?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 on: Pick Your Own Adventure iPhone Edition</title>
	<atom:link href="/2010/03/24/choose-your-own-adventure-iphone-edition/feed/" rel="self" type="application/rss+xml" />
	<link>http://icodeblog.com/2010/03/24/choose-your-own-adventure-iphone-edition/</link>
	<description>iPhone Programming Tutorials</description>
	<lastBuildDate>Sat, 06 Sep 2014 23:52:00 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
	<item>
		<title>By: Thromordyn</title>
		<link>http://icodeblog.com/2010/03/24/choose-your-own-adventure-iphone-edition/#comment-5750</link>
		<dc:creator><![CDATA[Thromordyn]]></dc:creator>
		<pubDate>Fri, 18 Mar 2011 14:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1832#comment-5750</guid>
		<description><![CDATA[Don&#039;t I feel stupid now. I made a mistake somewhere to generate those warnings. Oops.]]></description>
		<content:encoded><![CDATA[<p>Don&#8217;t I feel stupid now. I made a mistake somewhere to generate those warnings. Oops.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thromordyn</title>
		<link>http://icodeblog.com/2010/03/24/choose-your-own-adventure-iphone-edition/#comment-5748</link>
		<dc:creator><![CDATA[Thromordyn]]></dc:creator>
		<pubDate>Fri, 18 Mar 2011 14:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1832#comment-5748</guid>
		<description><![CDATA[This looks great, but you have a bug in the &#039;showStoryForCurrentPiece&#039; method.

...
// Sending &#039;CYOAViewController *&#039; to parameter of incompatible type &#039;id &#039;
// space added between id and bracket because your comment handler is parsing HTML... off buttons are good
delegate:self
...
// Class &#039;CYOAViewController&#039; does not implement the &#039;UIActionSheetDelegate&#039; protocol
otherButtleTitles:[currentPiece choice1], @&quot;Retry&quot;, nil];
...

You&#039;re also using alert views as the primary interface. Quick, but sloppy.


If I ever get started on my own app (the one that uses this kind of prompt/action structure), I&#039;d be happy to give you some credit for getting it started. Throw me an email if you&#039;re interested.


On an unrelated note, Safari&#039;s &quot;Undo Close Tab&quot; feature should have an off button. Or at least a different shortcut. I can&#039;t undo typing if I closed a tab recently -.-&quot;]]></description>
		<content:encoded><![CDATA[<p>This looks great, but you have a bug in the &#8216;showStoryForCurrentPiece&#8217; method.</p>
<p>&#8230;<br />
// Sending &#8216;CYOAViewController *&#8217; to parameter of incompatible type &#8216;id &#8216;<br />
// space added between id and bracket because your comment handler is parsing HTML&#8230; off buttons are good<br />
delegate:self<br />
&#8230;<br />
// Class &#8216;CYOAViewController&#8217; does not implement the &#8216;UIActionSheetDelegate&#8217; protocol<br />
otherButtleTitles:[currentPiece choice1], @&#8221;Retry&#8221;, nil];<br />
&#8230;</p>
<p>You&#8217;re also using alert views as the primary interface. Quick, but sloppy.</p>
<p>If I ever get started on my own app (the one that uses this kind of prompt/action structure), I&#8217;d be happy to give you some credit for getting it started. Throw me an email if you&#8217;re interested.</p>
<p>On an unrelated note, Safari&#8217;s &#8220;Undo Close Tab&#8221; feature should have an off button. Or at least a different shortcut. I can&#8217;t undo typing if I closed a tab recently -.-&#8220;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thromordyn</title>
		<link>http://icodeblog.com/2010/03/24/choose-your-own-adventure-iphone-edition/#comment-5749</link>
		<dc:creator><![CDATA[Thromordyn]]></dc:creator>
		<pubDate>Fri, 18 Mar 2011 14:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1832#comment-5749</guid>
		<description><![CDATA[What the hell. Why&#039;d it go through so many times? Can you delete those extras? *headdesk*]]></description>
		<content:encoded><![CDATA[<p>What the hell. Why&#8217;d it go through so many times? Can you delete those extras? *headdesk*</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thromordyn</title>
		<link>http://icodeblog.com/2010/03/24/choose-your-own-adventure-iphone-edition/#comment-5747</link>
		<dc:creator><![CDATA[Thromordyn]]></dc:creator>
		<pubDate>Fri, 18 Mar 2011 14:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1832#comment-5747</guid>
		<description><![CDATA[This looks great, but you have a bug in the &#039;showStoryForCurrentPiece&#039; method.

...
// Sending &#039;CYOAViewController *&#039; to parameter of incompatible type &#039;id&#039;
delegate:self
...
// Class &#039;CYOAViewController&#039; does not implement the &#039;UIActionSheetDelegate&#039; protocol
otherButtleTitles:[currentPiece choice1], @&quot;Retry&quot;, nil];
...

You&#039;re also using alert views as the primary interface. Quick, but sloppy.


If I ever get started on my own app (the one that uses this kind of prompt/action structure), I&#039;d be happy to give you some credit for getting it started. Throw me an email if you&#039;re interested.


On an unrelated note, Safari&#039;s &quot;Undo Close Tab&quot; feature should have an off button. Or at least a different shortcut. I can&#039;t undo typing if I closed a tab recently -.-&quot;]]></description>
		<content:encoded><![CDATA[<p>This looks great, but you have a bug in the &#8216;showStoryForCurrentPiece&#8217; method.</p>
<p>&#8230;<br />
// Sending &#8216;CYOAViewController *&#8217; to parameter of incompatible type &#8216;id&#8217;<br />
delegate:self<br />
&#8230;<br />
// Class &#8216;CYOAViewController&#8217; does not implement the &#8216;UIActionSheetDelegate&#8217; protocol<br />
otherButtleTitles:[currentPiece choice1], @&#8221;Retry&#8221;, nil];<br />
&#8230;</p>
<p>You&#8217;re also using alert views as the primary interface. Quick, but sloppy.</p>
<p>If I ever get started on my own app (the one that uses this kind of prompt/action structure), I&#8217;d be happy to give you some credit for getting it started. Throw me an email if you&#8217;re interested.</p>
<p>On an unrelated note, Safari&#8217;s &#8220;Undo Close Tab&#8221; feature should have an off button. Or at least a different shortcut. I can&#8217;t undo typing if I closed a tab recently -.-&#8220;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thromordyn</title>
		<link>http://icodeblog.com/2010/03/24/choose-your-own-adventure-iphone-edition/#comment-5746</link>
		<dc:creator><![CDATA[Thromordyn]]></dc:creator>
		<pubDate>Fri, 18 Mar 2011 13:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1832#comment-5746</guid>
		<description><![CDATA[This is exactly what I&#039;ve been looking for. Thanks much.]]></description>
		<content:encoded><![CDATA[<p>This is exactly what I&#8217;ve been looking for. Thanks much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tile Repair Bucks County</title>
		<link>http://icodeblog.com/2010/03/24/choose-your-own-adventure-iphone-edition/#comment-5534</link>
		<dc:creator><![CDATA[Tile Repair Bucks County]]></dc:creator>
		<pubDate>Wed, 09 Mar 2011 03:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1832#comment-5534</guid>
		<description><![CDATA[This is my first time I have visited your site. I found a lot of interesting stuff in your blog.]]></description>
		<content:encoded><![CDATA[<p>This is my first time I have visited your site. I found a lot of interesting stuff in your blog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://icodeblog.com/2010/03/24/choose-your-own-adventure-iphone-edition/#comment-4428</link>
		<dc:creator><![CDATA[Joe]]></dc:creator>
		<pubDate>Fri, 31 Dec 2010 14:16:04 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1832#comment-4428</guid>
		<description><![CDATA[Hey guys, Amazing tutorial, How could I make this not show up all in AlertViews? could it be just text, if possible]]></description>
		<content:encoded><![CDATA[<p>Hey guys, Amazing tutorial, How could I make this not show up all in AlertViews? could it be just text, if possible</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Liz</title>
		<link>http://icodeblog.com/2010/03/24/choose-your-own-adventure-iphone-edition/#comment-3768</link>
		<dc:creator><![CDATA[Liz]]></dc:creator>
		<pubDate>Sat, 16 Oct 2010 17:35:03 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1832#comment-3768</guid>
		<description><![CDATA[Great tutorial, thanks for posting! I&#039;ve modified it a bit but I was wondering, if I wanted to add more levels, how would I go about doing that? Would I create another set of variables like middlePieceA/middlePieceB? I&#039;m new to this so forgive me if this is an obvious question. Thanks again for posting this!]]></description>
		<content:encoded><![CDATA[<p>Great tutorial, thanks for posting! I&#8217;ve modified it a bit but I was wondering, if I wanted to add more levels, how would I go about doing that? Would I create another set of variables like middlePieceA/middlePieceB? I&#8217;m new to this so forgive me if this is an obvious question. Thanks again for posting this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://icodeblog.com/2010/03/24/choose-your-own-adventure-iphone-edition/#comment-3766</link>
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Wed, 28 Apr 2010 20:48:04 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1832#comment-3766</guid>
		<description><![CDATA[This project has a pretty obvious memory leak.

In your actionSheet:clickedButtonAtIndex: method, you call [self makeTheStory] for the second time. This is an issue because the previously allocated AdventurePiece&#039;s are still out there in memory, and are inaccessible since they were created as on the stack instances. There are two approaches to fixing this.

1) Make the objects part of the autorelease pool by (I believe) changing the constructor of Adventure piece from:
if(self = [super init])
TO:
if(self = [super autorelease])
If I am wrong about that I&#039;m sorry...

2) Make the following changes to use self managed memory: (I did not compile this so it may need some tweaking!)
In your AdventurePiece.m write the following destructor:
- (void) dealloc
{
       if(choice1)  // If object != nil
             [choice1 release];
       if(choice2)  // If object != nil
            [choice2 release];
       [super dealloc];
}

And then you must maintain a reference to the first piece to start the chain reaction of deletion. Add to CYOAViewController.h:
AdventurePiece *startPiece;
(And add it to the synthesize in the .m)

Add to the makeTheStory method at the last line:
startPiece = currentPiece;
This copies the address so that when currentPiece changes the top level (starting) piece is saved.

Then, finally, in the actionSheet:clickedButtonAtIndex: method, call:
[startPiece release];
Before you call [self makeTheStory]; that way the entire story is deleted and remade. The other way is to instead of releasing, you could just say currentPiece = startPiece; and reuse the same story, then don&#039;t call [self makeTheStory], but either way works...]]></description>
		<content:encoded><![CDATA[<p>This project has a pretty obvious memory leak.</p>
<p>In your actionSheet:clickedButtonAtIndex: method, you call [self makeTheStory] for the second time. This is an issue because the previously allocated AdventurePiece&#8217;s are still out there in memory, and are inaccessible since they were created as on the stack instances. There are two approaches to fixing this.</p>
<p>1) Make the objects part of the autorelease pool by (I believe) changing the constructor of Adventure piece from:<br />
if(self = [super init])<br />
TO:<br />
if(self = [super autorelease])<br />
If I am wrong about that I&#8217;m sorry&#8230;</p>
<p>2) Make the following changes to use self managed memory: (I did not compile this so it may need some tweaking!)<br />
In your AdventurePiece.m write the following destructor:<br />
&#8211; (void) dealloc<br />
{<br />
       if(choice1)  // If object != nil<br />
             [choice1 release];<br />
       if(choice2)  // If object != nil<br />
            [choice2 release];<br />
       [super dealloc];<br />
}</p>
<p>And then you must maintain a reference to the first piece to start the chain reaction of deletion. Add to CYOAViewController.h:<br />
AdventurePiece *startPiece;<br />
(And add it to the synthesize in the .m)</p>
<p>Add to the makeTheStory method at the last line:<br />
startPiece = currentPiece;<br />
This copies the address so that when currentPiece changes the top level (starting) piece is saved.</p>
<p>Then, finally, in the actionSheet:clickedButtonAtIndex: method, call:<br />
[startPiece release];<br />
Before you call [self makeTheStory]; that way the entire story is deleted and remade. The other way is to instead of releasing, you could just say currentPiece = startPiece; and reuse the same story, then don&#8217;t call [self makeTheStory], but either way works&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://icodeblog.com/2010/03/24/choose-your-own-adventure-iphone-edition/#comment-3765</link>
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Fri, 09 Apr 2010 22:47:54 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1832#comment-3765</guid>
		<description><![CDATA[Well this is annoying, just started developing my own choose your own adventure game a few weeks ago. Hope no one starts to think I&#039;ve been stealing ideas.]]></description>
		<content:encoded><![CDATA[<p>Well this is annoying, just started developing my own choose your own adventure game a few weeks ago. Hope no one starts to think I&#8217;ve been stealing ideas.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
