<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:series="http://unfoldingneurons.com/" version="2.0">

<channel>
	<title>Mobiletuts+</title>
	
	<link>http://mobile.tutsplus.com</link>
	<description>iPhone, Android, Windows and BlackBerry mobile development tutorials.</description>
	<lastBuildDate>Mon, 21 May 2012 14:20:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MobileTuts" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="mobiletuts" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">MobileTuts</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Corona SDK: Create a Balloon Game – Interaction</title>
		<link>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-balloon-game-interaction/</link>
		<comments>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-balloon-game-interaction/#comments</comments>
		<pubDate>Mon, 21 May 2012 14:20:15 +0000</pubDate>
		<dc:creator>Carlos Yanez</dc:creator>
				<category><![CDATA[Corona SDK]]></category>
		<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[games]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10726</guid>
		<description>&lt;p&gt;This is the second installment in our Corona SDK Bloons inspired Game tutorial. In today&amp;#8217;s tutorial, we&amp;#8217;ll add to our interface and start coding the game interaction. Read on!&lt;/p&gt;
&lt;p&gt;&lt;!--more--&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;Where We Left Off. . .&lt;/h2&gt;
&lt;p&gt;Please be sure to check &lt;a href="http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-bloons-like-game/"&gt;&lt;em&gt;part 1&lt;/em&gt; of the series&lt;/a&gt; to fully understand and prepare for this tutorial.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 1:&lt;/span&gt; Declare Functions&lt;/h2&gt;
&lt;p&gt;Declare all  functions as &lt;em&gt;local&lt;/em&gt; at the start.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
local Main = {}
local startButtonListeners = {}
local showCredits = {}
local hideCredits = {}
local showGameView = {}
local gameListeners = {}
local startCharge = {}
local charge = {}
local shot = {}
local onCollision = {}
local startGame = {}
local createBalloons = {}
local update = {}
local restartLvl = {}
local alert = {}
local restart = {}
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 2:&lt;/span&gt; Constructor&lt;/h2&gt;
&lt;p&gt;Next, we&amp;#8217;ll create the function that will initialize all the game logic:&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function Main()
	-- code...
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 3:&lt;/span&gt; Add Title View&lt;/h2&gt;
&lt;p&gt;Now we place the TitleView in the stage and call a function that will add the &lt;em&gt;tap&lt;/em&gt; listeners to the buttons.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
titleBg = display.newImage('titleBg.png')
playBtn = display.newImage('playBtn.png', display.contentCenterX - 25.5, display.contentCenterY + 40)
creditsBtn = display.newImage('creditsBtn.png', display.contentCenterX - 40.5, display.contentCenterY + 85)
titleView = display.newGroup(titleBg, playBtn, creditsBtn)	

startButtonListeners('add')
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 4:&lt;/span&gt; Start Button Listeners&lt;/h2&gt;
&lt;p&gt;This function adds the necesary listeners to the &lt;em&gt;TitleView&lt;/em&gt; buttons.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function startButtonListeners(action)
	if(action == 'add') then
		playBtn:addEventListener('tap', showGameView)
		creditsBtn:addEventListener('tap', showCredits)
	else
		playBtn:removeEventListener('tap', showGameView)
		creditsBtn:removeEventListener('tap', showCredits)
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 5:&lt;/span&gt; Show Credits&lt;/h2&gt;
&lt;p&gt;The credits screen is shown when the user taps the about button. A &lt;em&gt;tap&lt;/em&gt; listener is added to the credits view to remove it.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function showCredits:tap(e)
	playBtn.isVisible = false
	creditsBtn.isVisible = false
	creditsView = display.newImage('credits.png')
	transition.from(creditsView, {time = 300, x = -creditsView.width, onComplete = function() creditsView:addEventListener('tap', hideCredits) creditsView.x = creditsView.x - 0.5 end})
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 6:&lt;/span&gt; Hide Credits&lt;/h2&gt;
&lt;p&gt;When the credits screen is tapped, it&amp;#8217;ll be tweened out of the stage and removed.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function hideCredits:tap(e)
    playBtn.isVisible = true
    creditsBtn.isVisible = true
    transition.to(creditsView, {time = 300, x = -creditsView.width, onComplete = function() creditsView:removeEventListener('tap', hideCredits) display.remove(creditsView) creditsView = nil end})
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 7:&lt;/span&gt; Show Game View&lt;/h2&gt;
&lt;p&gt;When the &lt;em&gt;Start&lt;/em&gt; button is tapped the title view is tweened and removed, revealing the game view.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function showGameView:tap(e)
	transition.to(titleView, {time = 300, x = -titleView.height, onComplete = function() startButtonListeners('rmv') display.remove(titleView) titleView = nil startGame() end})

	-- Add GFX

	infoBar = display.newImage('infoBar.png', 0, 276)
	restartBtn = display.newImage('restartBtn.png', 443, 286)
	squirrel = display.newImage('squirrel.png', 70, 182)
	gCircle = display.newImage('gCircle.png', 83, 216)
	gCircle:setReferencePoint(display.CenterReferencePoint)

	targetTF = display.newText('0', 123, 287, native.systemFontBold, 14)
	targetTF:setTextColor(238, 238, 238)

	scoreTF = display.newText('0', 196, 287, native.systemFontBold, 14)
	scoreTF:setTextColor(238, 238, 238)

	acornsTF = display.newText('5', 49, 287, native.systemFontBold, 13)
	acornsTF:setTextColor(238, 238, 238)
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 8:&lt;/span&gt; Game Listeners&lt;/h2&gt;
&lt;p&gt;This code adds tap listeners to the game background. These will be used to shoot the acorns to the balloons. A &lt;em&gt;tap&lt;/em&gt; listener is also added to the restart button.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function gameListeners(action)
	if(action == 'add') then
		bg:addEventListener('touch', startCharge)
		bg:addEventListener('touch', shot)
		restartBtn:addEventListener('tap', restartLvl)
		Runtime:addEventListener('enterFrame', update)
	else
		bg:removeEventListener('touch', startCharge)
		bg:removeEventListener('touch', shot)
		restartBtn:removeEventListener('tap', restartLvl)
		Runtime:removeEventListener('enterFrame', update)
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 9:&lt;/span&gt; Start Game&lt;/h2&gt;
&lt;p&gt;Here we start the game by hiding the direction indicator, adding the game listeners and calling the function that generates the balloons.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function startGame()
	-- Hide gCircle 

	gCircle.isVisible = false

	-- Create balloon function 

	gameListeners('add')
	createBalloons(5, 3)
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 10:&lt;/span&gt; Create Balloons&lt;/h2&gt;
&lt;p&gt;A double for loop is used to create and place the balloons on the stage. The balloon is then added to a table. This will grant us access to the balloons outside this function.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function createBalloons(h, v)
	for i = 1, h do
		for j = 1, v do
			local balloon = display.newImage('balloon.png', 300 + (i * 20), 120 + (j * 30))
			balloon.name = 'balloon'
			physics.addBody(balloon)
			balloon.bodyType = 'static'
			table.insert(balloons, balloon)
		end
	end

	-- Set balloon counter 

	targetTF.text = #balloons
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 11:&lt;/span&gt; Collisions&lt;/h2&gt;
&lt;p&gt;This function handles the acorn-balloon collisions.&lt;/p&gt;
&lt;p&gt;When this occur, the balloon is removed from the stage and a sound is played. We also update the score and target textfields.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function onCollision(e)
	if(e.other.name == 'balloon') then
		display.remove(e.other)
		e.other = nil
		audio.play(pop)
		scoreTF.text = scoreTF.text + 50
		scoreTF:setReferencePoint(display.TopLeftReferencePoint)
		scoreTF.x = 196
		targetTF.text = targetTF.text - 1
	end

	if(targetTF.text == '0') then
		alert('win')
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 12:&lt;/span&gt; Start Charge&lt;/h2&gt;
&lt;p&gt;This code will reveal the direction indicator, reset the acorn&amp;#8217;s impulse variable, and add a frame listener that will handle the aim and impulse value.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function startCharge:touch(e)
	if(e.phase == 'began') then
		impulse = 0
		gCircle.isVisible = true
		Runtime:addEventListener('enterFrame', charge)
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 13:&lt;/span&gt; Charge&lt;/h2&gt;
&lt;p&gt;The aim rotates accordingly to the direction that will take the acorn, which is set by the impulse variable.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
function charge()
	gCircle.rotation = gCircle.rotation - 3
	impulse = impulse - 0.2

	-- Prevent over rotation

	if(gCircle.rotation &amp;lt; -46) then
		gCircle.rotation = -46
		impulse = -3.2
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 14: &lt;/span&gt;Code Review&lt;/h2&gt;
&lt;p&gt;Here is the full code written in this tutorial, alongside with the comments to help you identify each part:&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
-- Balloons Physics Game
-- Developed by Carlos Yanez

-- Hide Status Bar

display.setStatusBar(display.HiddenStatusBar)

-- Physics

local physics = require('physics')
physics.start()

-- Graphics

-- [Background]

local bg = display.newImage('gameBg.png')

-- [Title View]

local titleBg
local playBtn
local creditsBtn
local titleView

-- [Credits]

local creditsView

-- [Game View]

local gCircle
local squirrel
local infoBar
local restartBtn

-- [TextFields]

local scoreTF
local targetTF
local acornsTF

-- Load Sound

local pop = audio.loadSound('pop.mp3')

-- Variables

local titleView
local credits
local acorns = display.newGroup()
local balloons = {}
local impulse = 0
local dir = 3

-- Functions

local Main = {}
local startButtonListeners = {}
local showCredits = {}
local hideCredits = {}
local showGameView = {}
local gameListeners = {}
local startCharge = {}
local charge = {}
local shot = {}
local onCollision = {}
local startGame = {}
local createBalloons = {}
local update = {}
local restartLvl = {}
local alert = {}
local restart = {}

-- Main Function

function Main()
	titleBg = display.newImage('titleBg.png')
	playBtn = display.newImage('playBtn.png', display.contentCenterX - 25.5, display.contentCenterY + 40)
	creditsBtn = display.newImage('creditsBtn.png', display.contentCenterX - 40.5, display.contentCenterY + 85)
	titleView = display.newGroup(titleBg, playBtn, creditsBtn)

	startButtonListeners('add')
end

function startButtonListeners(action)
	if(action == 'add') then
		playBtn:addEventListener('tap', showGameView)
		creditsBtn:addEventListener('tap', showCredits)
	else
		playBtn:removeEventListener('tap', showGameView)
		creditsBtn:removeEventListener('tap', showCredits)
	end
end

function showCredits:tap(e)
	playBtn.isVisible = false
	creditsBtn.isVisible = false
	creditsView = display.newImage('credits.png')
	transition.from(creditsView, {time = 300, x = -creditsView.width, onComplete = function() creditsView:addEventListener('tap', hideCredits) creditsView.x = creditsView.x - 0.5 end})
end

function hideCredits:tap(e)
	playBtn.isVisible = true
	creditsBtn.isVisible = true
	transition.to(creditsView, {time = 300, x = -creditsView.width, onComplete = function() creditsView:removeEventListener('tap', hideCredits) display.remove(creditsView) creditsView = nil end})
end

function showGameView:tap(e)
	transition.to(titleView, {time = 300, x = -titleView.height, onComplete = function() startButtonListeners('rmv') display.remove(titleView) titleView = nil startGame() end})

	-- Add GFX

	infoBar = display.newImage('infoBar.png', 0, 276)
	restartBtn = display.newImage('restartBtn.png', 443, 286)
	squirrel = display.newImage('squirrel.png', 70, 182)
	gCircle = display.newImage('gCircle.png', 83, 216)
	gCircle:setReferencePoint(display.CenterReferencePoint)

	targetTF = display.newText('0', 123, 287, native.systemFontBold, 14)
	targetTF:setTextColor(238, 238, 238)

	scoreTF = display.newText('0', 196, 287, native.systemFontBold, 14)
	scoreTF:setTextColor(238, 238, 238)

	acornsTF = display.newText('5', 49, 287, native.systemFontBold, 13)
	acornsTF:setTextColor(238, 238, 238)
end

function gameListeners(action)
	if(action == 'add') then
		bg:addEventListener('touch', startCharge)
		bg:addEventListener('touch', shot)
		restartBtn:addEventListener('tap', restartLvl)
		Runtime:addEventListener('enterFrame', update)
	else
		bg:removeEventListener('touch', startCharge)
		bg:removeEventListener('touch', shot)
		restartBtn:removeEventListener('tap', restartLvl)
		Runtime:removeEventListener('enterFrame', update)
	end
end

function startGame()
	-- Hide gCircle 

	gCircle.isVisible = false

	-- Create balloon function 

	gameListeners('add')
	createBalloons(5, 3)
end

function createBalloons(h, v)
	for i = 1, h do
		for j = 1, v do
			local balloon = display.newImage('balloon.png', 300 + (i * 20), 120 + (j * 30))
			balloon.name = 'balloon'
			physics.addBody(balloon)
			balloon.bodyType = 'static'
			table.insert(balloons, balloon)
		end
	end

	-- Set balloon counter 

	targetTF.text = #balloons
end

function onCollision(e)
	--if(e.other.name == 'balloon' and e.phase == 'ended') then
	if(e.other.name == 'balloon') then
		display.remove(e.other)
		e.other = nil
		audio.play(pop)
		scoreTF.text = scoreTF.text + 50
		scoreTF:setReferencePoint(display.TopLeftReferencePoint)
		scoreTF.x = 196
		targetTF.text = targetTF.text - 1
	end

	if(targetTF.text == '0') then
		alert('win')
	end
end

function startCharge:touch(e)
	if(e.phase == 'began') then
		impulse = 0
		gCircle.isVisible = true
		Runtime:addEventListener('enterFrame', charge)
	end
end

function charge()
	gCircle.rotation = gCircle.rotation - 3
	impulse = impulse - 0.2

	-- Prevent over rotation

	if(gCircle.rotation &amp;lt; -46) then
		gCircle.rotation = -46
		impulse = -3.2
	end
end
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Next Time&amp;#8230;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;In the next and final part of the series, we&amp;#8217;ll handle the acorn shooting, level restart, and the final steps to take prior to release like app testing, creating a start screen, adding an icon and, finally, building the app. Stay tuned for the final part!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HO7EkwWTtlpmDLLWTQxnzmpBJP4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HO7EkwWTtlpmDLLWTQxnzmpBJP4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HO7EkwWTtlpmDLLWTQxnzmpBJP4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HO7EkwWTtlpmDLLWTQxnzmpBJP4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-balloon-game-interaction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working With CorePlot – Tuts+ Premium</title>
		<link>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-4/</link>
		<comments>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-4/#comments</comments>
		<pubDate>Fri, 18 May 2012 07:03:38 +0000</pubDate>
		<dc:creator>Aron Bury</dc:creator>
				<category><![CDATA[iOS SDK]]></category>
		<category><![CDATA[Premium]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10749</guid>
		<description>&lt;p&gt;When working with data intensive applications, a developer must often do more than just show lists of data records in a table view. The CorePlot library will allow you to add stunning data visualizations to your applications. Find out how in this Tuts+ Premium series!&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Tutorial Teaser&lt;/h2&gt;
&lt;h3&gt;Where We Left Off&lt;/h3&gt;
&lt;p&gt;Last time we went over how to customize the look and style of a line graph (or scatter plot) using classes such as CPTMutableTextStyle and CPTMutableLineStyle. We learned how to customize the X and Y axis increments and number styles using the CPTXYAxisSet and CPTXYAxis classes. We also looked at how to add multiple plots to your graph and modify the data source methods to provide the correct data for the right plots using plot identifiers.&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;What We&amp;#8217;ll Cover Today&lt;/h3&gt;
&lt;p&gt;Today we&amp;#8217;ll be working with a completely new graph. We will be creating a bar chart that shows the total number of students in each subject with each bar representing a subject. We&amp;#8217;ll also look at how to customize the look and feel of the graph. Let&amp;#8217;s get started!&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;Step 1: Setting Up&lt;/h3&gt;
&lt;p&gt;First up we need to add the relevant classes to our project. Let&amp;#8217;s create a ViewController called &amp;#8216;STBarGraphViewController&amp;#8217; and a &amp;#8216;STGraphView&amp;#8217;. (Make sure you put them in the relevant groups)&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://tutsplus.s3.amazonaws.com/tutspremium/mobile-dev/iOS-SDK_CorePlot/4/classess.png" title="classess.png" /&gt;
&lt;/div&gt;
&lt;p&gt;Notice the naming of the view to &amp;#8216;STGraphView&amp;#8217; instead of &amp;#8216;STBarGraphView&amp;#8217;. Going forward we will be using this view to display the bar and pie graphs.&lt;/p&gt;
&lt;p&gt;Before we start working with any code we need to add a button to the Action sheet of our student list view. First open up &amp;#8216;STStudentListViewController.h&amp;#8217; and import STBarGraphViewController. Add STBarGraphViewControllerDelegate to the list of registered protocols (the protocol actually doesn&amp;#8217;t exist yet but we will create it later):&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@interface STStudentListViewController : UIViewController &amp;lt;UITableViewDelegate, UITableViewDataSource, AddStudentViewControllerDelegate, UIActionSheetDelegate, STLineGraphViewControllerDelegate, STBarGraphViewControllerDelegate&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Next, jump into the .m file and locate the &amp;#8216;graphButtonWasSelected:&amp;#8217; method. Add &amp;#8216;Enrolment by subject&amp;#8217; to the list of &amp;#8216;otherButtonTitles:&amp;#8217;:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
UIActionSheet *graphSelectionActionSheet = [[[UIActionSheet alloc] initWithTitle:@&amp;quot;Choose a graph&amp;quot; delegate:self cancelButtonTitle:@&amp;quot;Cancel&amp;quot; destructiveButtonTitle:nil otherButtonTitles:@&amp;quot;Enrolment over time&amp;quot;, @&amp;quot;Enrolment by subject&amp;quot;, nil] autorelease];
&lt;/pre&gt;
&lt;p&gt;Now find the &amp;#8216;actionSheet:clickedButtonAtIndex:&amp;#8217; method and modify it to work with buttonIndex == 1:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
if (buttonIndex == 0)
{
    STLineGraphViewController *graphVC = [[STLineGraphViewController alloc] init];
    [graphVC setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
    [graphVC setModalPresentationStyle:UIModalPresentationFullScreen];
    [graphVC setDelegate:self];
    [graphVC setManagedObjectContext:[self managedObjectContext]];

    [self presentModalViewController:graphVC animated:YES];

    [graphVC release];

}
else if (buttonIndex == 1)
{
    STBarGraphViewController *graphVC = [[STBarGraphViewController alloc] init];
    [graphVC setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
    [graphVC setModalPresentationStyle:UIModalPresentationFullScreen];
    [graphVC setDelegate:self];
    [graphVC setManagedObjectContext:[self managedObjectContext]];

    [self presentModalViewController:graphVC animated:YES];

    [graphVC release];
}
&lt;/pre&gt;
&lt;p&gt;Again, this will show some warnings because we haven&amp;#8217;t implemented the delegate or managedObjectContext properties on STBarGraphViewController yet.&lt;/p&gt;
&lt;p&gt;Now jump into STBarGraphViewController.h. Import CorePlot-CocoaTouch.h and add the following property declaration:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@protocol STBarGraphViewControllerDelegate
@required
- (void)doneButtonWasTapped:(id)sender;

@end
&lt;/pre&gt;
&lt;p&gt;Now add the following properties:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@property (nonatomic, strong) CPTGraph *graph;
@property (nonatomic, assign) id&amp;lt;STBarGraphViewControllerDelegate&amp;gt; delegate;
@property (nonatomic, strong) NSManagedObjectContext *managedObjectContext;
&lt;/pre&gt;
&lt;p&gt;Finally, register that this class will follow these protocols:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@interface STBarGraphViewController : UIViewController &amp;lt;CPTBarPlotDelegate, CPTBarPlotDataSource&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Notice that, aside from conforming to different protocols, this class is the same as STLineViewController. Ideally, you would have a base class that would have these properties that you would subclass to reduce code repetition. This tutorial is focusing on core plot only, so we are only focusing on how best to work with the CorePlot framework. If you&amp;#8217;ve got the knowledge and time, feel free to create the base class and use inheritance, but we&amp;#8217;re going to keep it simple in the sample code here.&lt;/p&gt;
&lt;p&gt;Next, jump into the .m file, synthesize the properties, and release them in the dealloc method.&lt;/p&gt;
&lt;p&gt;Now let&amp;#8217;s link the view class as the controller&amp;#8217;s view. Import &amp;#8216;STBarGraphView.h&amp;#8217;, and add the following method:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (void)loadView
{
    [super loadView];

    [self setTitle:@&amp;quot;Enrolment by subject&amp;quot;];
    [self setView:[[[STGraphView alloc] initWithFrame:self.view.frame] autorelease]];

    CPTTheme *defaultTheme = [CPTTheme themeNamed:kCPTPlainWhiteTheme];

    [self setGraph:(CPTGraph *)[defaultTheme newGraph]];
}
&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;Get the Full Series!&lt;/h2&gt;
&lt;p&gt;This tutorial series is available to &lt;a href="http://tutsplus.com/"&gt;Tuts+ Premium members only&lt;/a&gt;. Read a &lt;a href="http://tutsplus.com/tutorial/working-with-coreplot-creating-a-bar-chart/"&gt;preview of this tutorial&lt;/a&gt; on the Tuts+ Premium web site or &lt;a href="http://tutsplus.com/amember/login.php"&gt;login&lt;/a&gt; to Tuts+ Premium to access the full content. &lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Joining Tuts+ Premium. . .&lt;/h2&gt;
&lt;p&gt;For those unfamiliar, the family of &lt;a href="http://tutsplus.com"&gt;Tuts+&lt;/a&gt; sites runs a premium membership service called Tuts+ Premium. For $19 per month, you gain access to exclusive premium tutorials, screencasts, and freebies from &lt;a href="http://mobile.tutsplus.com"&gt;Mobiletuts+&lt;/a&gt;, &lt;a href="http://net.tutsplus.com"&gt;Nettuts+&lt;/a&gt;, &lt;a href="http://ae.tutsplus.com"&gt;Aetuts+&lt;/a&gt;, &lt;a href="http://audio.tutsplus.com"&gt;Audiotuts+&lt;/a&gt;, &lt;a href="http://vector.tutsplus.com"&gt;Vectortuts+&lt;/a&gt;, and &lt;a href="http://cg.tutsplus.com"&gt;CgTuts+&lt;/a&gt;. You&amp;#8217;ll learn from some of the best minds in the business. &lt;a href="http://tutsplus.com/mobile-premium/"&gt;Become a premium member&lt;/a&gt; to access this tutorial, as well as hundreds of other advanced tutorials and screencasts.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uDtfP0AFevtGlNDhKW3_jMtF6PU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uDtfP0AFevtGlNDhKW3_jMtF6PU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uDtfP0AFevtGlNDhKW3_jMtF6PU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uDtfP0AFevtGlNDhKW3_jMtF6PU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Unity3D</title>
		<link>http://mobile.tutsplus.com/tutorials/android/introduction-to-unity3d/</link>
		<comments>http://mobile.tutsplus.com/tutorials/android/introduction-to-unity3d/#comments</comments>
		<pubDate>Thu, 17 May 2012 11:30:48 +0000</pubDate>
		<dc:creator>Ian Zamojc</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[iOS SDK]]></category>
		<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10752</guid>
		<description>&lt;p&gt;Unity3D is a powerful cross-platform 3D engine and a user-friendly development environment. Learn how Unity3D can help you create games in this article!&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;What is Unity3D?&lt;/h2&gt;
&lt;p&gt;Unity3D is a powerful cross-platform 3D engine and a user friendly development environment. Easy enough for the beginner and powerful enough for the expert; Unity should interest anybody who wants to easily create 3D games and applications for mobile, desktop, the web, and consoles.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Cost&lt;/h2&gt;
&lt;p&gt;Indie developers rejoice, Unity is free!  Well, almost.  There is a Pro edition that comes with more features and tools, but will set you back $1,500. Considering the feature set and how permissive the Unity publishing license is, this price is actually very reasonable. However, the free version will let you get your feet wet, build complete games, and even publish them to the desktop and the web without paying a cent! The only caveat is that games published under the free edition will have a small Unity watermark.&lt;/p&gt;
&lt;p&gt;Anything built in Unity will work exactly the same way in Unity Pro.  This means you can choose to upgrade at any point if you need the additional features, or want to publish to more platforms such as iOS and Android. There’s also a 30 day Pro trial you can sign up for in order to test drive all the extra features!&lt;/p&gt;
&lt;p&gt;A complete feature comparison between Unity and Unity Pro can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://unity3d.com/unity/licenses"&gt;http://unity3d.com/unity/licenses&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Installation&lt;/h2&gt;
&lt;p&gt;Installation is a painless two step process.  First, download and run the Unity installer.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/install.png" alt="Unity Installer" /&gt;
&lt;/div&gt;
&lt;p&gt;Second, when you start Unity for the first time, it will open a web browser and prompt you to register using your email address. It will let you choose which version you want to run. You can select either the free version or a Pro trial that will fallback to the free version after 30 days.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;The Application&lt;/h2&gt;
&lt;p&gt;The Unity application is a complete 3D environment, suitable for laying out levels, creating menus, doing animation, writing scripts, and organizing projects. The user interface is well organized and the panels can be fully customized by dragging and dropping.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/application.png" alt="Unity Application" /&gt;
&lt;/div&gt;
&lt;p&gt;The Project panel is where all the assets within a project are stored. When assets are imported, they will first appear here.&lt;/p&gt;
&lt;p&gt;The hierarchy panel is where assets are organized in a scene. Assets from the Project panel can be dragged into the Hierarchy panel to add them to the current scene.&lt;/p&gt;
&lt;p&gt;The Inspector panel lets you inspect and adjust all the attributes of a selected asset. Everything from its position and rotation, to whether it’s affected by gravity or able to cast a shadow.&lt;/p&gt;
&lt;p&gt;The Scene panel is a 3D viewport where you can physically arrange assets by moving them around in 3D space. You can navigate the viewport by panning, rotating, and zooming the view. If you’ve used Maya at all, you should find these hotkeys familiar:&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/mouse_buttons.png" alt="Mouse Button Shortcuts" /&gt;
&lt;/div&gt;
&lt;p&gt;When it comes to running your game, it couldn’t be simpler.  Just press the play button. To stop it, press the play button again.  You can even pause your game during play to inspect your scene.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/play_button.png" alt="Play Button" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Unity Projects&lt;/h2&gt;
&lt;p&gt;A Unity project is an ordinary folder containing every resource that belongs to your game. Creating a new project is a straightforward affair.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click File &gt; New Project&lt;/li&gt;
&lt;li&gt;Click the Create New Project tab&lt;/li&gt;
&lt;li&gt;Browse to a suitable folder&lt;/li&gt;
&lt;li&gt;Click Create&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/create_project.png" alt="Create New Project Window" /&gt;
&lt;/div&gt;
&lt;p&gt;The result is a project folder containing subfolders named Assets, Library, and ProjectSettings.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/project_folder.png" alt="Project Folder" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Assets&lt;/h2&gt;
&lt;p&gt;Assets are any resource your game uses. These include 3D models, materials, textures, audio, scripts, and fonts, to name a few.  Other than a few simple objects such as cubes and spheres, Unity can’t actually create most of these assets. Instead, they must be created externally using 3D modeling applications and painting tools and then imported into Unity.&lt;/p&gt;
&lt;p&gt;Thankfully, Unity’s asset importing is robust and intelligent. Traditionally, 3D game engines have usually been finicky things and are very particular about what files you give them, forcing developers to carefully convert all their files. Not Unity. It will accept all popular 3D file formats including Maya, 3D Studio Max, Blender and FilmBox with all the rigging, materials and textures intact. Unity also supports all common image file formats, including PNG, JPEG, TIFF and even layered PSD files directly from Photoshop. When it comes to audio, Unity supports WAV and AIF, ideal for sound effects, and MP3 and OGG for music.&lt;/p&gt;
&lt;p&gt;A complete list of all the formats Unity can import can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://unity3d.com/unity/editor/importing"&gt;http://unity3d.com/unity/editor/importing&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Let’s import an asset so we have something to work with:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download &lt;a href="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/boxboy.zip"&gt;boxboy.zip&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Unzip it to your desktop&lt;/li&gt;
&lt;li&gt;Drag the boxboy folder (containing boxboy.fbx and texture.png) from your desktop into the Project panel&lt;/li&gt;
&lt;li&gt;Drag the boxboy asset from the Project panel into the Hierarchy panel&lt;/li&gt;
&lt;li&gt;Select boxboy in the Hierarchy panel&lt;/li&gt;
&lt;li&gt;Press F to focus the Scene panel on the boxboy&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note: Unity has an Asset Store where you can purchase 3D models, characters, textures, sound effects, music, tools, and even scripts.  The Unity Asset Store has quickly become an invaluable resource for game developers and a money making venture for artists and tool developers.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Scenes&lt;/h2&gt;
&lt;p&gt;Scenes are where you can drag in project assets and arrange them to make levels and game screens.  The Hierarchy panel represents the contents of the current scene in a tree-like format.  While the Scene panel is ideal for arranging your scene’s assets in 3D space, the Hierarchy is where you’ll spend most of your time actually organizing your scenes and keeping them tidy.&lt;/p&gt;
&lt;p&gt;When you start a new project, Unity automatically creates a new scene for you. Scenes start out with nothing but a camera.  If you were to run the game now, you won’t see anything but the background color. To give us something to look at:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Drag the boxboy asset we imported from the Project panel into the Hierarchy panel
&lt;div class="tutorial_image"&gt;
            &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/project_to_hierarchy.png" alt="Dragging Asset to Hierarchy" /&gt;
        &lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Select the boxboy asset in the Hierarchy panel&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the Inspector, find the Transform component and adjust the position so that X, Y, and Z are all set to 0.  This will ensure your asset is at the exact center of the 3D world.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
            &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/transform_properties.png" alt="Transform Properties" /&gt;
        &lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The default camera position isn’t very good, so let’s give it a better angle.  Select the camera, then reposition it using the move and rotate tools.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
            &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/camera_gimbal.png" alt="Camera Being Moved" /&gt;
        &lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Scenes are assets and should be saved in your project just like other assets. To save your scene:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click File &gt; Save Scene&lt;/li&gt;
&lt;li&gt;Navigate to your project’s Assets folder&lt;/li&gt;
&lt;li&gt;Name your scene Main&lt;/li&gt;
&lt;li&gt;Click Save&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/project_with_main.png" alt="Project With Main Scene" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Scripting&lt;/h2&gt;
&lt;p&gt;Scripts, known in Unity as behaviours, let you take assets in your scene and make them interactive.  Multiple scripts can be attached to a single object, allowing for easy code reuse. Unity supports three different programming languages; UnityScript, C#, and Boo.  UnityScript is similar to JavaScript and ActionScript, C# is similar to Java, and Boo is similar to Python.  Depending on your background you may feel more comfortable with one or the other.&lt;/p&gt;
&lt;p&gt;Let’s create a C# script: &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click Assets &gt; Create &gt; New C# Script&lt;/li&gt;
&lt;li&gt;Rename the new script in the Project panel to PlayerScript&lt;/li&gt;
&lt;li&gt;Double click the script to open it in MonoDevelop&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The script should look just like this:&lt;/p&gt;
&lt;pre class="brush: jscript; title: ;"&gt;
using UnityEngine;
using System.Collections;

public class PlayerScript : MonoBehaviour {
        // Use this for initialization
        void Start () {
        }

        // Update is called once per frame
        void Update () {
        }
}
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; C# class names must be the same as their file name and are case sensitive. Make sure your class name matches the file name exactly, excluding the file extension.&lt;/p&gt;
&lt;p&gt;All scripts have a &lt;code&gt;start()&lt;/code&gt; method and an &lt;code&gt;update()&lt;/code&gt; method.  The &lt;code&gt;start()&lt;/code&gt; method is run once when the object is first created, while the &lt;code&gt;update()&lt;/code&gt; method run once per frame. Our script needs to be constantly checking for arrow keys being pressed, so we’ll add the following code to the &lt;code&gt;update()&lt;/code&gt; method.&lt;/p&gt;
&lt;pre class="brush: jscript; title: ;"&gt;
void Update () {
    float horizontal = Input.GetAxis(&amp;quot;Horizontal&amp;quot;);
    float vertical = Input.GetAxis(&amp;quot;Vertical&amp;quot;);
    transform.Translate(horizontal, vertical, 0);
}
&lt;/pre&gt;
&lt;p&gt;Now that our script is done, we need to assign it to our asset. Naturally, Unity makes this a simple affair:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Drag the script onto the boxboy asset in your scene&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;With the script assigned to our boxboy asset, we can run the game and move BoxBoy around by pressing the arrow keys.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Publishing&lt;/h2&gt;
&lt;p&gt;Unity is able to publish to Windows, OS X, and the web via the Unity Web Player.  The Web Player is a browser plugin that works in all major browsers and offers the same performance available on the desktop.&lt;br /&gt;
You can download the Unity Web Player here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://unity3d.com/webplayer/"&gt;http://unity3d.com/webplayer/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Not surprisingly, Unity Pro can publish to even more platforms, including iOS, Android, Wii, Xbox 360, Playstation 3 and even a Flash version of the Web Player.&lt;/p&gt;
&lt;p&gt;To publish our game for the Web Player:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click File &gt; Build &amp;#038; Run&lt;/li&gt;
&lt;li&gt;Select Web Player from the list&lt;/li&gt;
&lt;li&gt;Click Build And Run&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/webplayer.png" alt="Unity Web Player" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://d339vfjsz5zott.cloudfront.net/Unity3D_Introduction/introduction_to_unity.zip"&gt;Click here&lt;/a&gt; to download the complete Unity project.&lt;/p&gt;
&lt;p&gt;This article barely scratches the surface of what is possible with Unity. If this introduction has whet your appetite for more 3D game development, be sure to check out the following resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://answers.unity3d.com/index.html"&gt;Unity Answers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://unity3d.com/support/documentation/ScriptReference/"&gt;Unity Scripting Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/H2RzdhlhNat5fRSJE2tIsCwzbtQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/H2RzdhlhNat5fRSJE2tIsCwzbtQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/H2RzdhlhNat5fRSJE2tIsCwzbtQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/H2RzdhlhNat5fRSJE2tIsCwzbtQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/android/introduction-to-unity3d/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Networking Made Easy With AFNetworking</title>
		<link>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_afnetworking/</link>
		<comments>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_afnetworking/#comments</comments>
		<pubDate>Wed, 16 May 2012 11:30:42 +0000</pubDate>
		<dc:creator>Bart Jacobs</dc:creator>
				<category><![CDATA[iOS SDK]]></category>
		<category><![CDATA[AFNetworking]]></category>
		<category><![CDATA[Network Programming]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10741</guid>
		<description>&lt;p&gt;Networking is hard. There are various moving parts involved and many factors need to be considered to make it work. Fortunately, a number of open-source libraries have emerged over time to make networking easier. AFNetworking, created and maintained by the people of Gowalla, is one such library. This tutorial will introduce you to the AFNetworking framework while also showing how to query the iTunes Store API!&lt;/p&gt;
&lt;p&gt;&lt;!--more--&gt;&lt;/p&gt;
&lt;p&gt;In this tutorial, I will introduce you to AFNetworking and show you a glimpse of what this library has to offer. After spending a few minutes with this library, you will notice that it was designed with ease of use in mind. It will not only speed up your development, but it will also take care of many painstaking networking tasks. We will build a simple application that queries the iTunes Store for movies that match the search term &amp;#8220;harry&amp;#8221;. The results of our query will be displayed in a table view.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Project Summary&lt;/h2&gt;
&lt;p&gt;The application we are about to build queries the iTunes Store Search API. In particular, we search the iTunes Store for movies that match the search term &amp;#8220;harry&amp;#8221;. If our query is successful, we process the results and display them in a table view. Each row represents a movie with a title, a director, and a thumbnail showing the movie artwork. Ready? Let&amp;#8217;s get started.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Project Setup&lt;/h2&gt;
&lt;p&gt;Before we get our hands dirty with AFNetworking, we need to build a basic foundation. This means setting up our project, creating a table view, and adding an activity indicator view. We will show the activity indicator when our request is being processed by the iTunes Store. This will give the user that valuable extra bit of feedback that is often overlooked.&lt;/p&gt;
&lt;p&gt;Create a new project in Xcode by selecting the &lt;strong&gt;Single View Application&lt;/strong&gt; template from the list of templates. Name your application &lt;strong&gt;NetworkingIsFun&lt;/strong&gt;, enter a company identifier, set &amp;#8220;iPhone&amp;#8221; for the device family, and uncheck &amp;#8220;Use Storyboards&amp;#8221;. You can leave the rest untouched, but make sure that &lt;strong&gt;Use Automatic Reference Counting&lt;/strong&gt; is checked. Tell Xcode where you want to save your project and hit &amp;#8220;Save&amp;#8221;.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/iOS-SDK_AFNetworking/iOS-SDK_AFNetworking_figure-1.png" alt="AFNetworking is Fun: Project Setup - Figure 1"&gt;
&lt;/div&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/iOS-SDK_AFNetworking/iOS-SDK_AFNetworking_figure-2.png" alt="AFNetworking is Fun: Project Setup - Figure 2"&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Adding the Table and Activity Indicator Views&lt;/h2&gt;
&lt;p&gt;Even though Interface Builder is great, I often build my interfaces programmatically, and that is what we will do in this tutorial as well. It will allow us to just focus on the code without being distracted by Interface Builder. Open &lt;strong&gt;ViewController.h&lt;/strong&gt; and create three instance variables (ivars) as well as properties for these ivars. Since we are going to work with a table view, don&amp;#8217;t forget to make your view controller conform to the &lt;strong&gt;UITableViewDataSource&lt;/strong&gt; and &lt;strong&gt;UITableViewDelegate&lt;/strong&gt; protocols. Your view controller&amp;#8217;s header file should now look similar to the one below:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
#import &amp;lt;UIKit/UIKit.h&amp;gt;

@interface ViewController : UIViewController &amp;lt;UITableViewDataSource, UITableViewDelegate&amp;gt; {
    UITableView *_tableView;
    UIActivityIndicatorView *_activityIndicatorView;
    NSArray *_movies;
}

@property (nonatomic, retain) UITableView *tableView;
@property (nonatomic, retain) UIActivityIndicatorView *activityIndicatorView;
@property (nonatomic, retain) NSArray *movies;

@end
&lt;/pre&gt;
&lt;p&gt;If you are confused by the use of underscores, I recommend that you read about it &lt;a href="http://stackoverflow.com/a/6366336"&gt;here&lt;/a&gt;. Feel free to omit the underscores if you think it looks ugly or makes you feel uncomfortable. Apart from the underscores, there shouldn&amp;#8217;t be any surprises. We declare our UITableView and UIActivityIndicatorView as well as an NSArray, which we will use to store the results that we get back from our search query. Ready? Let&amp;#8217;s head over to our view controller&amp;#8217;s implementation file.&lt;/p&gt;
&lt;p&gt;Since we declared three properties in our header file, we need to synthesize their accessors in &lt;strong&gt;ViewController.m&lt;/strong&gt;. Again, if the underscores confuse you, you can leave them out.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@synthesize tableView = _tableView, activityIndicatorView = _activityIndicatorView, movies = _movies;
&lt;/pre&gt;
&lt;p&gt;In our &lt;strong&gt;viewDidLoad&lt;/strong&gt; method, we set up our table and activity indicator views. The code below should be self-explanatory for the most part. If you have never set up a table view without using Interface Builder, you might see a few lines that are unfamiliar to you. Instead of wiring the table view up in Interface Builder, we take care of this in the &lt;strong&gt;viewDidLoad&lt;/strong&gt; method. After calling the superclass&amp;#8217; &lt;strong&gt;viewDidLoad&lt;/strong&gt; method, we initizalize our table view with a frame and a style, and we set our view controller as the data source and delegate of our table view. When our application launches, we hide our table view since we don&amp;#8217;t have anything to show as long as our query hasn&amp;#8217;t returned any results. Before adding the table view as a subview to our view controller&amp;#8217;s view, we set its autoresizing mask. The autoresizing mask defines how the table view should be resized if the parent view &amp;#8211; the view controller&amp;#8217;s view to which we add the table view &amp;#8211; changes in size. This happens when the device is rotated, for example. Confused? Don&amp;#8217;t worry about it. It isn&amp;#8217;t important for this application.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (void)viewDidLoad {
    [super viewDidLoad];

    // Setting Up Table View
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0.0, 0.0, self.view.bounds.size.width, self.view.bounds.size.height) style:UITableViewStylePlain];
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    self.tableView.hidden = YES;
    [self.view addSubview:self.tableView];

    // Setting Up Activity Indicator View
    self.activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
    self.activityIndicatorView.hidesWhenStopped = YES;
    self.activityIndicatorView.center = self.view.center;
    [self.view addSubview:self.activityIndicatorView];
    [self.activityIndicatorView startAnimating];

    // Initializing Data Source
    self.movies = [[NSArray alloc] init];
}
&lt;/pre&gt;
&lt;p&gt;Setting up the activity indicator view is just as easy. We initialize the activity indicator view with a pre-defined style, set its &lt;strong&gt;hidesWhenStopped&lt;/strong&gt; property to &lt;strong&gt;YES&lt;/strong&gt;, and position it at the center of its parent view. After adding it to the view controller&amp;#8217;s view, we start animating the activity indicator. The activity indicator will automatically display itself since we set its &lt;strong&gt;hidesWhenStopped&lt;/strong&gt; property to YES.&lt;/p&gt;
&lt;p&gt;At the end of our &lt;strong&gt;viewDidLoad&lt;/strong&gt; method, we initialize the &lt;strong&gt;movies&lt;/strong&gt; array. We will use it later to store the results of our search query.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Table View Protocols&lt;/h2&gt;
&lt;p&gt;For this tutorial, we will only implement two methods of the table view data source protocol. Both of these methods are required. This is the minimum implementation required to get our table view up and running. Even though we have set our view controller as the table view&amp;#8217;s delegate, we won&amp;#8217;t use any of the delegate methods in our application. If you have used a table view before, you won&amp;#8217;t find any surprises in the method implementations shown below.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (self.movies &amp;amp;&amp;amp; self.movies.count) {
        return self.movies.count;
    } else {
        return 0;
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellID = @&amp;quot;Cell Identifier&amp;quot;;

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];

    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];
    }

    return cell;

}
&lt;/pre&gt;
&lt;p&gt;In &lt;strong&gt;tableView:numberOfRowsInSection:&lt;/strong&gt;, we need to return the number of rows in each section of the table view. In our example, the table view contains only one section (default), which makes everything a bit easier. First we check if our &lt;strong&gt;movies&lt;/strong&gt; variable is not nil and we verify that it contains items. If both of these requirements are met, we return the number of items in the movies array, if not, we return zero.&lt;/p&gt;
&lt;p&gt;Our &lt;strong&gt;tableView:cellForRowAtIndexPath:&lt;/strong&gt; method is basic as well. We start by asking our table view whether there is a cell we can reuse. If this is not the case, we create a new cell with a style and reuse identifier. We end our implementation by returning our cell. This will do for now. You can now build and run your application. If you followed the steps correctly, you should see the activity indicator spinning like crazy and the table view should be hidden.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Adding AFNetworking to the Mix&lt;/h2&gt;
&lt;p&gt;Adding AFNetworking to your project is easy as pie. Start by downloading the library from &lt;a href="https://github.com/AFNetworking/AFNetworking" target="_blank"&gt;GitHub&lt;/a&gt; and extract the archive. The archive contains a folder named &lt;strong&gt;AFNetworking&lt;/strong&gt;, which contains the source files we need to include in our project. Drag this entire folder into your Xcode project and make sure that you check &lt;strong&gt;Copy items into the destination group&amp;#8217;s folder (if needed)&lt;/strong&gt; and add the source files to your target as well.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/iOS-SDK_AFNetworking/iOS-SDK_AFNetworking_figure-3.png" alt="AFNetworking is Fun: Adding AFNetworking to the Mix - Figure 3" /&gt;
&lt;/div&gt;
&lt;p&gt;After adding the AFNetworking library to your project, build and run your application and watch as everything falls apart. What happened to our project? Why do we get all these warnings and errors? When we set up our Xcode project, we enabled &lt;strong&gt;Automatic Reference Counting (ARC)&lt;/strong&gt;. At the time of writing, the AFNetworking library does not use ARC. Don&amp;#8217;t worry, though, we can still use this neat library with very little effort. All we need to do is tell the compiler that all the source files of the AFNetworking library do not use ARC. That&amp;#8217;s it.&lt;/p&gt;
&lt;p&gt;How do we do this? Select your project in the &lt;strong&gt;Project Navigator&lt;/strong&gt; and select your target. Click the &lt;strong&gt;Build Phases&lt;/strong&gt; tab in the top navigation and open the &lt;strong&gt;Compile Sources&lt;/strong&gt; drawer. This table shows you all the source files the compiler will compile at compile time. The left column shows the names of the files and the right column shows the flags the compiler should know about.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/iOS-SDK_AFNetworking/iOS-SDK_AFNetworking_figure-4.png" alt="AFNetworking is Fun: Compiler Flags - Figure 4" /&gt;
&lt;/div&gt;
&lt;p&gt;You can see these flags as instructions or messages for the compiler. All you need to do is add a compiler flag to each source file of the AFNetworking library. To do this, select a source file from the list and double click the cell in the right column. A small window will appear in which you can add one or more compiler flags. In our case, simply type &lt;strong&gt;-fno-objc-arc&lt;/strong&gt; and click &lt;strong&gt;Done&lt;/strong&gt;. This flag tells the compiler that the source file does not use ARC. Make sure that you add this flag to all ten source files of the AFNetworking library.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/iOS-SDK_AFNetworking/iOS-SDK_AFNetworking_figure-5.png" alt="AFNetworking is Fun: Compiler Flags - Figure 5" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Querying the iTunes Store Search API&lt;/h2&gt;
&lt;p&gt;AFNetworking is a library that can do a lot for you, but today we are only going to make use of two neat features. Before we can start using the AFNetworking classes, we need to add the following import statement just below the first import statement in your view controller&amp;#8217;s implementation file.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
#import &amp;quot;AFNetworking.h&amp;quot;
&lt;/pre&gt;
&lt;p&gt;This import statement will give us access to all the AFNetworking classes. Head back to our view controller&amp;#8217;s &lt;strong&gt;viewDidLoad&lt;/strong&gt; method and add the following snippet immediately after the initialization of the &lt;strong&gt;movies&lt;/strong&gt; array.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
NSURL *url = [[NSURL alloc] initWithString:@&amp;quot;http://itunes.apple.com/search?term=harry&amp;amp;country=us&amp;amp;entity=movie&amp;quot;];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];

AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
    NSLog(@&amp;quot;JSON&amp;quot;);

} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
    NSLog(@&amp;quot;Request Failed with Error: %@, %@&amp;quot;, error, error.userInfo);
}];

[operation start];
&lt;/pre&gt;
&lt;p&gt;Let me explain what is going on. In the first line, we create the NSURL for our request. The string we use in the initialization conforms to the format that the iTunes Store Search API expects. The syntax of the Search API is fairly straightforward: The term we are searching for is &amp;#8220;harry&amp;#8221;, we restrict our search to the US iTunes Store, and we are looking only for movies. Easy, Right?&lt;/p&gt;
&lt;p&gt;Next, we initialize a NSURLRequest and pass in the NSURL we just created. Then AFNetworking kicks in. AFNetworking contains a few very specialized classes that make our job very easy. The one we use here is &lt;strong&gt;AFJSONRequestOperation&lt;/strong&gt;. This is a class that is designed to fetch and parse JSON data in the background. As the name implies, this class is a subclass of NSOperation or, to be more precise, one of the superclasses of this class inherits from NSOperation. The class lets you fetch the requested data and it also parses the JSON response. This means that we don&amp;#8217;t have to deal with raw JSON. The data it returns is ready to use in your application. AFNetworking uses the built-in JSON parser on iOS 5 and falls back to its own JSON parser for older iOS versions.&lt;/p&gt;
&lt;p&gt;Using AFJSONRequestOperation is easy since it has only one class method. This class method accepts three arguments: (1) a NSURLRequest, (2) a success block, executed when the request succeeds, and (3) a failure block, executed when the request fails. If blocks are new to you or you are not comfortable using them, then I recommend reading the tutorial by Collin Ruffenach about &lt;a href="http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-blocks-and-enumeration/"&gt;blocks and enumeration&lt;/a&gt; on Mobiletuts+. The success block takes three arguments: (1) our NSURLRequest, (2) the NSHTTPURLResponse of our request, and (3) a parsed JSON object. The failure block is almost identical. The only difference is that it takes an additional argument, an NSError that contains more information about what went wrong in case our request fails.&lt;/p&gt;
&lt;p&gt;For testing purposes, we log the parsed JSON object to see what the iTunes Store Search API sends back to us. In addition, we also log the error in the failure block in case our request happens to fail. Before building and running our application once again, we need to start the operation by calling &lt;strong&gt;start&lt;/strong&gt; on our operation object. Build and run your application and take a look at the output in the console.&lt;/p&gt;
&lt;p&gt;If all went well, you will see the results of our request logged to the console. The parsed JSON object is a dictionary with two keys: (1) &lt;strong&gt;resultCount&lt;/strong&gt;, which contains the number of results returned and (2) the actual &lt;strong&gt;results&lt;/strong&gt; as an array of dictionaries. We not only logged the response to the console to see if our request was successful, we can now see the keys for each item in the results array. We will need these keys to display some information in our table view.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Populating the Table View&lt;/h2&gt;
&lt;p&gt;We are now ready to show the results in our table view. Replace the log statement in the success block with the snippet shown below. We start by assigning the results array of the response object to the movies array. The only thing left to do is hide the activity indicator by stopping it, showing the table view, and reloading the table view with the new data stored in the movies array.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
self.movies = [JSON objectForKey:@&amp;quot;results&amp;quot;];
[self.activityIndicatorView stopAnimating];
[self.tableView setHidden:NO];
[self.tableView reloadData];
&lt;/pre&gt;
&lt;p&gt;Next we amend the &lt;strong&gt;tableView:cellForRowAtIndexPath:&lt;/strong&gt; method. Adjust your implementation to reflect the one below. After obtaining a reference to a cell, we query the movies array for the correct item, and update the labels of the cell with the title and director of the movie. Build and run your application.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellID = @&amp;quot;Cell Identifier&amp;quot;;

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];

    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];
    }

    NSDictionary *movie = [self.movies objectAtIndex:indexPath.row];
    cell.textLabel.text = [movie objectForKey:@&amp;quot;trackName&amp;quot;];
    cell.detailTextLabel.text = [movie objectForKey:@&amp;quot;artistName&amp;quot;];

    return cell;
}
&lt;/pre&gt;
&lt;p&gt;You may have noticed that there are no thumbnails to be seen. Let&amp;#8217;s fix that by adding three extra lines to our &lt;strong&gt;tableView:cellForRowAtIndexPath:&lt;/strong&gt; method. Build and run your application.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
NSURL *url = [[NSURL alloc] initWithString:[movie objectForKey:@&amp;quot;artworkUrl100&amp;quot;]];
NSData *data = [NSData dataWithContentsOfURL:url];
cell.imageView.image = [[UIImage alloc] initWithData:data];
&lt;/pre&gt;
&lt;p&gt;Did you notice that our table view does not scroll smoothly. Why is that? As I mentioned in a &lt;a href="http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_uiactivityindicatorview_mbprogresshud/"&gt;previous tutorial&lt;/a&gt;, you always have to make sure that the main thread of your application remains responsive. In the current implementation of our &lt;strong&gt;tableView:cellForRowAtIndexPath:&lt;/strong&gt; method, we are downloading the thumbnails on the main thread. This means the user interface cannot be updated until a request for a thumbnail is finished. Our thumbnails are tiny so the requests don&amp;#8217;t take too long to complete, but imagine taking the same approach for larger assets. The user experience would be terrible. Even for our simple application, the user experience is unacceptable. However, we can remedy this with a very useful feature of the AFNetworking library.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;AFNetworking to the Rescue&lt;/h2&gt;
&lt;p&gt;The creators of AFNetworking saw the need for downloading assets in the background as well. They therefore created a category for UIImageView. This category allows you to download images in the background with only two lines of code. This category is a true life saver. Have a look at the snippet below.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
NSURL *url = [[NSURL alloc] initWithString:[movie objectForKey:@&amp;quot;artworkUrl100&amp;quot;]];
[cell.imageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@&amp;quot;placeholder&amp;quot;]];
&lt;/pre&gt;
&lt;p&gt;The first line of code stays the same. In the second line, we tell the image view where the thumbnail is located by passing an NSURL and we pass in a placeholder image, which is shown as long as our request has not returned a response. How cool is that? All we need to do is add a placeholder image to our project. This can be any image you want, but you can find the image I&amp;#8217;ve used as a placeholder in the download file attached to this tutorial. Once you&amp;#8217;ve added the placeholder image, build and run your application and test for yourself how smooth the table view scrolls!&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Note that our application is very basic in its execution as it doesn&amp;#8217;t do any caching and we can only search the iTunes Store for the term &amp;#8220;harry&amp;#8221; in the movies section. However, with very little effort you can make a neat application to search the iTunes Store in a more dynamic way.&lt;/p&gt;
&lt;p&gt;I hope this tutorial has convinced you that the AFNetworking library is a great tool to have in your arsenal. It can do a lot more than what I showed you in this post, but the main goal of this tutorial is to get you up and running with AFNetworking and ready to use it in a real world scenario.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QjdYhNRrqot5tFrZLCPoqLMV5M8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QjdYhNRrqot5tFrZLCPoqLMV5M8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QjdYhNRrqot5tFrZLCPoqLMV5M8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QjdYhNRrqot5tFrZLCPoqLMV5M8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_afnetworking/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Corona SDK: Create a Balloon Game</title>
		<link>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-bloons-like-game/</link>
		<comments>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-bloons-like-game/#comments</comments>
		<pubDate>Tue, 15 May 2012 17:19:12 +0000</pubDate>
		<dc:creator>Carlos Yanez</dc:creator>
				<category><![CDATA[Corona SDK]]></category>
		<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[games]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10722</guid>
		<description>&lt;p&gt;In this tutorial series, you&amp;#8217;ll learn how to create a Bloons Inspired game. The objective of the game is to shoot at the balloons to pop them all&amp;#8230;Read on!&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 1:&lt;/span&gt; Application Overview&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
  &lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/1.png" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;Using pre-made graphics we will code  an entertaining game with Lua and the Corona SDK API&amp;#8217;s.&lt;/p&gt;
&lt;p&gt;The player will be able to shoot an acorn at the balloons by touching the screen to charge and releasing to shoot. You can modify the parameters in the code to customize the game.&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Step 2:&lt;/span&gt; Target Device&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/2.png" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;The first thing we have to do is select the platform we want to run our app within. By doing so, we&amp;#8217;ll be able to choose the size for the images we will use.&lt;/p&gt;
&lt;p&gt;The iOS platform has these characteristics:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;iPad:&lt;/strong&gt; 1024x768px, 132 ppi&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;iPhone/iPod Touch:&lt;/strong&gt; 320x480px, 163 ppi&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;iPhone 4:&lt;/strong&gt; 960x640px, 326 ppi&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Because Android is an open platform, there are many different devices and resolutions. A few of the more common screen characteristics are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Google Nexus One:&lt;/strong&gt; 480x800px, 254 ppi&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Motorola Droid X:&lt;/strong&gt; 854x480px, 228 ppi&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HTC Evo:&lt;/strong&gt; 480x800px, 217 ppi&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this tutorial, we&amp;#8217;ll be focusing on the iOS platform with the graphic design, specifically developing for distribution to an iPhone/iPod touch, but the code presented here should apply to Android development with the Corona SDK as well.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 3:&lt;/span&gt; Interface&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
&lt;p&gt;&lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/3.png" alt="" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;A simple and friendly interface will be used. This involves multiple shapes, buttons, bitmaps and more.&lt;/p&gt;
&lt;p&gt;The interface graphic resources necessary for this tutorial can be found in the attached download.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 4:&lt;/span&gt; Export Graphics&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/4.png" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;Depending on the device you have selected, you may need to export the graphics in the recommended PPI. You can do that with your favorite image editor.&lt;/p&gt;
&lt;p&gt;I used the &lt;em&gt;Adjust Size&amp;#8230;&lt;/em&gt; function in the Preview app on Mac OS X.&lt;/p&gt;
&lt;p&gt;Remember to give the images a descriptive name and save them in your project folder.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 5:&lt;/span&gt; Sound&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
  &lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/5.png" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;We&amp;#8217;ll use Sound Effects to enhance the feeling of the game, you can find the sound used in this example in &lt;a href="http://soungle.com/"&gt;Soungle.com&lt;/a&gt; using the keyword &lt;em&gt;pop&lt;/em&gt;.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 6:&lt;/span&gt; App Configuration&lt;/h2&gt;
&lt;p&gt;The &lt;em&gt;config.lua&lt;/em&gt; file will be used to make the application go fullscreen across all devices. This file shows the original screen size and the method used to scale that content in case the app is run in a different resolution.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
application =
{
    content =
    {
        width = 320,
        height = 480,
        scale = &amp;quot;letterbox&amp;quot;
    },
}
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 7:&lt;/span&gt; Main.lua&lt;/h2&gt;
&lt;p&gt;Let&amp;#8217;s write the application!&lt;/p&gt;
&lt;p&gt;Open your prefered Lua editor (any Text Editor will work, but you won&amp;#8217;t have syntax highlighting) and prepare to write your awesome app. Remember to save the file as &lt;em&gt;main.lua&lt;/em&gt; in your project folder.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 8:&lt;/span&gt; Code Structure&lt;/h2&gt;
&lt;p&gt;We&amp;#8217;ll structure our code as if it were a Class. If you know ActionScript or Java, you should find the structure familiar.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
Necesary Classes

Variables and Constants

Declare Functions

    contructor (Main function)

    class methods (other functions)

call Main function
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 9:&lt;/span&gt; Hide Status Bar&lt;/h2&gt;
&lt;pre class="brush: plain; title: ;"&gt;
display.setStatusBar(display.HiddenStatusBar)
&lt;/pre&gt;
&lt;p&gt;This code hides the status bar. The status bar is the bar on top of the device screen that shows the time, signal, and other indicators.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 10:&lt;/span&gt; Import Physics&lt;/h2&gt;
&lt;p&gt;We&amp;#8217;ll use the Physics library to handle collisions. Use this code to import it:&lt;/p&gt;
&lt;pre class="brush: plain; first-line: 14; title: ;"&gt;
local physics = require('physics')
physics.start()
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 11:&lt;/span&gt; Game Background&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
&lt;p&gt;&lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/6.png" alt="" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;A simple graphic is used as the background for the application interface, the next line of code stores it.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
-- Graphics

-- [Background]

local bg = display.newImage('gameBg.png')
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 12:&lt;/span&gt; Title View&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
&lt;p&gt;&lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/7.png" alt="" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;This is the Title View, it will be the first interactive screen to appear in our game and these variables will store its components.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
-- [Title View]

local titleBg
local playBtn
local creditsBtn
local titleView
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 13:&lt;/span&gt; Credits View&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/8.png" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;This view will show the credits, version, and copyright of the game. This variable will be used to store it.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
-- [CreditsView]

local creditsView
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 14:&lt;/span&gt; Game View&lt;/h2&gt;
&lt;div class="tutorial_image"&gt;
  &lt;img src="https://d339vfjsz5zott.cloudfront.net/Corona-SDK_Balloon-Game/9.png" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;The game view is composed by the TextFields that store the score, targets, and available acorns. It also displays the balloons, a restart button, and the squirrel that shoots the acorns. Add the following lines to your code to handle these elements. The squirrel and acorn graphics are from &lt;a href="openclipart.org"&gt;openclipart.org&lt;/a&gt;.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
-- [Game View]

local gCircle
local squirrel
local infoBar
local restartBtn

-- [TextFields]

local scoreTF
local targetTF
local acornsTF
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 15:&lt;/span&gt; Variables&lt;/h2&gt;
&lt;p&gt;These are the variables we&amp;#8217;ll use. Read the comments in the code to know more about them, some of their names are self-explanatory so there will be no comment there.&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
local titleView
local credits
local acorns = display.newGroup() -- stores the acorns thrown
local balloons = {} -- stores the balloons in stage
local impulse = 0 -- used shot the acorn
local dir = 3 -- default direction of the acorn
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Step 16:&lt;/span&gt; Code Review&lt;/h2&gt;
&lt;p&gt;Here is the full code written in this tutorial alongside with comments to help you identify each part:&lt;/p&gt;
&lt;pre class="brush: plain; title: ;"&gt;
-- Balloons Physics Game
-- Developed by Carlos Yanez

-- Hide Status Bar

display.setStatusBar(display.HiddenStatusBar)

-- Physics

local physics = require('physics')
physics.start()

-- Graphics

-- [Background]

local bg = display.newImage('gameBg.png')

-- [Title View]

local titleBg
local playBtn
local creditsBtn
local titleView

-- [Credits]

local creditsView

-- [Game View]

local gCircle
local squirrel
local infoBar
local restartBtn

-- [TextFields]

local scoreTF
local targetTF
local acornsTF

-- Load Sound

local pop = audio.loadSound('pop.mp3')

-- Variables

local titleView
local credits
local world
local acorns = display.newGroup()
local contacts
local balloons = {}
local impulse = 0
local dir = 3
&lt;/pre&gt;
&lt;hr/&gt;
&lt;h2&gt;&lt;span&gt;Next Time&amp;#8230;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;In this part of the series you&amp;#8217;ve learned about the interface and the basic setup of the game. Stay tuned for part two, where we will handle the logic of the application, buttons behavior, and more. See you next time!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_fjAl6ZxPiE-ugAf9nFzx_iWds0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_fjAl6ZxPiE-ugAf9nFzx_iWds0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_fjAl6ZxPiE-ugAf9nFzx_iWds0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_fjAl6ZxPiE-ugAf9nFzx_iWds0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-bloons-like-game/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iOS SDK: UIView Animations</title>
		<link>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_uiview-animations/</link>
		<comments>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_uiview-animations/#comments</comments>
		<pubDate>Mon, 14 May 2012 18:30:10 +0000</pubDate>
		<dc:creator>C.A. Beninati</dc:creator>
				<category><![CDATA[iOS SDK]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10706</guid>
		<description>&lt;p&gt;This iOS Quick Tip will teach you how to easily animate objects with UIKit. Whether you need sliding menus or flying monkeys, it&amp;#8217;s easy to get it done, and this tip will show you how!&lt;br /&gt;
&lt;!--more--&gt;&lt;br /&gt;
Animation in mobile applications can be a very important feature.  From a practical, UX standpoint, it can let the user know that something has been changed or moved.  From a more entertaining standpoint, it can move game sprites or tile maps around the screen, pulling the user into a fully interactive experience.&lt;/p&gt;
&lt;p&gt;Fortunately, it&amp;#8217;s very easy to get UIView objects moving around in your iOS apps, and you don&amp;#8217;t even have to worry about calculating cryptic geometric equations or other such voodoo!  &lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;UIView Background&lt;/h2&gt;
&lt;p&gt;Before we get into the actual animation, we need to be familiar with the basic animation properties of UIView objects. The following is a list of all such properties as of iOS 5.1:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;center (position on screen)&lt;/li&gt;
&lt;li&gt;frame (position on screen, size, stretching…)&lt;/li&gt;
&lt;li&gt;bounds (size, stretching)&lt;/li&gt;
&lt;li&gt;alpha (transparency)&lt;/li&gt;
&lt;li&gt;transform (rotation, scaling, basically any changes to the UIView)&lt;/li&gt;
&lt;li&gt;backgroundColor&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We don&amp;#8217;t have enough space in this quick tip to go over all of these properties, but we will look at a few of the most common ones: center, alpha, and transform.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Moving UIViews&lt;/h2&gt;
&lt;pre class="brush: objc; title: ;"&gt;
[UIView animateWithDuration:(NSTimeInterval) animations:^(void)animations]
&lt;/pre&gt;
&lt;p&gt;In its most basic form, the above is all you need to animate a UIView.  It’s pretty straightforward- pass a duration (how long the animation will last), and then the properties to be animated (the values that you want the UIView’s properties to have at the end of the animation).&lt;/p&gt;
&lt;p&gt;For a quick example, if we have a UIView called “theView”, and we want to make it fade away until it’s invisible within a .5 second duration, we would call:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
[UIView animateWithDuration:0.5f
                            animations:^{
		                    [theView setAlpha:0.0f];
                            }
];
&lt;/pre&gt;
&lt;p&gt;And we’re done! The duration of the animation is set by the &lt;code&gt;animateWithDuration:&lt;/code&gt; parameter, and an Objective-C block of specific animation actions is supplied to the &lt;code&gt;animations:&lt;/code&gt; parameter. It’s just that easy!&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Post-Animation Actions&lt;/h2&gt;
&lt;p&gt;Often, we’ll want to do something after the animation finishes.  We’ll take a game for example. Let’s say we want to show a player that they’ve successfully completed an action.  We’ll do this by making a star fly up into the left corner of the screen, and then a point will be added to their score.  There are two things we’ll want to do once the star is finished flying:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Remove the star from the screen (we only want one star visible per point).&lt;/li&gt;
&lt;li&gt;Add a point to the score.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To do this, we’ll call our animation method with a completion block, like this:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
[UIView animateWithDuration:(NSTimeInterval)
                            animations:^(void)animations
                           completion:^(BOOL finished)completion
];
&lt;/pre&gt;
&lt;p&gt;For example, if we have a UIImageView (i.e. a subclass of UIView) called “starImageView”, with an image of a star, and some numeric variable called “points”, we would call:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
[UIView animateWithDuration:0.7f
                animations:^
                {
                        [starView setCenter:CGPointMake(0, 0)];
                }
                completion:^(BOOL finished)
                {
                        [starView removeFromSuperView];
                        points++;
                }
];
&lt;/pre&gt;
&lt;p&gt;It&amp;#8217;s worth noting that we’ll need to re-add our “starView” as a subview of our UIView if we want to run this animation again.  You can see this in the sample code provided as an attachment to this Mobiletuts+ tutorial.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Going Beyond&lt;/h2&gt;
&lt;p&gt;Finally, there is a method that will let us define even greater detail on our animation process, including a delay before the animation runs, and setting the type of &amp;#8220;easing&amp;#8221; for our animation.  These &amp;#8220;easing&amp;#8221; types can be found (and described) in the UIView.h header file as enums:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
typedef enum {
    UIViewAnimationCurveEaseInOut,         // slow at beginning and end
    UIViewAnimationCurveEaseIn,            // slow at beginning
    UIViewAnimationCurveEaseOut,           // slow at end
    UIViewAnimationCurveLinear
} UIViewAnimationCurve;
&lt;/pre&gt;
&lt;p&gt;I would encourage you to play around with those, by putting them into the &amp;#8220;options&amp;#8221; parameter of the following animation method:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
[UIView animateWithDuration:(NSTimeInterval) delay:(NSTimeInterval) options:(UIViewAnimationOptions)animations:^(void)animations completion:^(BOOL finished)completion];
&lt;/pre&gt;
&lt;p&gt;And once again, using our previous examples combined, we’ll delay our animation by 0.1 seconds, then begin moving it (slowly at first, then speeding up, and then going slowly again at the end).  Also, while we’re moving our image, we’ll fade it out to 0% opacity. Finally, after our animation finishes, we’ll add a point to our score, and remove the image from our UIView.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
[UIView animateWithDuration:0.6f
            delay:0.1f
            options:UIViewAnimationCurveEaseInOut
            animations:^{
          	        [starView setCenter:CGPointMake(0, 0)];
           	        [starView setAlpha:0.0f];
            }
            completion:^(BOOL finished){
                        [starView removeFromSuperview];
                        points++;
            }
];
&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;As you can see, it’s super easy to get your UIViews animated, so take some time to play around with the different animatable UIView properties, and see what new things you can discover!&lt;/p&gt;
&lt;p&gt;For extra practice, use the following command to rotate your image:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
[starView setTransform:CGAffineTransformRotate(starView.transform, 90.0f)];
&lt;/pre&gt;
&lt;p&gt;Now, see what other things are possible with animations for UIViews!  And remember, there are several subclasses of UIView that can be animated with these same methods and properties, such as (but not limited to):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;UIButton&lt;/li&gt;
&lt;li&gt;UIImageView&lt;/li&gt;
&lt;li&gt;UIButton&lt;/li&gt;
&lt;li&gt;UILabel&lt;/li&gt;
&lt;li&gt;UITableView&lt;/li&gt;
&lt;li&gt;UIScrollView&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2&gt;Resources&lt;/h2&gt;
&lt;p&gt;The star image used in this tutorial was released with a GNU/GPL license from &lt;a href="http://findicons.com/icon/169724/keditbookmarks?id=393835"&gt;FindIcons&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ud6LWrDFn94ngeWN4-V-4vrtqlI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ud6LWrDFn94ngeWN4-V-4vrtqlI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ud6LWrDFn94ngeWN4-V-4vrtqlI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ud6LWrDFn94ngeWN4-V-4vrtqlI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_uiview-animations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working With CorePlot – Tuts+ Premium</title>
		<link>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-3/</link>
		<comments>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-3/#comments</comments>
		<pubDate>Sat, 12 May 2012 02:20:47 +0000</pubDate>
		<dc:creator>Aron Bury</dc:creator>
				<category><![CDATA[iOS SDK]]></category>
		<category><![CDATA[CorePlot]]></category>
		<category><![CDATA[Premium]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10702</guid>
		<description>&lt;p&gt;When working with data intensive applications, a developer must often do more than just show lists of data records in a table view. The CorePlot library will allow you to add stunning data visualizations to your applications. Find out how in this Tuts+ Premium series!&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Tutorial Teaser&lt;/h2&gt;
&lt;p&gt;Today we will look at how to make the graph more useful to the user by specifying axis increments and how to format the increment labels. We&amp;#8217;re going to look at different ways we can customize the look and feel of the graph. Finally, we&amp;#8217;re going to discuss how to work with different plots on a single graph. Let&amp;#8217;s get started!&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;Step 1: Setting Axis Increments&lt;/h3&gt;
&lt;p&gt;To modify the properties of an X and Y axis we work with the &amp;#8216;CPTXYAxisSet&amp;#8217; and &amp;#8216;CPTXAxis&amp;#8217; objects. Open the STLineGraphViewController.m file and go to the viewDidLoad method. Just below where we work with the plot Space enter the following code:&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
[[graph plotAreaFrame] setPaddingLeft:20.0f];
[[graph plotAreaFrame] setPaddingTop:10.0f];
[[graph plotAreaFrame] setPaddingBottom:20.0f];
[[graph plotAreaFrame] setPaddingRight:10.0f];
[[graph plotAreaFrame] setBorderLineStyle:nil];

NSNumberFormatter *axisFormatter = [[NSNumberFormatter alloc] init];
[axisFormatter setMinimumIntegerDigits:1];
[axisFormatter setMaximumFractionDigits:0];

CPTMutableTextStyle *textStyle = [CPTMutableTextStyle textStyle];
[textStyle setFontSize:12.0f];

CPTXYAxisSet *axisSet = (CPTXYAxisSet *)[graph axisSet];

CPTXYAxis *xAxis = [axisSet xAxis];
[xAxis setMajorIntervalLength:CPTDecimalFromInt(1)];
[xAxis setMinorTickLineStyle:nil];
[xAxis setLabelingPolicy:CPTAxisLabelingPolicyFixedInterval];
[xAxis setLabelTextStyle:textStyle];
[xAxis setLabelFormatter:axisFormatter];

CPTXYAxis *yAxis = [axisSet yAxis];
[yAxis setMajorIntervalLength:CPTDecimalFromInt(1)];
[yAxis setMinorTickLineStyle:nil];
[yAxis setLabelingPolicy:CPTAxisLabelingPolicyFixedInterval];
[yAxis setLabelTextStyle:textStyle];
[yAxis setLabelFormatter:axisFormatter];
&lt;/pre&gt;
&lt;p&gt;Let&amp;#8217;s go over everything above. First, we are working with a property of the graph called the &amp;#8216;plotAreaFrame&amp;#8217;. With this we are able to set the padding of the area where the graph is actually drawn and it allows us to see the axis labels (which were previously hidden). We then set the Border line style to nil to get rid of the border around the graph.&lt;/p&gt;
&lt;p&gt;We then create an NSNumber formatter which we use to format the axis labels. We also create something called a &amp;#8216;CPTMutableTextStyle&amp;#8217;. When formatting lines, fill section and text for CorePlot objects we use objects such as CPTMutableTextStyle to do it. For now we only set the font size but we can set the font type and color as well.&lt;/p&gt;
&lt;p&gt;We then get a CPTXYAxisSet object from our graph. This axisSet contains an xAxis and a yAxis (both objects of type &amp;#8216;CPTXYAxis&amp;#8217;). We then set a variety of properties on each axis. The major interval length sets what the interval at each main tick will be. We also want to get rid of the minor ticks so we set the line style to nil. We set the labellingPolicy to fixed intervals. We then set the text style for the CPTMutableTextStyle object we created earlier and the label formatter to the NSNumberFormatter we created.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://tutsplus.s3.amazonaws.com/tutspremium/mobile-dev/iOS-SDK_CorePlot/3/graphView.png" title="graph view" /&gt;
&lt;/div&gt;
&lt;p&gt;Now try going to the student view and adding a student. Afterward you can go back to the graph and you should see it change. However, it still looks a bit bland&amp;#8230;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Get the Full Series!&lt;/h2&gt;
&lt;p&gt;This tutorial series is available to &lt;a href="http://tutsplus.com/"&gt;Tuts+ Premium members only&lt;/a&gt;. Read a &lt;a href="http://tutsplus.com/tutorial/working-with-coreplot-styling-and-adding-plots/"&gt;preview of this tutorial&lt;/a&gt; on the Tuts+ Premium web site or &lt;a href="http://tutsplus.com/amember/login.php"&gt;login&lt;/a&gt; to Tuts+ Premium to access the full content. &lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Joining Tuts+ Premium. . .&lt;/h2&gt;
&lt;p&gt;For those unfamiliar, the family of &lt;a href="http://tutsplus.com"&gt;Tuts+&lt;/a&gt; sites runs a premium membership service called Tuts+ Premium. For $19 per month, you gain access to exclusive premium tutorials, screencasts, and freebies from &lt;a href="http://mobile.tutsplus.com"&gt;Mobiletuts+&lt;/a&gt;, &lt;a href="http://net.tutsplus.com"&gt;Nettuts+&lt;/a&gt;, &lt;a href="http://ae.tutsplus.com"&gt;Aetuts+&lt;/a&gt;, &lt;a href="http://audio.tutsplus.com"&gt;Audiotuts+&lt;/a&gt;, &lt;a href="http://vector.tutsplus.com"&gt;Vectortuts+&lt;/a&gt;, and &lt;a href="http://cg.tutsplus.com"&gt;CgTuts+&lt;/a&gt;. You&amp;#8217;ll learn from some of the best minds in the business. &lt;a href="http://tutsplus.com/mobile-premium/"&gt;Become a premium member&lt;/a&gt; to access this tutorial, as well as hundreds of other advanced tutorials and screencasts.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/21DmwOh_jvTH6wGUeuP7KponDH8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/21DmwOh_jvTH6wGUeuP7KponDH8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/21DmwOh_jvTH6wGUeuP7KponDH8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/21DmwOh_jvTH6wGUeuP7KponDH8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/iphone/working-with-coreplot-tuts-premium-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective-C Categories</title>
		<link>http://mobile.tutsplus.com/tutorials/iphone/objective-c-categories/</link>
		<comments>http://mobile.tutsplus.com/tutorials/iphone/objective-c-categories/#comments</comments>
		<pubDate>Thu, 10 May 2012 14:24:41 +0000</pubDate>
		<dc:creator>Aaron Crabtree</dc:creator>
				<category><![CDATA[iOS SDK]]></category>
		<category><![CDATA[Categories]]></category>
		<category><![CDATA[Objective-C]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10648</guid>
		<description>&lt;p&gt;Categories provide the ability to add functionality to an object without subclassing or changing the actual object. A handy tool, they are often used to add methods to existing classes, such as &lt;code&gt;NSString&lt;/code&gt; or your own custom objects.&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 1: Set Up Your Project&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;Launch Xcode and click File &amp;gt; New &amp;gt; Project. Choose an iOS Single View Application from the window and click &amp;quot;Next.&amp;quot; Name your product &amp;quot;Categories&amp;quot; and enter a name for your Company Identifier, such as &amp;quot;com.companyName.categories.&amp;quot; Choose the iPhone device family and click &amp;quot;Next.&amp;quot; Choose a location to store your project and click &amp;quot;Create.&amp;quot;&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
&lt;img src="https://d339vfjsz5zott.cloudfront.net/Objective-C_Categories/Objective-C_Categories_01.png" /&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 2: Create the Category&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;Now that your project is set up, let&amp;#39;s create a category that adds additional functionality to the &lt;code&gt;NSString&lt;/code&gt; class. Click File &amp;gt; New &amp;gt; File and choose a Cocoa Touch Objective-C category from the window. Click &amp;quot;Next.&amp;quot; Name your category &amp;quot;RemoveNums&amp;quot; and select &lt;code&gt;NSString&lt;/code&gt; from the &amp;quot;Category on&amp;quot; drop down menu (you may need to type this in manually). Click &amp;quot;Next&amp;quot; followed by &amp;quot;Create.&amp;quot; &lt;/p&gt;
&lt;div class="tutorial_image"&gt;
&lt;img src="https://d339vfjsz5zott.cloudfront.net/Objective-C_Categories/Objective-C_Categories_02.png" /&gt;
&lt;/div&gt;
&lt;h3&gt;
Declare the Category Method&lt;br /&gt;
&lt;/h3&gt;
&lt;p&gt;Back in your Xcode project, click &amp;quot;NSString+RemoveNums.h&amp;quot; to view the new category&amp;#39;s header file. Add the following code to the interface to declare the method.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
@interface NSString (RemoveNums)
- (NSString *)removeNumbersFromString:(NSString *)string;
@end
&lt;/pre&gt;
&lt;h3&gt;
Implement the Category Method&lt;br /&gt;
&lt;/h3&gt;
&lt;p&gt;Click &amp;quot;NSString+RemoveNums.m&amp;quot; to view the category&amp;#39;s implementation file. Add the following code to create a method that will remove all the numbers from an &lt;code&gt;NSString&lt;/code&gt;. First we define an &lt;code&gt;NSCharacterSet&lt;/code&gt; of the numbers zero through nine which we&amp;#39;ll use as a reference to compare against the original input string. In this case, the original string &amp;quot;ABC 123&amp;quot; will have the numbers &amp;quot;123&amp;quot; removed from the string because the category method uses the &lt;code&gt;NSString&lt;/code&gt; method &lt;code&gt;stringByTrimmingCharactersInSet:&lt;/code&gt;.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
- (NSString *)removeNumbersFromString:(NSString *)string
{
    NSString *trimmedString = nil;
    NSCharacterSet *numbersSet = [NSCharacterSet characterSetWithCharactersInString:@&amp;quot;0123456789&amp;quot;];
    trimmedString = [string stringByTrimmingCharactersInSet:numbersSet];
    return trimmedString;
}
&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 3: Import the Category&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;Click &amp;quot;ViewController.h&amp;quot; and import the category by adding the following code.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
#import &amp;quot;NSString+RemoveNums.h&amp;quot;
&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 4: Test the Category&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;Click &amp;quot;ViewController.m&amp;quot; and add the following code to the &lt;code&gt;viewDidLoad&lt;/code&gt; method. The local variable &lt;code&gt;stringWithNums&lt;/code&gt; contains a combination of letters and numbers. The next line takes the string variable and runs it through the category method &lt;code&gt;removeNumbersFromString&lt;/code&gt;. Finally, &lt;code&gt;NSLog&lt;/code&gt; outputs the returned value of the newly trimmed string without any numbers.&lt;/p&gt;
&lt;pre class="brush: objc; title: ;"&gt;
NSString *stringWithNums = @&amp;quot;ABC 123&amp;quot;;
NSLog(@&amp;quot;stringWithNums         --&amp;gt; %@&amp;quot;,stringWithNums);
stringWithNums = [stringWithNums removeNumbersFromString:stringWithNums];
NSLog(@&amp;quot;trimmed stringWithNums --&amp;gt; %@&amp;quot;,stringWithNums);
&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;
Step 5: Use the Category Method&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;Click Product &amp;gt; Run, or click the &amp;quot;Run&amp;quot; arrow in the top left corner, to test the code. Notice the console shows the original input string, &amp;quot;ABC 123,&amp;quot; as well as the string after it has been altered by the category method and the numbers have been removed.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
 &lt;img src="https://d339vfjsz5zott.cloudfront.net/Objective-C_Categories/Objective-C_Categories_03.png" /&gt;
 &lt;/div&gt;
&lt;h2&gt;
Conclusion&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;Subclassing is one way to add functionality to an object, but avoiding unnecessary subclassing by using a category will help reduce the amount of code and keep your projects more organized. There are a number of scenarios where using a category is beneficial. Share your category scenarios in the comments below. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jCPNdLwqeFnLjbER4uX5al74jGo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jCPNdLwqeFnLjbER4uX5al74jGo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jCPNdLwqeFnLjbER4uX5al74jGo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jCPNdLwqeFnLjbER4uX5al74jGo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/iphone/objective-c-categories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Which Tuts+ Site Should We Launch Next?</title>
		<link>http://mobile.tutsplus.com/articles/news/which-tuts-site-should-we-launch-next/</link>
		<comments>http://mobile.tutsplus.com/articles/news/which-tuts-site-should-we-launch-next/#comments</comments>
		<pubDate>Thu, 10 May 2012 11:30:57 +0000</pubDate>
		<dc:creator>David Appleyard</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[launch]]></category>
		<category><![CDATA[Poll]]></category>
		<category><![CDATA[tuts]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10667</guid>
		<description>&lt;p&gt;We&amp;#8217;re planning our next few Tuts+ sites, and would love your opinion and advice on which topics you think we should cover next! We&amp;#8217;d be really grateful if you could take a minute to answer our quick poll and share your thoughts&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;!--more--&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Have Your Say&lt;/h2&gt;
&lt;div style="float:right; margin:0 0 0 20px;"&gt;&lt;script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/6211918.js"&gt;&lt;/script&gt;&lt;br /&gt;
&lt;noscript&gt;&lt;a href="http://polldaddy.com/poll/6211918/"&gt;Mobiletuts+ Readers: Which Tuts+ Site Should We Launch Next?&lt;/a&gt;&lt;/noscript&gt;&lt;/div&gt;
&lt;p&gt;We&amp;#8217;ve been considering lots of different ideas for our next Tuts+ sites over the past few weeks, and wanted to also ask the opinion of our awesome community!&lt;/p&gt;
&lt;p&gt;A selection of different concepts are included in the poll to the right, along with the option for you to submit your own ideas as well.&lt;/p&gt;
&lt;p&gt;The important thing to note is that these are just ideas. Some of these are close to making our final cut, and others aren&amp;#8217;t&amp;#8230; We&amp;#8217;d love to hear what you think, to help guide our decision.&lt;/p&gt;
&lt;p&gt;Thanks for taking the time to offer your suggestion — I can&amp;#8217;t wait to see what you have to say!&lt;/p&gt;
&lt;h3&gt;Win a 6-Month Tuts+ Premium Membership&lt;/h3&gt;
&lt;p&gt;Our poll will be running for the next couple of weeks, and we&amp;#8217;ll be choosing one respondent at random to receive a six-month Tuts+ Premium membership!&lt;/p&gt;
&lt;p&gt;To be entered into the giveaway, just leave a comment on this post to go into a bit more detail about your site suggestion. We&amp;#8217;ll choose one comment at random to win the Tuts+ Premium membership when the poll ends.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Best of luck!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iGKP5MhZrdyzXz3yEK0KstE2NE0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iGKP5MhZrdyzXz3yEK0KstE2NE0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iGKP5MhZrdyzXz3yEK0KstE2NE0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iGKP5MhZrdyzXz3yEK0KstE2NE0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/articles/news/which-tuts-site-should-we-launch-next/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Analyzing Android Network Traffic</title>
		<link>http://mobile.tutsplus.com/tutorials/android/analyzing-android-network-traffic/</link>
		<comments>http://mobile.tutsplus.com/tutorials/android/analyzing-android-network-traffic/#comments</comments>
		<pubDate>Wed, 09 May 2012 13:54:02 +0000</pubDate>
		<dc:creator>Maria Garcia Cerdeno</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Android SDK]]></category>
		<category><![CDATA[Wireshark]]></category>
		<guid isPermaLink="false">http://mobile.tutsplus.com/?p=10663</guid>
		<description>&lt;p&gt;Network traffic analysis can be a vital part of the software debugging and testing process. This tutorial will teach you how to monitor all incoming and outgoing traffic on an Android device in order to better debug your applications!&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;
&lt;p&gt;As a developer, one often has to build software that performs HTTP requests, sends messages, or grabs information from incoming or outgoing requests over the network.  When these network transactions work from the very beginning, all is good; we are receiving exactly what is expected and what we are sending is proper formatted and with the correct values.&lt;/p&gt;
&lt;p&gt;However, this frequently does not happen, and one needs to understand exactly what is being sent and received over the network in order to determine what has gone wrong. Who knows, maybe the request is not even being made and we are not aware of it! This is a circumstance in which  knowing how to capture and analyze the network traffic becomes crucial.&lt;/p&gt;
&lt;p&gt;Capturing network traffic for later analysis is good, but it&amp;#8217;s even better if we are able to perform this analysis at the same time the capture is taking place.  By doing so, one can know which request or response corresponds to each use case, thus making the analysis much easier.  In the following steps, I will show you how to capture real time traffic from an Android device and pipe it to a network analyzer like &lt;a href="http://www.wireshark.org"&gt;Wireshark&lt;/a&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 1:&lt;/span&gt; Installing &lt;i&gt;tcpdump&lt;/i&gt;&lt;/h2&gt;
&lt;p&gt;The first step is to install &lt;i&gt;tcpdump&lt;/i&gt; on the device.  &lt;i&gt;tcpdump&lt;/i&gt; is a command-line utility that captures the traffic on a particular network device and dumps it to the filesystem.  &lt;i&gt;tcpdump&lt;/i&gt; can be downloaded from &lt;a href="http://www.tcpdump.org"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once the &lt;i&gt;tcpdump&lt;/i&gt; binary has been downloaded, all we need to do is use adb to push the file onto the device.  To be able to do so, your handset needs to be connected to and properly identified by your computer.&lt;/p&gt;
&lt;p&gt;First things first, it is important that you update your path adding Android&amp;#8217;s SDK platform-tools directory to it if you haven&amp;#8217;t yet.  In case you have never done it, there are clear instructions on how to do so on the &lt;a href="http://developer.android.com/sdk/installing.html"&gt;android developers page&lt;/a&gt;.  Ready? Open a terminal and type the following:&lt;/p&gt;
&lt;pre class="brush: bash; title: ;"&gt;
adb devices
&lt;/pre&gt;
&lt;p&gt;The connected device should show up in a list.  If this is not the case, make sure that it is correctly connected and that you have all the drivers needed for that specific handset.&lt;/p&gt;
&lt;p&gt;See the device on the list? Great! We are now ready to push the &lt;i&gt;tcpdump&lt;/i&gt; file onto it:&lt;/p&gt;
&lt;pre class="brush: bash; title: ;"&gt;
adb push /home/tcpdump /data/local
&lt;/pre&gt;
&lt;p&gt;To perform the next few steps we need to gain root privileges on the device and make sure that &lt;i&gt;tcpdump&lt;/i&gt; is executable:&lt;/p&gt;
&lt;pre class="brush: bash; title: ;"&gt;
adb shell
cd data/local
su
chmod 777 tcpdump
&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 2:&lt;/span&gt; Saving the Traffic Dump to File&lt;/h2&gt;
&lt;p&gt;Tcpdump can now be started from the same adb shell and the output saved to a file:&lt;/p&gt;
&lt;pre class="brush: bash; title: ;"&gt;
./tcpdump -s 0 -v -w out.pcap
&lt;/pre&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Android-SDK_Wireshark_Traffic-Analysis/tcpdump_to_file.png" /&gt;
&lt;/div&gt;
&lt;p&gt;The complete list of tcpdump options can be found in the man page of &lt;a href="http://www.tcpdump.org/tcpdump_man.html"&gt;&lt;i&gt;tcpdump&lt;/i&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once the dump is completed, we can stop capturing the data.  In order to do so, you simply need to press Ctrl+C.  The resulting file can be pulled out of the device and saved locally, so that it can get analyzed using &lt;i&gt;Wireshark&lt;/i&gt;.&lt;/p&gt;
&lt;pre class="brush: bash; title: ;"&gt;
adb pull /data/local/out.pcap /home/out.pcap
&lt;/pre&gt;
&lt;p&gt;But this is not exactly what we wanted, is it? What we want is to be able to pipe it to &lt;i&gt;Wireshark&lt;/i&gt; in real time! Relax, we are getting there.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 3:&lt;/span&gt; Piping Network Traffic to a Port&lt;/h2&gt;
&lt;p&gt;The process of capturing the network packets is basically the same in this case.  However, instead of writing the datagrams to a file, we want to write them to the standard output, so that we can then redirect them using &lt;a href="http://netcat.sourceforge.net"&gt;&lt;i&gt;netcat&lt;/i&gt;&lt;/a&gt; to a specific port on the handset.&lt;/p&gt;
&lt;p&gt;In order to do so, the tcpdump command has to change slightly:&lt;/p&gt;
&lt;pre class="brush: bash; title: ;"&gt;
adb shell &amp;quot;./data/local/tcpdump -n -s 0 -w - | nc -l -p 12345&amp;quot;
&lt;/pre&gt;
&lt;p&gt;The traffic is now being redirected to the port 12345 in the handset.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 4:&lt;/span&gt; Installing Netcat&lt;/h2&gt;
&lt;p&gt;Before going any further, lets make sure that you have &lt;i&gt;netcat&lt;/i&gt; installed, as we are going to need it.  Type nc in a new console, hit enter and look at what happens.  Do you get the standard message explaining how to use the command? Awesome, you are good to go.  Skip the rest of this section and keep going!&lt;/p&gt;
&lt;p&gt;Still reading? Well, I guess that means you do not have &lt;i&gt;netcat&lt;/i&gt; installed after all.  Do not panic, you can download it from &lt;a href="http://www.securityfocus.com/tools/139"&gt;here&lt;/a&gt; for Windows.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 5:&lt;/span&gt; Piping Traffic to &lt;i&gt;Wireshark&lt;/i&gt;&lt;/h2&gt;
&lt;p&gt;Remember what we mentioned earlier regarding updating the path so that &lt;i&gt;adb&lt;/i&gt; would be available? You want to do that with &lt;i&gt;netcat&lt;/i&gt; and &lt;i&gt;Wireshark&lt;/i&gt; as well.&lt;/p&gt;
&lt;p&gt;Once this is done, we can use &lt;i&gt;adb&lt;/i&gt;&amp;#8216;s forward option, which will forward the packets from the tcp port 12345 in the device to the tcp port 54321 on the PC.  We will again use netcat to grab those incoming packets coming in through port 54321, and pipe them to &lt;i&gt;Wireshark&lt;/i&gt;.&lt;/p&gt;
&lt;p&gt;This is done in the following command, typed in a new console:&lt;/p&gt;
&lt;pre class="brush: bash; title: ;"&gt;
adb forward tcp:12345 tcp:54321 &amp;amp;&amp;amp; nc 127.0.0.1 54321 | wireshark -k -S -i -
&lt;/pre&gt;
&lt;p&gt;Note that the number of the port chosen is irrelevant.  The only reason why different numbers have been chosen is to show how the different commands connect to each other.  The same port number could have been used for both commands (or different numbers from the above, as long as the ports are not being used!) and then they would work just the same.&lt;/p&gt;
&lt;div class="tutorial_image"&gt;
&lt;img src="https://d339vfjsz5zott.cloudfront.net/Android-SDK_Wireshark_Traffic-Analysis/piping_two_terminals_scaled.png"/&gt;
&lt;/div&gt;
&lt;p&gt;You need to make sure that &lt;i&gt;Wireshark&lt;/i&gt; runs with the correct permissions.  Otherwise, even when &lt;i&gt;Wireshark&lt;/i&gt; gets opened, a popup will show up informing you of an exception.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;&lt;span&gt;Step 6:&lt;/span&gt; Making Life Easier&lt;/h2&gt;
&lt;p&gt;Once the different utilities have been set up, the process of capturing the network traffic and piping it into &lt;i&gt;Wireshark&lt;/i&gt; is done through two commands, simultaneously running in two different terminals:&lt;/p&gt;
&lt;pre class="brush: bash; title: ;"&gt;
adb shell &amp;quot;./data/local/tcpdump -n -s 0 -w - | nc -l -p 12345&amp;quot;
adb forward tcp:12345 tcp:54321 &amp;amp;&amp;amp; nc 127.0.0.1 54321 | wireshark -k -S -i -
&lt;/pre&gt;
&lt;p&gt;Now, this process is still pretty manual.  One has to manually open two terminals and type all those instructions, making sure nothing is left behind for this to work.  This is a nuisance.  Well, that problem is easily solved by putting these instructions onto a script, so that it does all the work for us.&lt;/p&gt;
&lt;p&gt;Windows users can automate the process using the script in the download file attached to this post.&lt;/p&gt;
&lt;pre class="brush: bash; title: ;"&gt;
start adb shell &amp;quot;./data/local/tcpdump -n -s 0 -w - | nc -l -p 12345&amp;quot;
adb forward tcp:12345 tcp:54321 &amp;amp;&amp;amp; nc 127.0.0.1 54321 | wireshark -k -S -i -
&lt;/pre&gt;
&lt;div class="tutorial_image"&gt;
    &lt;img src="https://d339vfjsz5zott.cloudfront.net/Android-SDK_Wireshark_Traffic-Analysis/piping_one_terminal_scaled.png"/&gt;
    &lt;/div&gt;
&lt;hr /&gt;
&lt;h2&gt;Notes for Mac Users&lt;/h2&gt;
&lt;p&gt;If you&amp;#8217;ve been following this tutorial on a Mac, you are probably scratching your head, thinking why the above process does not really seem to be working for you.  There are a couple of reasons why this might be the case.  Let&amp;#8217;s try to fix that.&lt;/p&gt;
&lt;p&gt;First of all, make sure that you are using the right path of &lt;i&gt;Wireshark&lt;/i&gt;! This might seem trivial, but is is not.  You do not want to use the path to the app, but the whole path to the actual &lt;i&gt;Wireshark&lt;/i&gt; executable (e.g. &amp;#8220;/Applications/Wireshark.app/Contents/Resources/bin/wireshark&amp;#8221;).&lt;/p&gt;
&lt;p&gt;Fixed? Good! Just a couple more things to go.  When invoking &lt;i&gt;Wireshark&lt;/i&gt; through the command line, we are using a minus sign at the end.  This represents the standard input and in Windows it will work just fine.  However, this will not work on a Mac.  Luckily, this can be substituted with the name of a pipe.  You want to specify 2 (corresponding to lo0) as the pipe to use.  Besides, you might need to grant super user permissions in order to be able to execute &lt;i&gt;Wireshark&lt;/i&gt;.  This is the resulting command that you want to use:&lt;/p&gt;
&lt;pre class="brush: bash; title: ;"&gt;
adb forward tcp:12345 tcp:54321 &amp;amp;&amp;amp; nc 127.0.0.1 54321 | sudo wireshark -k -S -i 2
&lt;/pre&gt;
&lt;p&gt;This is the perl script that will work for Mac users (it is also attached as a download to this post):
&lt;pre class="brush: perl; title: ;"&gt;

#!/usr/bin/perl

# Perform adb command on shell
# to check if the device is attached
$netstat = `adb shell 'netstat' 2&amp;gt;&amp;amp;1`;
if($netstat =~ m/error: device not found/)
{
die(&amp;quot;Plug in your phone!\n&amp;quot;);
}

# Gain root priviledges
open(SUDO, &amp;quot;|sudo echo ''&amp;quot;);
close(SUDO);

# Redirect STDERR output to STDOUT
open STDERR, '&amp;gt;&amp;amp;STDOUT';

# Perform tcpdump and nc in background
open(COMMAND1, &amp;quot;(adb shell \&amp;quot;data/local/tcpdump -n -s 0 -w - | nc -l -p 12345\&amp;quot;) |&amp;quot;);

# Perform piping to wireshark
open(COMMAND2, &amp;quot;((adb forward tcp:12345 tcp:54321 &amp;amp;&amp;amp; nc 127.0.0.1 54321 | sudo wireshark -k -S -i 2) &amp;amp;) 2&amp;gt;&amp;amp;1 &amp;gt; /dev/null |&amp;quot;);

# Make sure the exit message appears after wireshark has been launched (hacky)
sleep(5);
print(&amp;quot;Press ctrl-c to exit...&amp;quot;);
&amp;lt;STDIN&amp;gt;;
&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/g1bmQ0NuHHvPhQjyQdA-_wk-OKY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/g1bmQ0NuHHvPhQjyQdA-_wk-OKY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/g1bmQ0NuHHvPhQjyQdA-_wk-OKY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/g1bmQ0NuHHvPhQjyQdA-_wk-OKY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<wfw:commentRss>http://mobile.tutsplus.com/tutorials/android/analyzing-android-network-traffic/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.669 seconds -->

