<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Consulenza-Web.com &#187; placeholder</title>
	<atom:link href="http://www.consulenza-web.com/tag/placeholder/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.consulenza-web.com</link>
	<description>Blog di Marco Pegoraro su Consulenza Web ed Informatica, Programmazione Web e realizzazione di Siti Web Accessibili.</description>
	<lastBuildDate>Mon, 30 Jan 2012 08:39:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Concatenare stringhe in Objective-C</title>
		<link>http://www.consulenza-web.com/2009/10/concatenare-stringhe-in-objective-c/</link>
		<comments>http://www.consulenza-web.com/2009/10/concatenare-stringhe-in-objective-c/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 17:10:26 +0000</pubDate>
		<dc:creator>peg</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[concatenazione]]></category>
		<category><![CDATA[formato]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[placeholder]]></category>
		<category><![CDATA[stringhe]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.consulenza-web.com/?p=136</guid>
		<description><![CDATA[Objective-C è sicuramente un linguaggio lungi dall&#8217;essere developer-friendly! Metodo Classico di Concatenazione // Definizione delle variabili iniziali: NSString *nome = @"Marco"; NSString *cognome = @"Pegoraro"; // Composizione della stringa concatenata: NSString *risultato = [nome stringByAppendingString @" "]; NSString *risultato = [risultato stringByAppendingString cognome]; Questo è il codice che Apple ci chiede di scrivere per creare [...]]]></description>
			<content:encoded><![CDATA[<p>Objective-C è sicuramente un linguaggio lungi dall&#8217;essere developer-friendly!</p>
<h2>Metodo Classico di Concatenazione</h2>
<pre>// Definizione delle variabili iniziali:
NSString *nome = @"Marco";
NSString *cognome = @"Pegoraro";

// Composizione della stringa concatenata:
NSString *risultato = [nome stringByAppendingString @" "];
NSString *risultato = [risultato stringByAppendingString cognome];</pre>
<p>Questo è il codice che Apple ci chiede di scrivere per creare una concatenazione con uno spazio in mezzo! Semplicemente incredibile da credere!!!</p>
<h2>Metodo della Stringa con Formato</h2>
<p>Un modo per tamponare questa incredibile mancanza di semplicità del linguaggio Objective-C è l&#8217;utilizzo del metodo stringWithFormat che consente di inserire una o più variabili all&#8217;interno di un modello contenente dei placeholder:</p>
<pre>// Definizione delle variabili iniziali:
NSString *nome = @"Marco";
NSString *cognome = @"Pegoraro";

// Composizione della stringa concatenata:
NSString *risultato = [NSString stringWithFormat:@"%@ %@", nome, cognome];</pre>
<p>Questa alternativa riduce leggermente la complessità del codice da scrivere il quale rimane però incredibilmente complicato e prolisso!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Segnala presso:</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.consulenza-web.com%2F2009%2F10%2Fconcatenare-stringhe-in-objective-c%2F&amp;title=Concatenare+stringhe+in+Objective-C" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.consulenza-web.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.consulenza-web.com%2F2009%2F10%2Fconcatenare-stringhe-in-objective-c%2F&amp;title=Concatenare+stringhe+in+Objective-C" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.consulenza-web.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.consulenza-web.com%2F2009%2F10%2Fconcatenare-stringhe-in-objective-c%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.consulenza-web.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.consulenza-web.com%2F2009%2F10%2Fconcatenare-stringhe-in-objective-c%2F&amp;title=Concatenare+stringhe+in+Objective-C" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.consulenza-web.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.consulenza-web.com%2F2009%2F10%2Fconcatenare-stringhe-in-objective-c%2F&amp;title=Concatenare+stringhe+in+Objective-C" rel="nofollow" title="Add to&nbsp;LinkedIn"><img class="social_img" src="http://www.consulenza-web.com/wp-content/plugins/social-bookmarks/images/linkedin.png" title="Add to&nbsp;LinkedIn" alt="Add to&nbsp;LinkedIn" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.consulenza-web.com%2F2009%2F10%2Fconcatenare-stringhe-in-objective-c%2F&amp;title=Concatenare+stringhe+in+Objective-C" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.consulenza-web.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.consulenza-web.com%2F2009%2F10%2Fconcatenare-stringhe-in-objective-c%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.consulenza-web.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Concatenare+stringhe+in+Objective-C+@+http%3A%2F%2Fwww.consulenza-web.com%2F2009%2F10%2Fconcatenare-stringhe-in-objective-c%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.consulenza-web.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.consulenza-web.com%2F2009%2F10%2Fconcatenare-stringhe-in-objective-c%2F&amp;t=Concatenare+stringhe+in+Objective-C" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.consulenza-web.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.consulenza-web.com/2009/10/concatenare-stringhe-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

