<?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>Adylitica, Inc.</title>
	<atom:link href="http://adylitica.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://adylitica.com</link>
	<description>Software Development with a Global Edge</description>
	<lastBuildDate>Thu, 04 Mar 2010 09:41:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adylitica&#8217;s first game, Electron Zero is now live on the App Store!</title>
		<link>http://adylitica.com/2010/03/04/adyliticas-first-game-electron-zero-is-now-live-on-the-app-store/</link>
		<comments>http://adylitica.com/2010/03/04/adyliticas-first-game-electron-zero-is-now-live-on-the-app-store/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 09:39:49 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[Corporate Info]]></category>

		<guid isPermaLink="false">http://adylitica.com/?p=223</guid>
		<description><![CDATA[Get ready for the most addictive memory game for the iPhone! Follow Electron Zero through twists and turns, with explosions and bonus points for speed.
]]></description>
			<content:encoded><![CDATA[<p>Get ready for the most addictive memory game for the iPhone! Follow Electron Zero through twists and turns, with explosions and bonus points for speed.</p>
<p>Based on the retro arcade experience, complete with custom 8 bit sounds and black backgrounds, Electron Zero whisks you to the golden age of simple and fun gaming.</p>
<p>Check it out at <a href='http://electron.zero.com'>http://electron.zero.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adylitica.com/2010/03/04/adyliticas-first-game-electron-zero-is-now-live-on-the-app-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFBundleResourceSpecification error when submitting an iPhone app to Apple</title>
		<link>http://adylitica.com/2010/02/23/cfbundleresourcespecification-error-submitting-iphone-app/</link>
		<comments>http://adylitica.com/2010/02/23/cfbundleresourcespecification-error-submitting-iphone-app/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 08:39:22 +0000</pubDate>
		<dc:creator>Idriss</dc:creator>
				<category><![CDATA[Mac/iPhone Dev]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://adylitica.com/?p=212</guid>
		<description><![CDATA[If you're seeing a does not contain a CFBundleResourceSpecification  error when submitting apps to the Apple App Store and your application uses external SDKs, we might have the solution for you.]]></description>
			<content:encoded><![CDATA[<p>Today we ran into a very obscure error message when submitting an iPhone application to the Apple App Store for review:</p>
<p>ApplicationLoader error:<code>"Info.plist does not contain a CFBundleResourceSpecification"</code><br />
iTunesConnect error:<code>"The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate."</code></p>
<p>After <del datetime="2010-02-23T08:26:37+00:00">a few</del> several hours we finally found an answer to this problem via this <a href="http://stackoverflow.com/questions/2180201/cant-upload-application-binary-to-the-app-store" style='text-decoration: underline'>post</a>.</p>
<p>It appears that when you have more than one SDK reference in your project, XCode can get confused. We were using ScoreLoop in our application, and that is provided as an SDK to include.</p>
<p>The solution is to go to the target build properties (⌘-I) and to add <code>$(SDKROOT)/ResourceRules.plist</code> to the <em>&#8220;Code Signing Resource Rules Path&#8221;</em> key.</p>
<p>Thanks a lot Sixten Otto!</p>
]]></content:encoded>
			<wfw:commentRss>http://adylitica.com/2010/02/23/cfbundleresourcespecification-error-submitting-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XCode project references: avoid the headache</title>
		<link>http://adylitica.com/2010/02/22/xcode-project-references-avoid-the-headache/</link>
		<comments>http://adylitica.com/2010/02/22/xcode-project-references-avoid-the-headache/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 11:17:01 +0000</pubDate>
		<dc:creator>Idriss</dc:creator>
				<category><![CDATA[Mac/iPhone Dev]]></category>
		<category><![CDATA[fbconnect]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://adylitica.com/?p=199</guid>
		<description><![CDATA[When you have a project which depends on different libraries that you have to build (Facebook connect for example), you really don&#8217;t want copy the sources inside your project (even if some guys in a video tells you so). Because you won&#8217;t be able to share this code between different project.
For me, the easiest way [...]]]></description>
			<content:encoded><![CDATA[<p>When you have a project which depends on different libraries that you have to build (Facebook connect for example), you really don&#8217;t want copy the sources inside your project (even if some guys in a video tells you so). Because you won&#8217;t be able to share this code between different project.</p>
<p>For me, the easiest way to deal with this problems is to do a project reference in your project.<br />
Let&#8217;s take a simple example. Your project (Main Project) uses a library (Library Project) like Cocos2D or FBConnect&#8230;</p>
<p>Step 1: Link the project<br />
Open both projects (the Main project and the Library project). Drag the Library Project root (the little blue xcode icon file) to your Main Project root.</p>
<div id="attachment_209" class="wp-caption alignnone" style="width: 610px"><a href="http://adylitica.com/wp-content/uploads/2010/02/screen12.png"><img class="size-full wp-image-209" title="Link the 2 projects" src="http://adylitica.com/wp-content/uploads/2010/02/screen12.png" alt="" width="600" height="490" /></a><p class="wp-caption-text">Drag the lib project to the main project</p></div>
<p>If you look in the project, you&#8217;ll see the products of the library project.</p>
<div id="attachment_205" class="wp-caption alignnone" style="width: 536px"><a href="http://adylitica.com/wp-content/uploads/2010/02/Screen-shot-2010-02-22-at-5.35.32-PM.png"><img class="size-full wp-image-205" title="The Linked Project" src="http://adylitica.com/wp-content/uploads/2010/02/Screen-shot-2010-02-22-at-5.35.32-PM.png" alt="" width="526" height="417" /></a><p class="wp-caption-text">The linked project will present the products</p></div>
<p>Step 2: Create the dependencies<br />
Now that your Main project is linked the the Lib project, it&#8217;s time to tell him which product you&#8217;re going to use.<br />
Go to your target and open Get Info (CMD-i). Go to the &#8220;general&#8221; tab. In the window &#8220;Direct dependency&#8221; press +. The Lib Project should appear. Click on the lib you want to use.</p>
<div id="attachment_206" class="wp-caption alignnone" style="width: 851px"><a href="http://adylitica.com/wp-content/uploads/2010/02/Screen-shot-2010-02-22-at-5.36.06-PM.png"><img class="size-full wp-image-206" title="The Get Info dialog" src="http://adylitica.com/wp-content/uploads/2010/02/Screen-shot-2010-02-22-at-5.36.06-PM.png" alt="" width="841" height="657" /></a><p class="wp-caption-text">Add a dependency with the product</p></div>
<p>Now Drag the lib to the Link Binary with a Library folder.</p>
<div id="attachment_207" class="wp-caption alignnone" style="width: 323px"><a href="http://adylitica.com/wp-content/uploads/2010/02/screen2.png"><img class="size-full wp-image-207" title="Link the lib" src="http://adylitica.com/wp-content/uploads/2010/02/screen2.png" alt="" width="313" height="405" /></a><p class="wp-caption-text">link the lib to the binary</p></div>
<p>Step 3: The (in)famous header files</p>
<p>I havent found the best solution to this, but the one i prefer is to create a source tree entry&#8230; Hey come back, it&#8217;s really easy!<br />
Open your Xcode preferences (CMD-,), go to the &#8220;Source Trees&#8221; tab.<br />
Add an entry with the name of your lib and the path to this lib.</p>
<div id="attachment_208" class="wp-caption alignnone" style="width: 743px"><a href="http://adylitica.com/wp-content/uploads/2010/02/screen3.png"><img class="size-full wp-image-208" title="Add to source tree" src="http://adylitica.com/wp-content/uploads/2010/02/screen3.png" alt="" width="733" height="427" /></a><p class="wp-caption-text">add a source tree</p></div>
<p>Here now this path will be accessible by using $(FBCONNECT).<br />
So now we can go to the main target, and open the build properties (CMD-i). Go to<br />
BE SURE TO CHOOSE &#8220;ALL CONFIGURATION&#8221; in the drop box in the top left corner.<br />
User Header Search Path section and add your recently created variable (For me $(FBCONNECT)). Check the &#8220;recursive&#8221; check box on the left side.</p>
<div id="attachment_210" class="wp-caption alignnone" style="width: 663px"><a href="http://adylitica.com/wp-content/uploads/2010/02/screen4.png"><img class="size-full wp-image-210" title="Add the source tree var" src="http://adylitica.com/wp-content/uploads/2010/02/screen4.png" alt="" width="653" height="596" /></a><p class="wp-caption-text">Add the source tree var</p></div>
<p>If it&#8217;s correct, the path should be resolved.</p>
<p>Step 4: Finished!<br />
Here we are! It&#8217;s ready to build.<br />
It&#8217;s an easy way to always have the last version of the used lib without any extra configuration.<br />
This source tree is an easy way to share some library projects between over projects.</p>
<p>Hope it helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://adylitica.com/2010/02/22/xcode-project-references-avoid-the-headache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to hide an empty section in UITableView</title>
		<link>http://adylitica.com/2010/02/22/how-to-hide-an-empty-section-in-uitableview/</link>
		<comments>http://adylitica.com/2010/02/22/how-to-hide-an-empty-section-in-uitableview/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 03:28:54 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[Mac/iPhone Dev]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://adylitica.com/?p=187</guid>
		<description><![CDATA[UITableViews are pretty powerful and cool controls in that you can create section headers (those grey boxes above the cells) and indexes on the right which let your users jump straight to an appropriate section.
A small problem arises though when you don&#8217;t have enough data to fill all the sections.  Let&#8217;s use an example [...]]]></description>
			<content:encoded><![CDATA[<p>UITableViews are pretty powerful and cool controls in that you can create section headers (those grey boxes above the cells) and indexes on the right which let your users jump straight to an appropriate section.</p>
<p>A small problem arises though when you don&#8217;t have enough data to fill all the sections.  Let&#8217;s use an example where we mimic the Address Book / Contacts functionality on the iPhone.  We would return 27 (26 letters plus one for strange characters) for <code>numberOfSectionsInTableView:</code>, and  we might write some code as follows:</p>
<p><code style='font-size: 90%'>
<pre>
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 27;
}

- (NSInteger)tableView: (UITableView *)tv numberOfRowsInSection: (NSInteger)section
{
    return [[m_users objectAtIndex: section] count];
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    unichar ch = section < 26 ? 'A' + section : '#';
    return [NSString stringWithCharacters: &#038;ch length: 1];
}

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
    NSMutableArray *titles = [NSMutableArray arrayWithCapacity: 27];
    unichar ch;
    UInt32 i;

    for (i = 0; i < 26; i++)
    {
        ch = 'A' + i;
        [titles addObject: [NSString stringWithCharacters: &#038;ch length: 1]];
    }

    ch = '#';
    [titles addObject: [NSString stringWithCharacters: &#038;ch length: 1]];
    return titles;
}
</pre>
<p></code></p>
<p><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal; font-size: 13px;">By default, if you say a section exists, and then simply say there are zero cells in it, you can get an ugly effect by which two (or more) section headers will be stuck together:</span></div>
</pre>
<div id="attachment_188" class="wp-caption alignnone" style="width: 310px"><a href="http://adylitica.com/wp-content/uploads/2010/02/uglysectionheaders.png"><img class="size-medium wp-image-188" title="Ugly Section Headers" src="http://adylitica.com/wp-content/uploads/2010/02/uglysectionheaders-300x191.png" alt="Ugly Section Headers" width="300" height="191" /></a><p class="wp-caption-text">Ugly Section Headers</p></div>
<p>Your first instinct might be to remove entirely those sections with zero users, and carry this across to all your code for the UITableView:</p>
<p><code style='font-size: 90%'>
<pre>
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
  NSUInteger i;
  NSInteger count = 0;

  for (i = 0; i < [m_users count]; i++)
  {
    if ([[m_users objectAtIndex: i] count] > 0) count++;
  }
  return count;
}
</pre>
<p></code><br />
but then you'd find that your index on the right would also be missing a few items as well.</p>
<p>The ultimate solution is quite simple:</p>
<p><em>Indicate that your UITableView has the full number of sections, but beturn @"" as the section title for those sections with no content.</em></p>
<p><code style='font-size: 90%'>
<pre>
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    if ([[m_users objectAtIndex: section] count] == 0) return @"";

    unichar ch = section < 26 ? 'A' + section : '#';
    return [NSString stringWithCharacters: &#038;ch length: 1];
}
</pre>
<p></code></p>
<p>Section headers with @"" as a title will not be shown, but will remain in the index on the right if you <em>do</em> give them a title there.  And that's all there is to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://adylitica.com/2010/02/22/how-to-hide-an-empty-section-in-uitableview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Error launching remote program: security policy error</title>
		<link>http://adylitica.com/2010/02/22/iphone-security-policy-error/</link>
		<comments>http://adylitica.com/2010/02/22/iphone-security-policy-error/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 02:32:45 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://adylitica.com/?p=183</guid>
		<description><![CDATA[If you ever see the error: "Error launching remote program: security policy error", there is a good chance it's because of an expired provisioning profile. Here's how to fix that problem.]]></description>
			<content:encoded><![CDATA[<p>We recently ran into an interesting problem during iPhone app development and testing, when suddenly applications would not run and debug when launching from Xcode.  After some sniffing around, we saw the following message in the Xcode Debugger Console:<br />
<code><br />
Running…<br />
Error launching remote program: security policy error.<br />
Error launching remote program: security policy error.<br />
The program being debugged is not being run.<br />
The program being debugged is not being run.<br />
</code></p>
<p>There are a few things that can cause this error, but in our case it was actually an expired provisioning profile on the device.  </p>
<p>The solution:</p>
<ol>
<li>On the iPhone, go to Settings, General, and then Profiles.</li>
<li>Look through the list and find the expired profile — it will usually have some red text stating it has expired</li>
<li>Zoom in on the certificate and then click on the remove button, and confirm</li>
</ol>
<p>Your apps should be able to run again.</p>
<p>Happy developing.</p>
]]></content:encoded>
			<wfw:commentRss>http://adylitica.com/2010/02/22/iphone-security-policy-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to stop iPhoto from coming up when you plug in your iPhone.</title>
		<link>http://adylitica.com/2010/02/20/stop-iphoto-cmoingiphone/</link>
		<comments>http://adylitica.com/2010/02/20/stop-iphoto-cmoingiphone/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 06:19:52 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[Mac/iPhone Dev]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://adylitica.com/?p=179</guid>
		<description><![CDATA[Here's how to stop iPhoto from launching every time you connect your iPhone to your Mac.]]></description>
			<content:encoded><![CDATA[<p>I use my iPhone across a few different computers, only one of which is my iTunes sync&#8217;ing mac.  On my main development machine, in fact, I never run iTunes (partly out of fear that it will erase all my iTunes app store data).  </p>
<p>The problem with this is that every time I connect my iPhone to that development mac, iPhoto comes up, which is annoying.  It slows things down, and I have to always take that extra step to cancel and close it.</p>
<p>To get around this is easy:</p>
<ol>
<li>Connect your iPhone to your mac </li>
<li>Launch <em>Image Capture</em> from <em>/Applications</em>.</li>
<li>Click on your iPhone in the list of devices</li>
<li>In the bottom left, Select &#8220;No Application&#8221; in the drop-down for &#8220;Connecting this iPhone opens:&#8221;</li>
</ol>
<p>And you&#8217;re done!</p>
<p>Happy iPhone&#8217;ing!</p>
]]></content:encoded>
			<wfw:commentRss>http://adylitica.com/2010/02/20/stop-iphoto-cmoingiphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test if your iPhone app is connected to internet</title>
		<link>http://adylitica.com/2009/12/15/test-if-your-iphone-app-is-connected-to-internet/</link>
		<comments>http://adylitica.com/2009/12/15/test-if-your-iphone-app-is-connected-to-internet/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 08:45:02 +0000</pubDate>
		<dc:creator>Idriss</dc:creator>
				<category><![CDATA[Mac/iPhone Dev]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[internet connection]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[reachability]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://adylitica.com/?p=166</guid>
		<description><![CDATA[Here&#8217;s a simple way to test if your iPhone application is connected using Wifi, 3G or Edge.
First go to the Developer documentation and search for &#8220;Reachability&#8221; (or here: Online Apple Doc: Reachability ): Apple provided this class to simplify the way to monitor the network of an iPhone or iPod Touch.
Open the project and copy [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple way to test if your iPhone application is connected using Wifi, 3G or Edge.</p>
<p>First go to the Developer documentation and search for &#8220;Reachability&#8221; (or here: <a href="http://developer.apple.com/iphone/library/samplecode/Reachability/index.html">Online Apple Doc: Reachability</a> ): Apple provided this class to simplify the way to monitor the network of an iPhone or iPod Touch.</p>
<p>Open the project and copy these files to your project: Reachability.m and Reachability.h.</p>
<p>This class relies on the &#8220;SystemConfiguration&#8221; Framwork, so you need to add it to your project:</p>
<ul>
<li>Control+click on your Framework folder in X-code</li>
<li>Choose Add&gt; Existing Frameworks&#8230;</li>
<li>Search for &#8220;SystemConfiguration.Framework&#8221; and add it</li>
</ul>
<p>Now you can use the Reachability class somewhere in your code like that:</p>
<p><code> </code></p>
<p><code> </code></p>
<p><code></p>
<pre><span style="color: #ff00ff;">if</span>([[<span style="color: #3366ff;">Reachability</span> <span style="color: #008080;">reachabilityForInternetConnection</span>] <span style="color: #008080;">currentReachabilityStatus</span>] == <span style="color: #008080;">NotReachable</span>) {
	<span style="color: #800080;">UIAlertView</span> *error = [[<span style="color: #800080;">UIAlertView</span> <span style="color: #003366;">alloc</span>]
			<span style="color: #003366;">initWithTitle</span>: <span style="color: #ff0000;">@"No Internets??"</span>
			<span style="color: #003366;">message</span>: <span style="color: #ff0000;">@"Check your Wifi settings"</span>
			<span style="color: #003366;">delegate</span>: <span style="color: #ff00ff;">self</span>
			<span style="color: #003366;">cancelButtonTitle</span>: <span style="color: #ff0000;">@"Ok, i'll do it"</span> <span style="color: #003366;">otherButtonTitles</span>: <span style="color: #ff00ff;">nil</span>];
		[error <span style="color: #003366;">show</span>];</pre>
<pre>}</pre>
<p></code></p>
<p>Of Course you can change the test to something else:</p>
<ul>
<li>ReachableViaWWan : means WIFI or 3G</li>
<li>ReachableViaWifi: means only WIFI</li>
<li>NotReachable: no connection at all</li>
</ul>
<p>Simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://adylitica.com/2009/12/15/test-if-your-iphone-app-is-connected-to-internet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Connecting your iphone app to facebook using FBconnect</title>
		<link>http://adylitica.com/2009/11/27/connecting-your-iphone-app-to-facebook-using-fbconnect/</link>
		<comments>http://adylitica.com/2009/11/27/connecting-your-iphone-app-to-facebook-using-fbconnect/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 03:47:31 +0000</pubDate>
		<dc:creator>Idriss</dc:creator>
				<category><![CDATA[Mac/iPhone Dev]]></category>
		<category><![CDATA[Social Networking]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[fbconnect]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[lib]]></category>
		<category><![CDATA[lipo]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://adylitica.com/?p=151</guid>
		<description><![CDATA[
Facebook&#8217;s engineers released an iPhone version of fbconnect few months ago. Now iphone applications are able to use the Facebook api to retrieve friends of the user, post things on the wall, etc…
We&#8217;ll see through this tutorial how to change the user status from an iphone application.

Adding facebook functionality to your native iPhone applications is [...]]]></description>
			<content:encoded><![CDATA[<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">Facebook&#8217;s engineers released an iPhone version of fbconnect few months ago. Now iphone applications are able to use the Facebook api to retrieve friends of the user, post things on the wall, etc…</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">We&#8217;ll see through this tutorial how to change the user status from an iphone application.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">Adding facebook functionality to your native iPhone applications is surprisingly easy.  In this article, we&#8217;ll walk you through the process of adding the facebook libraries and incorporating them into your application.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><strong>1 prerequisites:</strong></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>-A facebook developer account and a new empty app (To have an API key and an application secret for api calls). To create a new one, read this Facebook getting started : http://developers.facebook.com/get_started.php</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>-Download the FBConnect for iphone : http://github.com/facebook/facebook-iphone-sdk/</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><strong>2 compile as a lib</strong></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>1. The FBConnect project you downloaded is configured to create the fbconnect library. There are only a few things to do to be able to build it: change the SDK you&#8217;re compiling against and the configuration. You may want to set it to your iPhone version ( for example 3.1 ) and change the configuration to debug (Upper left combo list).</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">
<div id="attachment_159" class="wp-caption alignnone" style="width: 802px"><img class="size-full wp-image-159" title="Build/Target platform options" src="http://adylitica.com/wp-content/uploads/2009/11/Screen-shot-2009-11-27-at-11.32.59-AM.png" alt="Build/Target platform options combo list" width="792" height="561" /><p class="wp-caption-text">Build/Target platform options combo list</p></div>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">Now, control click on the target, and choose build &#8220;FBPlatform&#8221;;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>But you&#8217;ll need to build one library for the simulator and one for the device. So each time you&#8217;ll need to change the lib depending if you&#8217;re testing on your device or on the simulator. To avoid that, we&#8217;ll pack all the libraries inside one using &#8220;lipo&#8221;.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>First build the lib for the simulator in debug config, and then build for the device (iPhone OS) in debug mode as well.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>In the Terminal, go to your project directory :</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>$ cd your/project</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>then go to the build directory, in our case src/build/</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>$ cd src/build</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>you will have 2 directories: Debug-iphonesimulator and Debug-iphoneos</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>each contains the compiled lib.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>$ ls Debug-iphonesimulator</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>libFBPlatform.a</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>we&#8217;ll use &#8220;lipo&#8221; (man lipo) to pack the two libs in one:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>$ lipo -create Debug-iphonesimulator/libFBPlatform.a Debug-iphoneos/libFBPlatform.a -output libFBPlatform-debug.a</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>This will create a lib with the two version of the FBPlatform so you&#8217;ll never need to change each time you switch from the simulator to the device.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Create a &#8220;lib&#8221; directory in the fbconnect-iphone directory<span style="white-space: pre;"> </span>and move the just-created lib into it.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>$ mkdir ../../lib</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>$ mv libFBPlatform-debug.a ../../lib</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>you may want to repeat the process with the release version of the lib&#8230;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><strong>3 Create your project</strong></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Create a new project (cmd + shift + n), choose View-based application.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>1 Basic connection code</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>a) connect to Facebook:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>FBConnect uses it&#8217;s own controls to connect to the Facebook platform: you must use the API to create a &#8220;FaceBook Connect Button&#8221;. When the user will click on the button, a Dialog Window will appear.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>To connect to facebook, in the view controller:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>0 </span>- (<span style="color: #d200a5;">void</span>)viewDidLoad {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #480085;"><span style="font: 12.0px Helvetica; color: #000000;"><span style="white-space: pre;"> </span>1 <span style="white-space: pre;"> </span></span><span style="color: #368288;">session</span><span style="color: #000000;"> = [</span><span style="color: #7e11ad;">FBSession</span><span style="color: #000000;"> </span>sessionForApplication<span style="color: #000000;">:</span><span style="color: #e90000;">API_KEY</span><span style="color: #000000;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>2 <span style="white-space: pre;"> </span><span style="color: #480085;">secret</span>:<span style="color: #e90000;">APP_SECRET</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>3 <span style="white-space: pre;"> </span> <span style="color: #480085;">delegate</span>:<span style="color: #d200a5;">self</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #7e11ad;"><span style="color: #000000;"><span style="white-space: pre;"> </span>4 <span style="white-space: pre;"> </span></span>FBLoginButton<span style="color: #000000;">* button = [[</span>FBLoginButton<span style="color: #000000;"> </span><span style="color: #480085;">alloc</span><span style="color: #000000;">] </span><span style="color: #480085;">init</span><span style="color: #000000;">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>5 <span style="white-space: pre;"> </span>[<span style="color: #d200a5;">self</span>.<span style="color: #7e11ad;">view</span> <span style="color: #480085;">addSubview</span>:button];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>6 <span style="white-space: pre;"> </span>[button <span style="color: #480085;">release</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>6 };</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>&lt;API KEY&gt; is the &#8220;api key&#8221; you&#8217;ll find in you Facebook application settings.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>&lt;APP_SECRET&gt; is the &#8220;application secret&#8221;. <span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>This will create a facebook button in the view: the user will be able to connect to Facebook by clicking on it. A dialog will appear.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Once logged in, the FBConnect module will call the function: <span style="font: 11.0px Menlo;">- (</span><span style="font: 11.0px Menlo; color: #d200a5;">void</span><span style="font: 11.0px Menlo;">)session:(</span><span style="font: 11.0px Menlo; color: #7e11ad;">FBSession</span><span style="font: 11.0px Menlo;">*)</span><span style="font: 11.0px Menlo; color: #368288;">session</span><span style="font: 11.0px Menlo;"> didLogin:(</span><span style="font: 11.0px Menlo; color: #7e11ad;">FBUID</span><span style="font: 11.0px Menlo;">)id;</span><span style="white-space: pre;"> </span>This function is defined in the protocol &lt;<span style="font: 11.0px Menlo;">FBSessionDelegate</span>&gt; . So if you look at line 3 of our code, we set the delegate of this call to self. So this class should implement the &lt;FBSessionDelegate&gt; protocol by adding this &#8220;session: didLogin:&#8221; function. This function will contain the code to execute once the user is connected.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">For now we can just put a log in this function:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="font: 12.0px Helvetica;"><span style="white-space: pre;"> </span></span>- (<span style="color: #d200a5;">void</span>)session:(<span style="color: #7e11ad;">FBSession</span>*)<span style="color: #368288;">session</span> didLogin:(<span style="color: #7e11ad;">FBUID</span>)uid {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #480085;">NSLog</span><span style="color: #000000;">(</span>@&#8221;User %lld connected&#8221;<span style="color: #000000;">, uid);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>}<span style="font: 12.0px Helvetica;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">don&#8217;t forget to add that the class implements the &lt;FBSessionDelegate&gt; protocol in the interface:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="font: 12.0px Helvetica; color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #824725;">#import </span>&lt;UIKit/UIKit.h&gt;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #824725;"><span style="white-space: pre;"> </span>#import </span>&#8220;FBConnect/FBConnect.h&#8221;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #824725; min-height: 13.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="color: #d200a5;"><span style="white-space: pre;"> </span>@interface</span> FBConnectExampleViewController : UIViewController &lt;FBSessionDelegate&gt; {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #7e11ad;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span>FBSession<span style="color: #000000;"> *</span><span style="color: #368288;">session</span><span style="color: #000000;">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d200a5;"><span style="white-space: pre;"> </span>@end</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>To be able to compile we must add some more informations:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>-include the libFBPlatform.a</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Project&gt;add to project (option meta a) , and then go to the fbconnect-iphone/lib directory. Choose the libFBPlatform-debug.a and click on add.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Move the added lib to the framework group or create a lib group.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>-specify the headers path</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>on the sidebar, control click on the project root (you project name) and choose get info (meta i). Go in the &#8220;build&#8221; tab and search for &#8220;header&#8221;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>in the &#8220;User header search path&#8221; add the path to the fbconnect-iphone directory which contains the FBConnect directory; usually ../fbconnect-iphone/src/</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<div id="attachment_157" class="wp-caption alignnone" style="width: 817px"><img class="size-full wp-image-157" title="Build options" src="http://adylitica.com/wp-content/uploads/2009/11/Screen-shot-2009-11-27-at-11.28.44-AM.png" alt="Header path" width="807" height="732" /><p class="wp-caption-text">Header path</p></div>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"><br />
</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>-add the FBConnect.bundle to the resources</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>the libFBPlatorm lib uses some resources (specially for the button), so you need to add the bundle into your project. Project&gt;add to project (option meta a), go to the fbconnect-iphone/src and add the FBConnect.bundle file. Move it to your Resources group.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>now build and run (command r)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>you should see a button in the upper left corner. if you click on it, a dialog will appear requesting your username/email and password. if you correctly fill the form and click on connect, the debug console should write something like:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="font: 12.0px Helvetica;"><span style="white-space: pre;"> </span></span>[Session started at 2009-11-05 11:53:24 +0800.]</p>
<p style="margin: 0.0px 0.0px 0.0px 28.0px; text-indent: -28.0px; font: 11.0px Menlo;"><strong><span style="white-space: pre;"> </span> 2009-11-05 11:54:00.400 FBConnectExample[3463:207] User &lt;USERID&gt; connected</strong></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>If you see that, it&#8217;s all good!</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span><strong>3bis Troubleshooting</strong></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>i runs, but I don&#8217;t see the button:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>-are you sure you imported the FBConnect.bundle?</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>-have you added the button to the view?</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>…</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><strong>4 Calling an API Function</strong></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>1 retrieve the status</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>We&#8217;ll not use an API call to retrieve the status of the user.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>FBConnect platform API call uses, like the connection, delegates to receive the response from the Facebook Platform: When you call an api you must reference a delegate which will handle the response.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Let&#8217;s create a function retrieve the userStatus:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>0 </span>- (<span style="color: #d200a5;">void</span>)getStatus {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #480085;"><span style="color: #000000;"><span style="white-space: pre;"> </span>1<span style="white-space: pre;"> </span></span><span style="color: #7e11ad;">NSDictionary</span><span style="color: #000000;"> *params = [</span><span style="color: #7e11ad;">NSDictionary</span><span style="color: #000000;"> </span>dictionaryWithObjectsAndKeys<span style="color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>2<span style="white-space: pre;"> </span><span style="color: #e90000;">@"1"</span>, <span style="color: #e90000;">@"limit"</span>,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>3<span style="white-space: pre;"> </span><span style="color: #d200a5;">nil</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #480085;"><span style="color: #000000;"><span style="white-space: pre;"> </span>4<span style="white-space: pre;"> </span>[[</span><span style="color: #7e11ad;">FBRequest</span><span style="color: #000000;"> </span>requestWithDelegate<span style="color: #000000;">:</span><span style="color: #368288;">statusUpdateDelegate</span><span style="color: #000000;">] </span>call<span style="color: #000000;">:</span><span style="color: #e90000;">@&#8221;facebook.Status.get&#8221;</span><span style="color: #000000;"> </span>params<span style="color: #000000;">:params];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>5 }</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>The parameters of the API call must be in a dictionary. Here we just specify the amount of statuses we want to retrieve.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>on line 4, like the connection, we set the delegate for the request. Like previously, we can set the view controller be this Delegate (have to implement the FBRequestDelegate protocol), but if you have several api calls, the same response function will be called…</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>An elegant solution is to create one delegate object for each api call.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Let&#8217;s then create the StatusUpdateDelegate (command n, new objective c class). This class must implement the FBRequestDelegate protocol:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="font: 12.0px Helvetica; color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #824725;">#import </span>&lt;Foundation/Foundation.h&gt;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #824725;"><span style="white-space: pre;"> </span>#import </span>&#8220;FBConnect/FBConnect.h&#8221;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="color: #d200a5;"><span style="white-space: pre;"> </span>@interface</span> StatusUpdateDelegate : NSObject &lt;FBRequestDelegate&gt; {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #7e11ad;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span>NSString<span style="color: #000000;"> *</span><span style="color: #368288;">message</span><span style="color: #000000;">;<span style="white-space: pre;"> </span></span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>The 2 main functions that we are interested in are:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>- (<span style="color: #d200a5;">void</span>)request:(<span style="color: #7e11ad;">FBRequest</span>*)request didLoad:(<span style="color: #d200a5;">id</span>)result;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #7e11ad;"><span style="white-space: pre;"> </span></span>- (<span style="color: #d200a5;">void</span>)request:(<span style="color: #7e11ad;">FBRequest</span>*)request didFailWithError:(<span style="color: #7e11ad;">NSError</span>*)error;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>The &#8220;didLoad&#8221; function is call when the results are ready to be processed.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>For now we just want to Log the status:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>0 </span>- (<span style="color: #d200a5;">void</span>)request:(<span style="color: #7e11ad;">FBRequest</span>*)request didLoad:(<span style="color: #d200a5;">id</span>)result {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>1     <span style="white-space: pre;"> </span><span style="color: #7e11ad;">NSArray</span>* statuses = result;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>2<span style="white-space: pre;"> </span><span style="color: #7e11ad;">NSDictionary</span>* status = [statuses <span style="color: #480085;">objectAtIndex</span>:<span style="color: #3900de;">0</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>3<span style="white-space: pre;"> </span><span style="color: #368288;">message</span> = [status <span style="color: #480085;">objectForKey</span>:<span style="color: #e90000;">@"message"</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #000000;"><span style="white-space: pre;"> </span>4<span style="white-space: pre;"> </span></span><span style="color: #480085;">NSLog</span><span style="color: #000000;">(</span>@&#8221;status : %@&#8221;<span style="color: #000000;">, </span><span style="color: #368288;">message</span><span style="color: #000000;">);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>5 }</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>The result comes in an array containing dictionaries. For more informations try to log directly the array.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Now instanciate this class in our view controller:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>in the viewDidLoad method:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #368288;"><span style="font: 12.0px Helvetica; color: #000000;"><span style="white-space: pre;"> </span></span>statusUpdateDelegate<span style="color: #000000;"> = [[</span>StatusUpdateDelegate<span style="color: #000000;"> </span><span style="color: #480085;">alloc</span><span style="color: #000000;">] </span><span style="color: #480085;">init</span><span style="color: #000000;">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Where statusUpdateDelegate is a member field of the view controller.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Now let&#8217;s call the status request function and we&#8217;ll be fine:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>in the view controller:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="font: 12.0px Helvetica;"><span style="white-space: pre;"> </span></span>- (<span style="color: #d200a5;">void</span>)session:(<span style="color: #7e11ad;">FBSession</span>*)<span style="color: #368288;">session</span> didLogin:(<span style="color: #7e11ad;">FBUID</span>)uid {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #480085;">NSLog</span><span style="color: #000000;">(</span>@&#8221;User %lld connected&#8221;<span style="color: #000000;">, uid);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #1b5a5e;"><span style="color: #000000;"><span style="white-space: pre;"> </span>[</span><span style="color: #d200a5;">self</span><span style="color: #000000;"> </span>getStatus<span style="color: #000000;">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>TO recap we have the following code:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>ViewController.m:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">- (<span style="color: #d200a5;">void</span>)viewDidLoad {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #480085;"><span style="color: #000000;"> [</span><span style="color: #d200a5;">super</span><span style="color: #000000;"> </span>viewDidLoad<span style="color: #000000;">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #480085;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #368288;">session</span><span style="color: #000000;"> = [</span><span style="color: #7e11ad;">FBSession</span><span style="color: #000000;"> </span>sessionForApplication<span style="color: #000000;">:</span><span style="color: #e90000;">API_KEY</span><span style="color: #000000;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #480085;">secret</span>:<span style="color: #e90000;">APP_SECRET</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span> <span style="color: #480085;">delegate</span>:<span style="color: #d200a5;">self</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #7e11ad;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span>FBLoginButton<span style="color: #000000;">* button = [[</span>FBLoginButton<span style="color: #000000;"> </span><span style="color: #480085;">alloc</span><span style="color: #000000;">] </span><span style="color: #480085;">init</span><span style="color: #000000;">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>[<span style="color: #d200a5;">self</span>.<span style="color: #7e11ad;">view</span> <span style="color: #480085;">addSubview</span>:button];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>[button <span style="color: #480085;">release</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #368288;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span>statusUpdateDelegate<span style="color: #000000;"> = [[</span>StatusUpdateDelegate<span style="color: #000000;"> </span><span style="color: #480085;">alloc</span><span style="color: #000000;">] </span><span style="color: #480085;">init</span><span style="color: #000000;">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">- (<span style="color: #d200a5;">void</span>)viewDidUnload {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #368288;"><span style="color: #000000;"><span style="white-space: pre;"> </span>[</span>statusUpdateDelegate<span style="color: #000000;"> </span><span style="color: #480085;">dealloc</span><span style="color: #000000;">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">- (<span style="color: #d200a5;">void</span>)session:(<span style="color: #7e11ad;">FBSession</span>*)<span style="color: #368288;">session</span> didLogin:(<span style="color: #7e11ad;">FBUID</span>)uid {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #480085;">NSLog</span><span style="color: #000000;">(</span>@&#8221;User %lld connected&#8221;<span style="color: #000000;">, uid);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #1b5a5e;"><span style="color: #000000;"><span style="white-space: pre;"> </span>[</span><span style="color: #d200a5;">self</span><span style="color: #000000;"> </span>getStatus<span style="color: #000000;">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">- (<span style="color: #d200a5;">void</span>)getStatus {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #480085;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #7e11ad;">NSDictionary</span><span style="color: #000000;"> *params = [</span><span style="color: #7e11ad;">NSDictionary</span><span style="color: #000000;"> </span>dictionaryWithObjectsAndKeys<span style="color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span>@"1"<span style="color: #000000;">, </span>@"limit"<span style="color: #000000;">,</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #d200a5;">nil</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #480085;"><span style="color: #000000;"><span style="white-space: pre;"> </span>[[</span><span style="color: #7e11ad;">FBRequest</span><span style="color: #000000;"> </span>requestWithDelegate<span style="color: #000000;">:</span><span style="color: #368288;">statusUpdateDelegate</span><span style="color: #000000;">] </span>call<span style="color: #000000;">:</span><span style="color: #e90000;">@&#8221;facebook.Status.get&#8221;</span><span style="color: #000000;"> </span>params<span style="color: #000000;">:params];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">- (<span style="color: #d200a5;">void</span>)dealloc {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #480085;"><span style="color: #000000;"><span style="white-space: pre;"> </span>[</span><span style="color: #368288;">session</span><span style="color: #000000;">.</span><span style="color: #7e11ad;">delegates</span><span style="color: #000000;"> </span>removeObject<span style="color: #000000;">:</span><span style="color: #d200a5;">self</span><span style="color: #000000;">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">[<span style="color: #d200a5;">super</span> <span style="color: #480085;">dealloc</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>StatusUpdateDelegate.m:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">- (<span style="color: #d200a5;">void</span>)request:(<span style="color: #7e11ad;">FBRequest</span>*)request didLoad:(<span style="color: #d200a5;">id</span>)result {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #7e11ad;">NSArray</span>* statuses = result;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #7e11ad;">NSDictionary</span>* status = [statuses <span style="color: #480085;">objectAtIndex</span>:<span style="color: #3900de;">0</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #368288;">message</span> = [status <span style="color: #480085;">objectForKey</span>:<span style="color: #e90000;">@"message"</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #480085;">NSLog</span><span style="color: #000000;">(</span>@&#8221;status : %@&#8221;<span style="color: #000000;">, </span><span style="color: #368288;">message</span><span style="color: #000000;">);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">- (<span style="color: #d200a5;">void</span>)request:(<span style="color: #7e11ad;">FBRequest</span>*)request didFailWithError:(<span style="color: #7e11ad;">NSError</span>*)error {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #480085;">NSLog</span><span style="color: #000000;">(</span>@&#8221;ERROR on status update: %@&#8221;<span style="color: #000000;">, error);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Build and run (command r), connect, and after a while the status message should appear in the debug console.<span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><strong>5 Post a new status</strong></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>now we&#8217;ll post the new user status.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>But to do that, we need extended rights…</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>To obtains those rights, the user must allow it via a Facebook platform dialog.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>To simplify the process, we&#8217;ll display the dialog when the user successfully logged in; so in the view controller, function <span style="font: 11.0px Menlo;">session:didlogin </span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>0 &#8211; (<span style="color: #d200a5;">void</span>)session:(<span style="color: #7e11ad;">FBSession</span>*)<span style="color: #368288;">session</span> didLogin:(<span style="color: #7e11ad;">FBUID</span>)uid {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #000000;"><span style="white-space: pre;"> </span>1<span style="white-space: pre;"> </span></span><span style="color: #480085;">NSLog</span><span style="color: #000000;">(</span>@&#8221;User %lld connected&#8221;<span style="color: #000000;">, uid);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #7e11ad;"><span style="color: #000000;"><span style="white-space: pre;"> </span>2<span style="white-space: pre;"> </span></span>FBPermissionDialog<span style="color: #000000;">* dialog = [[</span>FBPermissionDialog<span style="color: #000000;"> </span><span style="color: #480085;">alloc</span><span style="color: #000000;">] </span><span style="color: #480085;">init</span><span style="color: #000000;">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>3<span style="white-space: pre;"> </span>dialog.<span style="color: #7e11ad;">delegate</span> = <span style="color: #d200a5;">self</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #000000;"><span style="white-space: pre;"> </span>4<span style="white-space: pre;"> </span>dialog.</span><span style="color: #7e11ad;">permission</span><span style="color: #000000;"> = </span>@&#8221;status_update&#8221;<span style="color: #000000;">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>5<span style="white-space: pre;"> </span>[dialog <span style="color: #480085;">show</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>6<span style="white-space: pre;"> </span>[dialog <span style="color: #480085;">release</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #1b5a5e;"><span style="color: #000000;"><span style="white-space: pre;"> </span>7<span style="white-space: pre;"> </span>[</span><span style="color: #d200a5;">self</span><span style="color: #000000;"> </span>getStatus<span style="color: #000000;">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>8 }<span style="font: 12.0px Helvetica;"><span style="white-space: pre;"> </span></span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>The code to add is between line 2 and 6.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>The permission dialog works like the session and api call: it needs a delegate. To keep it simple we&#8217;ll say that the delegate is the view controller (this class must now implement the FBDialogDelegate), and we&#8217;ll add the function &#8220;<span style="font: 11.0px Menlo;">dialogDidSucceed&#8221;:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>- (<span style="color: #d200a5;">void</span>)dialogDidSucceed:(<span style="color: #7e11ad;">FBDialog</span>*)dialog {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #480085;">NSLog</span><span style="color: #000000;">(</span>@&#8221;Extended rights approved&#8221;<span style="color: #000000;">);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="font: 11.0px Menlo;"><span style="white-space: pre;"> </span></span>Note that we ask for specific rights on line 4; each different actions needs different rights (The API documentation explains this).</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Now that we have extended rights on the status update, we can post a new status by using an API call:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="font: 12.0px Helvetica;"><span style="white-space: pre;"> </span></span>-(<span style="color: #d200a5;">void</span>)setStatus:(<span style="color: #7e11ad;">NSString</span> *)<span style="color: #368288;">status</span> {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #7e11ad;">NSString</span> *statusString = <span style="color: #368288;">status</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #480085;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #7e11ad;">NSDictionary</span><span style="color: #000000;"> *params = [</span><span style="color: #7e11ad;">NSDictionary</span><span style="color: #000000;"> </span>dictionaryWithObjectsAndKeys<span style="color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span>statusString, <span style="color: #e90000;">@"status"</span>,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #e90000;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span>@"true"<span style="color: #000000;">, </span>@"status_includes_verb"<span style="color: #000000;">,</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #d200a5;">nil</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #480085;"><span style="color: #000000;"><span style="white-space: pre;"> </span>[[</span><span style="color: #7e11ad;">FBRequest</span><span style="color: #000000;"> </span>requestWithDelegate<span style="color: #000000;">:</span><span style="color: #d200a5;">setStatusDelegate</span><span style="color: #000000;">] </span>call<span style="color: #000000;">:</span><span style="color: #e90000;">@&#8221;facebook.Users.setStatus&#8221;</span><span style="color: #000000;"> </span>params<span style="color: #000000;">:params];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>No fancy stuff here, same as before: setStatusDelegate is a delegate class which implements FBRequestDelegate protocol.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><strong>6 Comments</strong></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Facebook Connect for iphone is simple to use: you can add very quickly a social aspect to your application. Now it&#8217;s up to you to imagine an awesome application.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="white-space: pre;"> </span>Here&#8217;s a small project using what we saw here: <a href="http://adylitica.com/wp-content/uploads/2009/11/Facebook-Example1.zip">Facebook Example</a></p>
<div><span style="font-family: Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: small;"><span style="line-height: normal;"></p>
<div id="attachment_156" class="wp-caption alignnone" style="width: 780px"><img class="size-full wp-image-156" title="Example project" src="http://adylitica.com/wp-content/uploads/2009/11/Screen-shot-2009-11-27-at-11.26.52-AM.png" alt="The example project screenshot" width="770" height="414" /><p class="wp-caption-text">The example project screenshot</p></div>
<p></span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://adylitica.com/2009/11/27/connecting-your-iphone-app-to-facebook-using-fbconnect/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Installing AMP (Apache, MySQL, PHP) on Mac OS X 10.6 Snow Leopard</title>
		<link>http://adylitica.com/2009/11/24/installing-amp-apache-mysql-php-on-mac-os-x-10-6-snow-leopard/</link>
		<comments>http://adylitica.com/2009/11/24/installing-amp-apache-mysql-php-on-mac-os-x-10-6-snow-leopard/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 06:32:56 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[Web / Javascript Dev]]></category>

		<guid isPermaLink="false">http://adylitica.com/?p=133</guid>
		<description><![CDATA[
The following article details exactly how I installed the AMP (Apache, MySQL, and PHP) stack on my pretty fresh Mac OS X 10.6 Snow Leopard computer.  In it, I use pretty standard MySQL 5.1.41, Apache 2.2.14, and PHP 5.3.1.  I&#8217;ve added a tonne of extensions to PHP so that I have all the [...]]]></description>
			<content:encoded><![CDATA[<div id='tutorial'>
The following article details exactly how I installed the AMP (Apache, MySQL, and PHP) stack on my pretty fresh Mac OS X 10.6 Snow Leopard computer.  In it, I use pretty standard MySQL 5.1.41, Apache 2.2.14, and PHP 5.3.1.  I&#8217;ve added a tonne of extensions to PHP so that I have all the functionality I want for our applications.</p>
<h2> Prerequisites </h2>
<p>You&#8217;ll need:</p>
<ul>
<li>Mac OS X 10.6 (I&#8217;m using 10.6.2 right now) </li>
<li> Xcode 3.2.1 (It&#8217;s under &#8220;Optional Installs&#8221; on your Snow Leopard DVD) </li>
<li> The Terminal.app Program (go to Applications / Utilities) — If you&#8217;re completely new to Terminal and bash, please Google &#8220;mac terminal bash tutorial&#8221; and read one or more of the articles there quickly. </li>
</ul>
<p>In this tutorial, we&#8217;re going to be operating out of ~/work (the &#8220;work&#8221; subdirectory of your Home folder).  Whenever we say &#8220;download x.y.z.tar.gz&#8221;, we assume you download it and put it in that folder. If you&#8217;re downloading using your favourite web browser, it usually places them in ~/Downloads.  So, to move &#8220;x.y.z.tar.gz&#8221; to ~/work, you can usually just type:</p>
<p><code>
<pre>
$ mv ~/Downloads/x.y.z.tar.gz ~/work
</pre>
<p></code></p>
<h2> Let&#8217;s get Going </h2>
<p>Prepare a cup of coffee or three, and put a DVD on, because you&#8217;re going to be watching your computer compile software a lot.</p>
<h3> Before you start </h3>
<p>Start Terminal.app and type:</p>
<p><code>
<pre>
$ mkdir work
$ cd work
</pre>
<p></code></p>
<h3> MySQL 5.1 </h3>
<p>I went to <a href='http://dev.mysql.com/downloads/mysql/5.1.html'> dev.mysql.com/downloads </a> and Downloaded mysql-5.1.41-osx10.5-x86_64.dmg for &#8220;Mac  OS X (package format) 10.5 (x86_64)&#8221;.</p>
<p>After the <em>.dmg</em> has finished downloading, just mount and run the installer.</p>
<h4> memcache </h4>
<p>Download (and put in ~/work):</p>
<ul>
<li><em> libmemcached-0.35.tar.gz </em> from<a href="http://tangent.org/552/libmemcached.html"> http://tangent.org/552/libmemcached.html</a> </li>
<li> <em> libevent-1.4.13-stable.tar.gz </em> from <a href='http://www.monkey.org/~provos/libevent/ '> http://www.monkey.org/~provos/libevent/ </a></li>
<li> memcached-1.4.3.tar.gz </em> from <a href='http://memcached.org'> http://memcached.org<br />
 </a></li>
</ul>
<p>These are all trivial to compile and install:</p>
<p><code>
<pre>
$ tar xfz libevent-1.4.13-stable.tar.gz
$ cd libevent-1.4.13-stable
$ ./configure &#038;&#038; make &#038;&#038; sudo make install

$ cd ..
$ tar xfz memcached-1.4.3tar.gz
$ cd memcached-1.4.3
$ ./configure &#038;&#038; make &#038;&#038; sudo make install

$ cd ..
$ tar xfz libmemcached-0.35.tar.gz
$ cd libmemcached-0.35
$ ./configure &#038;&#038; make &#038;&#038; sudo make install
</pre>
<p></code></p>
<h3> OpenSSL </h3>
<p>Although Mac OS X comes with a pretty comprehensive version of OpenSSL, I always like to compile the latest into my AMP libraries.</p>
<p>Download <em> openssl-0.9.8l.tar.gz</em> from <a href='http://openssl.org'>openssl.org</a></p>
<p><code>
<pre>
$ tar xfz openssl-0.9.8l.tar.gz
$ cd openssl-0.9.8l
$ ./config &#038;&#038; make &#038;&#038; make test &#038;&#038; sudo make install
</pre>
<p></code></p>
<h3> CURL </h3>
<p>Download <em> curl-7.19.7.tar.gz </em> from <a href='http://curl.haxx.se'>curl.haxx.se</a></p>
<p><code>
<pre>
$ tar xfz curl-7.19.7.tar.gz
$ cd curl-7.19.7
$ ./configure --with-ssl=/usr/local/ssl --enable-thread
$ make &#038;&#038; sudo make install
</pre>
<p></code></p>
<h3> ImageMagick (and other graphics libs) </h3>
<p>Download:</p>
<ul>
<li> <em> freetype-2.3.11.tar.bz2 </em> from <a href='http://freetype.org'>freetype.org</a></li>
<li><em> jpegsrc.v7.tar.gz </em> from <a href='http://ijg.org'>ijg.org</a></li>
<li> <em> libpng-1.2.40-no-config.tar.gz </em> from <a href='http://www.libpng.org/pub/png/libpng.html'>libpng.org</a></li>
<li> <em> tiff-3.8.2.tar.gz </em> from <a href='http://libtiff.org'> libtiff.org </a> </li>
<li> <em> ImageMagick-6.5.7-9.tar.bz2 </em> from <a href='http://imagemagick.org'>imagemagick.org </a> </li>
</ul>
<p>And here we goooooo:</p>
<p><code>
<pre>
$ tar xfj freetype-2.3.11.tar.bz2
$ cd freetype-2.3.11
$ ./configure &#038;&#038; make &#038;&#038; sudo make install

$ cd ..
$ tar xfz libpng-1.2.40-no-config.tar.gz
$ cd libpng-1.2.40-no-config
$ cp scripts/makefile.darwin Makefile
$ make &#038;&#038; sudo make install

$ cd ..
$ tar xfz jpegsrc.v6b.tar.gz
$ cd jpeg-6b
$ ./configure &#038;&#038; make &#038;&#038; sudo make install

$ cd ..
$ tar xfz tiff-3.8.2.tar.gz
$ cd tiff-3.8.2
$ ./configure &#038;&#038; make &#038;&#038; sudo make install

$ cd ..
$ tar xfj ImageMagick-6.5.7-9.tar.bz2
$ cd ImageMagick-6.5.7-9
$ ./configure &#038;&#038; make &#038;&#038; sudo make install
</pre>
<p></code></p>
<h3> LibSSH2 (for communicating with SSH servers in code) </h3>
<p>Download <em> libssh2-1.2.2.tar.gz </em> from <a href='http://libssh2.org'>libssh2.org</a>.</p>
<p><code>
<pre>
$ tar xfz libssh2-1.2.2.tar.gz
$ cd libssh2-.1.2.2
$ ./configure &#038;&#038; make &#038;&#038; sudo make install
</pre>
<p></code></p>
<h3> Apache Project HTTPD </h3>
<p>Download <em> httpd-2.2.14.tar.bz2 </em> from <a href='http://httpd.apache.org'>httpd.apache.org</a></p>
<p><code>
<pre>
$ tar xfj httpd-2.2.14.tar.bz2
$ cd httpd-2.2.14
$ ./configure --enable-rewrite --enable-so --enable-deflate
$ make &#038;&#038; sudo make install
</pre>
<p></code></p>
<h3> PHP and appropriate PECL extensions </h3>
<p>We&#8217;re going to build PHP with the following extensions in it:</p>
<ul>
<li> mysqli</li>
<li> mysql</li>
<li> imagick (from PECL)</li>
<li> APC (code caching, from PECL)</li>
<li> SOAP</li>
<li> memcache </li>
<li> memcached (newer and cooler) </li>
<li> OpenSSL</li>
<li> multi-byte string and character support </li>
<li> CURL</li>
<li> SSH2</li>
</ul>
<p>You&#8217;ll need to go to <a href='http://pecl.php.net'>pecl.php.net</a> and download:</p>
<ul>
<li><em> APC-3.1.3p1.tgz </em></li>
<li><em>imagick-2.3.0.tgz</em></li>
<li><em>memcache-2.2.5.tgz</em></li>
<li><em>memcached-1.0.0.tgz</em></li>
<li><em>ssh2-0.11.0.tgz</em></li>
</ul>
<p>Now, download PHP 5.3.1. from <a href='http://php.net'>php.net </a></p>
<p>Get ready to patch your PHP to handle some changes in Snow Leopard:</p>
<p>Copy the following into a file called &#8220;patch&#8221; — <em> Remember where you put this </em> (i.e. ~/work/patch):</p>
<p><code>
<pre style='background-color: #eee'>
--- php-5.3.0/ext/iconv/iconv.c 2009-03-16 22:31:04.000000000 -0700
+++ php/ext/iconv/iconv.c   2009-07-15 14:40:09.000000000 -0700
@@ -51,9 +51,6 @@
 #include <gnu/libc-version.h>
 #endif

-#ifdef HAVE_LIBICONV
-#undef iconv
-#endif

 #include "ext/standard/php_smart_str.h"
 #include "ext/standard/base64.h"
@@ -182,9 +179,6 @@
 }
 /* }}} */

-#ifdef HAVE_LIBICONV
-#define iconv libiconv
-#endif

 /* {{{ typedef enum php_iconv_enc_scheme_t */
 typedef enum _php_iconv_enc_scheme_t {
</pre>
<p></code></p>
<p>The next thing we have to do is add the PECL extensions into PHP:</p>
<p><code>
<pre>
$ tar xfj php-5.3.1.tar.bz2
$ cd php-5.3.1/ext/iconv

# if it asks you what file to patch, just say "iconv.c"
$ patch -p1 < ~/work/patch # or whatever path you used for the patch file

$ cd ..
$ tar xfz ../../APC-3.1.3p1.tgz
$ mv APC-3.1.3p1 apc
$ tar xfz ../../imagick-2.3.0.tgz
$ mv imagick-2.3.0 imagick
$ tar xfz ../../memcache-2.2.5.tgz
$ mv memcache-2.2.5 memcache
$ tar xfz ../../memcached-1.0.0.tgz
$ mv memcached-1.0.0 memcached
$ tar xfz ../../ssh2-0.11.0.tgz
$ mv ssh2-0.11.0 ssh2
$ cd ..
$ rm configure
$ ./buildconf --force    #(it's okay to ignore the warnings here)
$ ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs \
 --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-imagick \
 --enable-apc --enable-soap --enable-memcache --with-zlib \
 --with-openssl=/usr --enable-mbstring --enable-mbregex --with-curl \
 --enable-memcached --enable-ssh2
$ make &#038;&#038; sudo make install
</pre>
<p></code></p>
<p>Once PHP is done compiling and installing, you want to edit <em>/usr/local/apache/conf/httpd.conf</em> and make sure that you add the line</p>
<p><code>
<pre>
AddType application/x-httpd-php .php .phtml
</pre>
<p></code></p>
<p>to the section <code><IfModule mime_module></code> ...  Also make sure that the line</p>
<p><code>
<pre>
LoadModule php5_module        modules/libphp5.so
</pre>
<p></code></p>
<p>exists in the file too.</p>
<h3> Starting things up </h3>
<p>To start MySQL:</p>
<p><code>
<pre>
$ sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &#038;
</pre>
<p></code></p>
<p>To Start Apache2</p>
<p><code>
<pre>
$ sudo /usr/local/apache2/bin/apachectl start
</pre>
<p></code></p>
<p>And that should be it!  Configure your <em>httpd.conf</em> and <em>extras/httpd-vhost.conf</em> files to reflect your development environment, and run with it!  By default, your <em>httpd</em> document root is <em>/usr/local/apache2/htdocs</em>, but I almost always create various virtual hosts in <em>~/src/xyz</em>.  </p>
<h2> Clean Up </h2>
<p>If everything works great, you can just remove the ~/work directory and all will be cleaned up and your machine will be running a nice happy AMP stack!</p>
<p>Good luck!
</p></div>
<style type='text/css'>
#tutorial a
{
  color: #7a5;
}
</style>
]]></content:encoded>
			<wfw:commentRss>http://adylitica.com/2009/11/24/installing-amp-apache-mysql-php-on-mac-os-x-10-6-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>What&#8217;s really wrong with Twitter&#8217;s new Retweet functionality</title>
		<link>http://adylitica.com/2009/11/24/whats-wrong-twitter-retweet-functionality/</link>
		<comments>http://adylitica.com/2009/11/24/whats-wrong-twitter-retweet-functionality/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 04:10:40 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[Social Networking]]></category>

		<guid isPermaLink="false">http://adylitica.com/?p=124</guid>
		<description><![CDATA[The new retweet functionality in Twitter is poorly done, but not for all the reasons you've been hearing so far.]]></description>
			<content:encoded><![CDATA[<p>There has been a lot of chatter about Twitter&#8217;s new Retweet (RT) functionality of late,  pretty much all of it negative. The complaints range from it looks weird in the website, to it destroying the ability to add little chats along with tweets when forwarding, to even saying that it&#8217;s a huge hassle for clients to implement.  While I agree with the end message (the new RT functionality is not good), I&#8217;m convinced that all of these complaints are fundamentally wrong.</p>
<p>The real problem with the new Twitter retweet functionality is that it destroys the chain of trust.  The point of the retweet is that somebody whom I find interesting found something else interesting and wants to share that info, all the while crediting the original author.</p>
<p>One of the reasons I have a list of people I follow is that I&#8217;ve come to respect them for the information they share and send around with Twitter.  I don&#8217;t know who <span style='color: blue'>@joeblow12345abc</span> is, but when <span style='color: blue'>@my_bff_forever</span> forwards an article that just so happens to have originally been sent by the former, I&#8217;ll probably read it.</p>
<p>So, the problem with Twitter now is that when I got to the website, I see a tweet from <span style='color: blue'>@joeblow12345abc</span> on my home page.  I don&#8217;t know this person, and I sit for a few seconds wondering what on earth he&#8217;s doing in my tweet list.  It&#8217;s only after looking at the bottom of the tweet in tiny letters do I see that it&#8217;s been forwarded by somebody I am following. It goes against the whole point of Twitter.  The community has done a good job of setting up the standards for tweet formats thus far — probably best to let them continue.</p>
]]></content:encoded>
			<wfw:commentRss>http://adylitica.com/2009/11/24/whats-wrong-twitter-retweet-functionality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
