<?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>FlexiCoder Blog &#187; Core Data</title>
	<atom:link href="http://www.flexicoder.com/blog/index.php/tag/core-data/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexicoder.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 28 Jul 2010 15:11:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Validate email address on the iPhone</title>
		<link>http://www.flexicoder.com/blog/index.php/2010/03/validate-email-address-on-the-iphone/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2010/03/validate-email-address-on-the-iphone/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 11:03:55 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[Core Data]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=299</guid>
		<description><![CDATA[Here is some simple code that allows you to validate email addresses that have been entered by a user on an iPhone. It does use NSPredicate, which is only available on OS 3.0 and above;


	NSString *email = [newEmailAddress.text lowercaseString];
	NSString *emailRegEx =
    @"(?:[a-z0-9!#$%\\&#038;'*+/=?\\^_`{&#124;}~-]+(?:\\.[a-z0-9!#$%\\&#038;'*+/=?\\^_`{&#124;}"
    @"~-]+)*&#124;\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\"
    @"x7f]&#124;\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-"
   [...]]]></description>
			<content:encoded><![CDATA[<p>Here is some simple code that allows you to validate email addresses that have been entered by a user on an iPhone. It does use NSPredicate, which is only available on OS 3.0 and above;</p>
<p><code></p>
<pre class="brush:csharp">
	NSString *email = [newEmailAddress.text lowercaseString];
	NSString *emailRegEx =
    @"(?:[a-z0-9!#$%\\&#038;'*+/=?\\^_`{|}~-]+(?:\\.[a-z0-9!#$%\\&#038;'*+/=?\\^_`{|}"
    @"~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\"
    @"x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-"
    @"z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5"
    @"]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-"
    @"9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21"
    @"-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])";

	NSPredicate *regExPredicate =[NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegEx];
	BOOL myStringMatchesRegEx = [regExPredicate evaluateWithObject:email];
	if(!myStringMatchesRegEx){
		UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Correct Email" message:@"Please enter a valid email address" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
		[alert show];
		[alert release];
	}
</pre>
<p></code></p>
<p>The code is based on this <a href="http://cocoawithlove.com/2009/06/verifying-that-string-is-email-address.html">article</a> which describes this in a lot more detail.</p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2010/03/validate-email-address-on-the-iphone/&title=Validate+email+address+on+the+iPhone&text=Here+is+some+simple+code+that+allows+you+to+validate+email+addresses+that+have+been+entered+by+a+user+on+an+iPhone.+It+does+use+NSPredicate%2C+which+is+only+available+on+OS+3.0+and+above%3B+++%09NSString...&tags=a-z0-9" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2010/03/validate-email-address-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Core Data &#8211; Updated model</title>
		<link>http://www.flexicoder.com/blog/index.php/2009/11/core-data-updated-model/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2009/11/core-data-updated-model/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 10:35:49 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[Core Data]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=252</guid>
		<description><![CDATA[After creating a new version of your data model, and adding the relevant code to handle lightweight migration, to actually get your code to run ensure that you do a clean all targets otherwise you get merge model errors!
Social Bookmarking]]></description>
			<content:encoded><![CDATA[<p>After creating a new version of your data model, and adding the relevant code to handle lightweight migration, to actually get your code to run ensure that you do a clean all targets otherwise you get merge model errors!</p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2009/11/core-data-updated-model/&title=Core+Data+%26%238211%3B+Updated+model&text=After+creating+a+new+version+of+your+data+model%2C+and+adding+the+relevant+code+to+handle+lightweight+migration%2C+to+actually+get+your+code+to+run+ensure+that+you+do+a+clean+all+targets+otherwise+you...&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2009/11/core-data-updated-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Core Data &#8211; fetch a single entity</title>
		<link>http://www.flexicoder.com/blog/index.php/2009/09/core-data-fetch-a-single-entity/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2009/09/core-data-fetch-a-single-entity/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 10:45:53 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[Core Data]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=226</guid>
		<description><![CDATA[I&#8217;ve used the following code to retrieve an entity from Core Data, so that the result returns the entity object rather than a Dictionary


-(Target *) currentTargetInContext:(NSManagedObjectContext *)context {
	Target *match;

	NSFetchRequest *request = [[NSFetchRequest alloc] init];
	NSEntityDescription *entity = [NSEntityDescription entityForName: @"Target" inManagedObjectContext:context];
	[request setEntity:entity];

	[request setResultType:NSManagedObjectResultType];

	NSPredicate *predicate = [NSPredicate predicateWithFormat:@"Achieved == 0 "];
	[request setPredicate:predicate];

	NSError *error;
	NSArray *objects = [context executeFetchRequest:request [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve used the following code to retrieve an entity from Core Data, so that the result returns the entity object rather than a Dictionary<br />
<code></p>
<pre class="brush:c#;highlight:8'">
-(Target *) currentTargetInContext:(NSManagedObjectContext *)context {
	Target *match;

	NSFetchRequest *request = [[NSFetchRequest alloc] init];
	NSEntityDescription *entity = [NSEntityDescription entityForName: @"Target" inManagedObjectContext:context];
	[request setEntity:entity];

	[request setResultType:NSManagedObjectResultType];

	NSPredicate *predicate = [NSPredicate predicateWithFormat:@"Achieved == 0 "];
	[request setPredicate:predicate];

	NSError *error;
	NSArray *objects = [context executeFetchRequest:request error:&#038;error];
	match = nil;
	if (objects == nil)
	{
		// handle the error
	}
	else
	{
		if ([objects count] > 0)
		{
			match = (Target *)[objects objectAtIndex:0];
		}
	}

	[request release];

	return match;
}
</pre>
<p></code></p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2009/09/core-data-fetch-a-single-entity/&title=Core+Data+%26%238211%3B+fetch+a+single+entity&text=I%26%238217%3Bve+used+the+following+code+to+retrieve+an+entity+from+Core+Data%2C+so+that+the+result+returns+the+entity+object+rather+than+a+Dictionary+++-%28Target+%2A%29...&tags=request" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2009/09/core-data-fetch-a-single-entity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CoreData &#8211; SQLite Manager for Firefox</title>
		<link>http://www.flexicoder.com/blog/index.php/2009/08/coredata-sqlite-manager-for-firefox/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2009/08/coredata-sqlite-manager-for-firefox/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 16:25:20 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[Core Data]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=215</guid>
		<description><![CDATA[This Firefox add-on allows you to view the data you are running against while using the iPhone simulator. Your sqlite files can be found in the following folder
/Users/&#8221;user name&#8221;/Library/Application Support/iPhone Simulator/User/Applications/&#8221;application guid&#8221;/Documents

This is a great tool for view the data you&#8217;ve created within your apps, but I would suggest that is best to define your [...]]]></description>
			<content:encoded><![CDATA[<p>This Firefox <a href="https://addons.mozilla.org/en-US/firefox/addon/5817">add-on</a> allows you to view the data you are running against while using the iPhone simulator. Your sqlite files can be found in the following folder</p>
<p>/Users/&#8221;user name&#8221;/Library/Application Support/iPhone Simulator/User/Applications/&#8221;application guid&#8221;/Documents</p>
<p><img src="http://www.flexicoder.com/blog/wp-content/uploads/2009/08/SQLite-300x241.png" alt="SQLite Firefox add-on" title="SQLite Firefox add-on" width="300" height="241" class="alignnone size-medium wp-image-217" /></p>
<p>This is a great tool for view the data you&#8217;ve created within your apps, but I would suggest that is best to define your data model via <a href="http://www.flexicoder.com/blog/index.php/2009/08/create-objective-c-classes-from-core-data-model/">Xcode</a></p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2009/08/coredata-sqlite-manager-for-firefox/&title=CoreData+%26%238211%3B+SQLite+Manager+for+Firefox&text=This+Firefox+add-on+allows+you+to+view+the+data+you+are+running+against+while+using+the+iPhone+simulator.&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2009/08/coredata-sqlite-manager-for-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Model change causes iPhone Simulator to fail</title>
		<link>http://www.flexicoder.com/blog/index.php/2009/08/data-model-change-causes-iphone-simulator-to-fail/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2009/08/data-model-change-causes-iphone-simulator-to-fail/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 12:49:39 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[Core Data]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=198</guid>
		<description><![CDATA[When you alter your underlying data model the iPhone simulator will not be able to load your app as the cached version of the database doesn&#8217;t match the new one. The easiest way to resolve the problem is to run the simulator, click and hold your app and remove it like you would remove an [...]]]></description>
			<content:encoded><![CDATA[<p>When you alter your underlying data model the iPhone simulator will not be able to load your app as the cached version of the database doesn&#8217;t match the new one. The easiest way to resolve the problem is to run the simulator, click and hold your app and remove it like you would remove an app from your actual phone.</p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2009/08/data-model-change-causes-iphone-simulator-to-fail/&title=Data+Model+change+causes+iPhone+Simulator+to+fail&text=When+you+alter+your+underlying+data+model+the+iPhone+simulator+will+not+be+able+to+load+your+app+as+the+cached+version+of+the+database+doesn%26%238217%3Bt+match+the+new+one.&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2009/08/data-model-change-causes-iphone-simulator-to-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Objective-C classes from Core Data model</title>
		<link>http://www.flexicoder.com/blog/index.php/2009/08/create-objective-c-classes-from-core-data-model/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2009/08/create-objective-c-classes-from-core-data-model/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 09:24:57 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[Xcode]]></category>
		<category><![CDATA[Core Data]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=190</guid>
		<description><![CDATA[Once you&#8217;ve created your data model within Xcode, you may need to generate the classes so that you can use and reference them in your main project. To do this open the data model, select File/New File&#8230; from the Xcode menu system, this will display the following screen&#8230;


Choose your location and then select the entities [...]]]></description>
			<content:encoded><![CDATA[<p>Once you&#8217;ve created your data model within Xcode, you may need to generate the classes so that you can use and reference them in your main project. To do this open the data model, select File/New File&#8230; from the Xcode menu system, this will display the following screen&#8230;<br />
<br/><br />
<div id="attachment_192" class="wp-caption none" style="width: 310px"><img src="http://www.flexicoder.com/blog/wp-content/uploads/2009/08/Screen-shot-2009-08-04-at-10.16.13-300x232.png" alt="New File screen with Managed Object Class selected" title="New File screen" width="300" height="232" class="size-medium wp-image-192" /><p class="wp-caption-text">New File screen with Managed Object Class selected</p></div><br />
<br/><br />
Choose your location and then select the entities you want created.</p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2009/08/create-objective-c-classes-from-core-data-model/&title=Create+Objective-C+classes+from+Core+Data+model&text=Once+you%26%238217%3Bve+created+your+data+model+within+Xcode%2C+you+may+need+to+generate+the+classes+so+that+you+can+use+and+reference+them+in+your+main+project.&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2009/08/create-objective-c-classes-from-core-data-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
