<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Validate User Input in UITextField, with Smarts to Properly Manage Copy and Paste</title>
	<atom:link href="http://MobileDeveloperTips.com/user-interface/validate-user-input-in-uitextfield-with-smarts-to-properly-manage-copy-and-paste.html/feed" rel="self" type="application/rss+xml" />
	<link>http://MobileDeveloperTips.com/user-interface/validate-user-input-in-uitextfield-with-smarts-to-properly-manage-copy-and-paste.html</link>
	<description>iOS and Objective-C Tips, Tricks and Tutorials.</description>
	<lastBuildDate>Tue, 22 May 2012 11:53:47 -0500</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Bruno</title>
		<link>http://MobileDeveloperTips.com/user-interface/validate-user-input-in-uitextfield-with-smarts-to-properly-manage-copy-and-paste.html#comment-67792</link>
		<dc:creator>Bruno</dc:creator>
		<pubDate>Wed, 29 Feb 2012 08:22:27 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5580#comment-67792</guid>
		<description>Thanks John, it helped me a lot !</description>
		<content:encoded><![CDATA[<p>Thanks John, it helped me a lot !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Marks</title>
		<link>http://MobileDeveloperTips.com/user-interface/validate-user-input-in-uitextfield-with-smarts-to-properly-manage-copy-and-paste.html#comment-25710</link>
		<dc:creator>Scott Marks</dc:creator>
		<pubDate>Tue, 14 Sep 2010 21:13:25 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5580#comment-25710</guid>
		<description>Nice not.  Two things --

First, the concatenation of two constant strings can be done at compile time without resort to stringByAppendingString:.  Just write them one after another, just like regular strings in C.

#define CHARACTERS_NUMBERS  CHARACTERS @&quot;1234567890&quot;

For extra tidiness, you could enclose the definition in parentheses, but as above you could concatenate yet more things onto CHARACTERS_NUMBERS.


Second, I have a problem with if ( something ) return NO; else return YES;  That is just simply
return !(something).  So in this case:

  return [[string componentsSeparatedByCharactersInSet:unacceptedInput] count] == 1;

This makes the condition being asserted even more clear.</description>
		<content:encoded><![CDATA[<p>Nice not.  Two things &#8211;</p>
<p>First, the concatenation of two constant strings can be done at compile time without resort to stringByAppendingString:.  Just write them one after another, just like regular strings in C.</p>
<p>#define CHARACTERS_NUMBERS  CHARACTERS @&#8221;1234567890&#8243;</p>
<p>For extra tidiness, you could enclose the definition in parentheses, but as above you could concatenate yet more things onto CHARACTERS_NUMBERS.</p>
<p>Second, I have a problem with if ( something ) return NO; else return YES;  That is just simply<br />
return !(something).  So in this case:</p>
<p>  return [[string componentsSeparatedByCharactersInSet:unacceptedInput] count] == 1;</p>
<p>This makes the condition being asserted even more clear.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Muchow</title>
		<link>http://MobileDeveloperTips.com/user-interface/validate-user-input-in-uitextfield-with-smarts-to-properly-manage-copy-and-paste.html#comment-10275</link>
		<dc:creator>John Muchow</dc:creator>
		<pubDate>Mon, 01 Mar 2010 16:52:19 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5580#comment-10275</guid>
		<description>Thanks Michelle, good catch, I&#039;ve updated the code example based on your tip.</description>
		<content:encoded><![CDATA[<p>Thanks Michelle, good catch, I&#8217;ve updated the code example based on your tip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michelle</title>
		<link>http://MobileDeveloperTips.com/user-interface/validate-user-input-in-uitextfield-with-smarts-to-properly-manage-copy-and-paste.html#comment-10272</link>
		<dc:creator>Michelle</dc:creator>
		<pubDate>Mon, 01 Mar 2010 15:54:06 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=5580#comment-10272</guid>
		<description>After this step: &quot;The result returned is an array of objects that have been divided by the invalid characters.&quot; -- why not just check       if ([array count &gt; 1) ?     If invalid characters are found, won&#039;t there be 2 or more objects in the array?</description>
		<content:encoded><![CDATA[<p>After this step: &#8220;The result returned is an array of objects that have been divided by the invalid characters.&#8221; &#8212; why not just check       if ([array count &gt; 1) ?     If invalid characters are found, won&#8217;t there be 2 or more objects in the array?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

