<?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: iPhone Coding Tutorial &#8211; Creating an Online Leaderboard For Your Games</title>
	<atom:link href="/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/feed/" rel="self" type="application/rss+xml" />
	<link>http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/</link>
	<description>iPhone Programming Tutorials</description>
	<lastBuildDate>Mon, 18 Aug 2014 06:06:00 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.2</generator>
	<item>
		<title>By: srz2</title>
		<link>http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/#comment-9640</link>
		<dc:creator><![CDATA[srz2]]></dc:creator>
		<pubDate>Tue, 05 Mar 2013 23:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1426#comment-9640</guid>
		<description><![CDATA[do you have a method to return data from the MySQL database (maybe through php) that you can use instead of using a UIWebView? For instance, if I wanted to pull the information from a specific person and then display that in a UIViewController, how would i do that?]]></description>
		<content:encoded><![CDATA[<p>do you have a method to return data from the MySQL database (maybe through php) that you can use instead of using a UIWebView? For instance, if I wanted to pull the information from a specific person and then display that in a UIViewController, how would i do that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaa</title>
		<link>http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/#comment-9145</link>
		<dc:creator><![CDATA[Aaa]]></dc:creator>
		<pubDate>Fri, 20 Jan 2012 13:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1426#comment-9145</guid>
		<description><![CDATA[Nice tutorial,, brief and clear!
Thanks!]]></description>
		<content:encoded><![CDATA[<p>Nice tutorial,, brief and clear!<br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/#comment-9068</link>
		<dc:creator><![CDATA[bob]]></dc:creator>
		<pubDate>Thu, 29 Dec 2011 09:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1426#comment-9068</guid>
		<description><![CDATA[Hi, I am having issues with this tutorial. Â I have my database made and it shows username and score. I have addedÂ Â  Â  [self submitScore:score username:usernameTextbox.text]; to a button and added a corresponding textfield. Â However, when I press the button and the uiwebview pops up I just see an empty table with the column titles &#039;username&#039; and &#039;password&#039; the table created from the database). Â I don&#039;t know why the data (username from textfield and score) isn&#039;t being sent to the database?]]></description>
		<content:encoded><![CDATA[<p>Hi, I am having issues with this tutorial. Â I have my database made and it shows username and score. I have addedÂ Â  Â  [self submitScore:score username:usernameTextbox.text]; to a button and added a corresponding textfield. Â However, when I press the button and the uiwebview pops up I just see an empty table with the column titles &#8216;username&#8217; and &#8216;password&#8217; the table created from the database). Â I don&#8217;t know why the data (username from textfield and score) isn&#8217;t being sent to the database?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcelo</title>
		<link>http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/#comment-5938</link>
		<dc:creator><![CDATA[Marcelo]]></dc:creator>
		<pubDate>Mon, 04 Apr 2011 21:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1426#comment-5938</guid>
		<description><![CDATA[Thank you very much!!!]]></description>
		<content:encoded><![CDATA[<p>Thank you very much!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: web application developers</title>
		<link>http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/#comment-4968</link>
		<dc:creator><![CDATA[web application developers]]></dc:creator>
		<pubDate>Wed, 23 Feb 2011 13:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1426#comment-4968</guid>
		<description><![CDATA[very useful programs. Thanks for this. Very clear and helpful tutorial, good work!
]]></description>
		<content:encoded><![CDATA[<p>very useful programs. Thanks for this. Very clear and helpful tutorial, good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/#comment-4588</link>
		<dc:creator><![CDATA[Scott]]></dc:creator>
		<pubDate>Thu, 10 Feb 2011 09:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1426#comment-4588</guid>
		<description><![CDATA[Hate to say this, but where is the rest of the tutorial?

I read through it before your new site upgrade, and now I&#039;m starting it, the pages are broken...

Any help with this?]]></description>
		<content:encoded><![CDATA[<p>Hate to say this, but where is the rest of the tutorial?</p>
<p>I read through it before your new site upgrade, and now I&#8217;m starting it, the pages are broken&#8230;</p>
<p>Any help with this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/#comment-4404</link>
		<dc:creator><![CDATA[Joel]]></dc:creator>
		<pubDate>Mon, 07 Feb 2011 12:59:59 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1426#comment-4404</guid>
		<description><![CDATA[And I forgot a parentes:
if($phpHash != $hash) {]]></description>
		<content:encoded><![CDATA[<p>And I forgot a parentes:<br />
if($phpHash != $hash) {</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/#comment-4403</link>
		<dc:creator><![CDATA[Joel]]></dc:creator>
		<pubDate>Mon, 07 Feb 2011 12:58:02 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1426#comment-4403</guid>
		<description><![CDATA[Goddamnit:

#import [bracket]CommonCrypto/CommonDigest.h[bracket]]]></description>
		<content:encoded><![CDATA[<p>Goddamnit:</p>
<p>#import [bracket]CommonCrypto/CommonDigest.h[bracket]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/#comment-4402</link>
		<dc:creator><![CDATA[Joel]]></dc:creator>
		<pubDate>Mon, 07 Feb 2011 12:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1426#comment-4402</guid>
		<description><![CDATA[Utilities.m is supposed to import:

#import]]></description>
		<content:encoded><![CDATA[<p>Utilities.m is supposed to import:</p>
<p>#import</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://icodeblog.com/2009/10/29/iphone-coding-tutorial-creating-an-online-leaderboard-for-your-games/#comment-4401</link>
		<dc:creator><![CDATA[Joel]]></dc:creator>
		<pubDate>Mon, 07 Feb 2011 12:46:54 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=1426#comment-4401</guid>
		<description><![CDATA[Thank you very much for this excellent project! I tweaked your code a little bit so that it got more safe, using MD5 hash.

Objective-C:

Utilities.h
&lt;code&gt;
@interface NSString (md5)

- (NSString *) MD5;

@end
&lt;/code&gt;

Utilities.m
&lt;code&gt;
#import

@implementation NSString (md5)

- (NSString *) MD5
{
	const char *cStr = [self UTF8String];
	unsigned char result[16];
	CC_MD5( cStr, strlen(cStr), result );
	return [[NSString stringWithFormat:
			@&quot;%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X&quot;,
			result[0], result[1], result[2], result[3],
			result[4], result[5], result[6], result[7],
			result[8], result[9], result[10], result[11],
			result[12], result[13], result[14], result[15]
			] lowercaseString];
}

@end
&lt;/code&gt;

Leaderboard.m:
&lt;code&gt;
#import &quot;Utilities.h&quot;
...
NSString *secret = @&quot;some_secret&quot;;

NSString *hash = [[NSString alloc] initWithFormat:
				  @&quot;%@%@%f&quot;, secret, udid, theScore];
hash = [hash MD5];

NSString *urlString = [NSString stringWithFormat:@&quot;http://icodeblog.com/ws/put_score.php?hash=%@&amp;udid=%@&amp;name=%@&amp;score=%f&quot;
					   hash,udid,username,theScore];
&lt;/code&gt;

PHP:

put_score.php
&lt;code&gt;
$secret = &quot;some_secret&quot;;

$udid   = isset($_GET[&#039;udid&#039;]) ? $_GET[&#039;udid&#039;] : &quot;&quot;;
$name   = isset($_GET[&#039;name&#039;]) ? $_GET[&#039;name&#039;]  : &quot;&quot;;
$score  = isset($_GET[&#039;score&#039;]) ? $_GET[&#039;score&#039;] : &quot;&quot;;
$hash  = isset($_GET[&#039;hash&#039;]) ? $_GET[&#039;hash&#039;] : &quot;&quot;;

$udid  = mysql_real_escape_string($udid);
$name  = mysql_real_escape_string($name);
$score = mysql_real_escape_string($score);
$hash = mysql_real_escape_string($hash);

$phpHash = $secret . $udid . $score;
$phpHash = md5($phpHash);

if($phpHash != $hash {
		die(&#039;Nothing to see here...&#039;);
	}
&lt;/code&gt;

I hope this help someone!

Best regards,
Joel]]></description>
		<content:encoded><![CDATA[<p>Thank you very much for this excellent project! I tweaked your code a little bit so that it got more safe, using MD5 hash.</p>
<p>Objective-C:</p>
<p>Utilities.h<br />
<code><br />
@interface NSString (md5)</p>
<p>- (NSString *) MD5;</p>
<p>@end<br />
</code></p>
<p>Utilities.m<br />
<code><br />
#import</p>
<p>@implementation NSString (md5)</p>
<p>- (NSString *) MD5<br />
{<br />
	const char *cStr = [self UTF8String];<br />
	unsigned char result[16];<br />
	CC_MD5( cStr, strlen(cStr), result );<br />
	return [[NSString stringWithFormat:<br />
			@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",<br />
			result[0], result[1], result[2], result[3],<br />
			result[4], result[5], result[6], result[7],<br />
			result[8], result[9], result[10], result[11],<br />
			result[12], result[13], result[14], result[15]<br />
			] lowercaseString];<br />
}</p>
<p>@end<br />
</code></p>
<p>Leaderboard.m:<br />
<code><br />
#import "Utilities.h"<br />
...<br />
NSString *secret = @"some_secret";</p>
<p>NSString *hash = [[NSString alloc] initWithFormat:<br />
				  @"%@%@%f", secret, udid, theScore];<br />
hash = [hash MD5];</p>
<p>NSString *urlString = [NSString stringWithFormat:@"http://icodeblog.com/ws/put_score.php?hash=%@&amp;udid=%@&amp;name=%@&amp;score=%f"<br />
					   hash,udid,username,theScore];<br />
</code></p>
<p>PHP:</p>
<p>put_score.php<br />
<code><br />
$secret = "some_secret";</p>
<p>$udid   = isset($_GET['udid']) ? $_GET['udid'] : "";<br />
$name   = isset($_GET['name']) ? $_GET['name']  : "";<br />
$score  = isset($_GET['score']) ? $_GET['score'] : "";<br />
$hash  = isset($_GET['hash']) ? $_GET['hash'] : "";</p>
<p>$udid  = mysql_real_escape_string($udid);<br />
$name  = mysql_real_escape_string($name);<br />
$score = mysql_real_escape_string($score);<br />
$hash = mysql_real_escape_string($hash);</p>
<p>$phpHash = $secret . $udid . $score;<br />
$phpHash = md5($phpHash);</p>
<p>if($phpHash != $hash {<br />
		die('Nothing to see here...');<br />
	}<br />
</code></p>
<p>I hope this help someone!</p>
<p>Best regards,<br />
Joel</p>
]]></content:encoded>
	</item>
</channel>
</rss>
