<?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: Loading data from .plist files</title>
	<atom:link href="http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/</link>
	<description>Conquering the mobile universe</description>
	<lastBuildDate>Fri, 10 Feb 2012 21:48:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: victor jalencas</title>
		<link>http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/#comment-8071</link>
		<dc:creator>victor jalencas</dc:creator>
		<pubDate>Wed, 14 Sep 2011 11:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=605#comment-8071</guid>
		<description>Youâ€™re leaking the PList dictionary.

And also, if you want the retained version, obtaining the autoreleased version and then retaining it is too much work. Just use initWithContentsOfFile: instead</description>
		<content:encoded><![CDATA[<p>Youâ€™re leaking the PList dictionary.</p>
<p>And also, if you want the retained version, obtaining the autoreleased version and then retaining it is too much work. Just use initWithContentsOfFile: instead</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hlen0800</title>
		<link>http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/#comment-6988</link>
		<dc:creator>Hlen0800</dc:creator>
		<pubDate>Tue, 28 Jun 2011 02:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=605#comment-6988</guid>
		<description>Hi,Â Â i&#039;m only a beginner in this environment, i just want to ask if it is possible to display the plist data saved from Â other view to a Â new view. I am now doing my first application, i used two UITextfied to saved data in the PList and it works fine. My problem is i don&#039;t know how to display that two data input to the other view. To make it clear i input and saved data in EventViewController and I want that saved data to be displayed in PageViewController in one UITextField only.</description>
		<content:encoded><![CDATA[<p>Hi,Â Â i&#8217;m only a beginner in this environment, i just want to ask if it is possible to display the plist data saved from Â other view to a Â new view. I am now doing my first application, i used two UITextfied to saved data in the PList and it works fine. My problem is i don&#8217;t know how to display that two data input to the other view. To make it clear i input and saved data in EventViewController and I want that saved data to be displayed in PageViewController in one UITextField only.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramana</title>
		<link>http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/#comment-2285</link>
		<dc:creator>Ramana</dc:creator>
		<pubDate>Wed, 06 Oct 2010 12:10:27 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=605#comment-2285</guid>
		<description>First of all add a plist to your project in Xcode. For example â€œdata.plistâ€.

Next, look at this code which creates path to plist in documents directory:

â€¨NSError *error;â€¨NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); //1
â€¨NSString *documentsDirectory = [paths objectAtIndex:0]; //2â€¨
NSString *path = [documentsDirectory stringByAppendingPathComponent:@&quot;data.plist&quot;]; //3
NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath: path]) //4
â€¨{â€¨

NSString *bundle = [[NSBundle mainBundle] pathForResource:@â€dokumentâ€ ofType:@â€plistâ€]; //5

[fileManager copyItemAtPath:bundle toPath: path error:&amp;error]; //6
â€¨}
1) Create a list of paths.
â€¨2) Get a path to your documents directory from the list.
â€¨3) Create a full file path.
â€¨4) Check if file exists.â€¨
5) Get a path to your plist created before in bundle directory (by Xcode).
â€¨6) Copy this plist to your documents directory.
Ok, next read data:
â€¨NSMutableDictionary *savedStock = [[NSMutableDictionary alloc] initWithContentsOfFile: path];

//load from savedStock example int valueâ€¨

int value;
â€¨value = [[savedStock objectForKey:@&quot;value&quot;] intValue];
[savedStock release];

And write data:
NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile: path];

//here add elements to data file and write data to fileâ€¨
int value = 5;
[data setObject:[NSNumber numberWithInt:value] forKey:@â€valueâ€];
[data writeToFile: path atomically:YES];
â€¨[data release];
Remember about two things:
1) You must create a plist file in your Xcode project.â€¨2) To optimize your app, better is to save all the data when application (or for example view) is closing. For instance in applicationWillTerminate. But if you are storing reeaaaally big data, sometimes it couldnâ€™t be saved in this method, becouse the app is closing too long and the system will terminate it immediately.

I think this would be help full to you, @salim.</description>
		<content:encoded><![CDATA[<p>First of all add a plist to your project in Xcode. For example â€œdata.plistâ€.</p>
<p>Next, look at this code which creates path to plist in documents directory:</p>
<p>â€¨NSError *error;â€¨NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); //1<br />
â€¨NSString *documentsDirectory = [paths objectAtIndex:0]; //2â€¨<br />
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"data.plist"]; //3<br />
NSFileManager *fileManager = [NSFileManager defaultManager];<br />
if (![fileManager fileExistsAtPath: path]) //4<br />
â€¨{â€¨</p>
<p>NSString *bundle = [[NSBundle mainBundle] pathForResource:@â€dokumentâ€ ofType:@â€plistâ€]; //5</p>
<p>[fileManager copyItemAtPath:bundle toPath: path error:&amp;error]; //6<br />
â€¨}<br />
1) Create a list of paths.<br />
â€¨2) Get a path to your documents directory from the list.<br />
â€¨3) Create a full file path.<br />
â€¨4) Check if file exists.â€¨<br />
5) Get a path to your plist created before in bundle directory (by Xcode).<br />
â€¨6) Copy this plist to your documents directory.<br />
Ok, next read data:<br />
â€¨NSMutableDictionary *savedStock = [[NSMutableDictionary alloc] initWithContentsOfFile: path];</p>
<p>//load from savedStock example int valueâ€¨</p>
<p>int value;<br />
â€¨value = [[savedStock objectForKey:@"value"] intValue];<br />
[savedStock release];</p>
<p>And write data:<br />
NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile: path];</p>
<p>//here add elements to data file and write data to fileâ€¨<br />
int value = 5;<br />
[data setObject:[NSNumber numberWithInt:value] forKey:@â€valueâ€];<br />
[data writeToFile: path atomically:YES];<br />
â€¨[data release];<br />
Remember about two things:<br />
1) You must create a plist file in your Xcode project.â€¨2) To optimize your app, better is to save all the data when application (or for example view) is closing. For instance in applicationWillTerminate. But if you are storing reeaaaally big data, sometimes it couldnâ€™t be saved in this method, becouse the app is closing too long and the system will terminate it immediately.</p>
<p>I think this would be help full to you, @salim.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramana</title>
		<link>http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/#comment-2284</link>
		<dc:creator>Ramana</dc:creator>
		<pubDate>Wed, 06 Oct 2010 12:04:56 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=605#comment-2284</guid>
		<description>First of all add a plist to your project in Xcode. For example â€œdata.plistâ€.
Next, look at this code which creates path to plist in documents directory:
â€¨NSError *error;â€¨NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); //1â€¨NSString *documentsDirectory = [paths objectAtIndex:0]; //2â€¨NSString *path = [documentsDirectory stringByAppendingPathComponent:@&quot;data.plist&quot;]; //3
NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath: path]) //4â€¨{â€¨NSString *bundle = [[NSBundle mainBundle] pathForResource:@â€dokumentâ€ ofType:@â€plistâ€]; //5
[fileManager copyItemAtPath:bundle toPath: path error:&amp;error]; //6â€¨}
1) Create a list of paths.â€¨2) Get a path to your documents directory from the list.â€¨3) Create a full file path.â€¨4) Check if file exists.â€¨5) Get a path to your plist created before in bundle directory (by Xcode).â€¨6) Copy this plist to your documents directory.
Ok, next read data:
â€¨NSMutableDictionary *savedStock = [[NSMutableDictionary alloc] initWithContentsOfFile: path];
//load from savedStock example int valueâ€¨int value;â€¨value = [[savedStock objectForKey:@&quot;value&quot;] intValue];
[savedStock release];
And write data:
NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile: path];
//here add elements to data file and write data to fileâ€¨int value = 5;
[data setObject:[NSNumber numberWithInt:value] forKey:@â€valueâ€];
[data writeToFile: path atomically:YES];â€¨[data release]
Remember about two things:
1) You must create a plist file in your Xcode project.â€¨2) To optimize your app, better is to save all the data when application (or for example view) is closing. For instance in applicationWillTerminate. But if you are storing reeaaaally big data, sometimes it couldnâ€™t be saved in this method, becouse the app is closing too long and the system will terminate it immediately.</description>
		<content:encoded><![CDATA[<p>First of all add a plist to your project in Xcode. For example â€œdata.plistâ€.<br />
Next, look at this code which creates path to plist in documents directory:<br />
â€¨NSError *error;â€¨NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); //1â€¨NSString *documentsDirectory = [paths objectAtIndex:0]; //2â€¨NSString *path = [documentsDirectory stringByAppendingPathComponent:@"data.plist"]; //3<br />
NSFileManager *fileManager = [NSFileManager defaultManager];<br />
if (![fileManager fileExistsAtPath: path]) //4â€¨{â€¨NSString *bundle = [[NSBundle mainBundle] pathForResource:@â€dokumentâ€ ofType:@â€plistâ€]; //5<br />
[fileManager copyItemAtPath:bundle toPath: path error:&amp;error]; //6â€¨}<br />
1) Create a list of paths.â€¨2) Get a path to your documents directory from the list.â€¨3) Create a full file path.â€¨4) Check if file exists.â€¨5) Get a path to your plist created before in bundle directory (by Xcode).â€¨6) Copy this plist to your documents directory.<br />
Ok, next read data:<br />
â€¨NSMutableDictionary *savedStock = [[NSMutableDictionary alloc] initWithContentsOfFile: path];<br />
//load from savedStock example int valueâ€¨int value;â€¨value = [[savedStock objectForKey:@"value"] intValue];<br />
[savedStock release];<br />
And write data:<br />
NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile: path];<br />
//here add elements to data file and write data to fileâ€¨int value = 5;<br />
[data setObject:[NSNumber numberWithInt:value] forKey:@â€valueâ€];<br />
[data writeToFile: path atomically:YES];â€¨[data release]<br />
Remember about two things:<br />
1) You must create a plist file in your Xcode project.â€¨2) To optimize your app, better is to save all the data when application (or for example view) is closing. For instance in applicationWillTerminate. But if you are storing reeaaaally big data, sometimes it couldnâ€™t be saved in this method, becouse the app is closing too long and the system will terminate it immediately.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Salim</title>
		<link>http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/#comment-2282</link>
		<dc:creator>Salim</dc:creator>
		<pubDate>Wed, 28 Apr 2010 11:58:50 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=605#comment-2282</guid>
		<description>hi, can any one tell how to create .plist file dynamically..
please any one have idea then please reply me on this email address.</description>
		<content:encoded><![CDATA[<p>hi, can any one tell how to create .plist file dynamically..<br />
please any one have idea then please reply me on this email address.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VIKI</title>
		<link>http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/#comment-2281</link>
		<dc:creator>VIKI</dc:creator>
		<pubDate>Tue, 16 Mar 2010 17:44:10 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=605#comment-2281</guid>
		<description>This code doesn&#039;t display work for me</description>
		<content:encoded><![CDATA[<p>This code doesn&#8217;t display work for me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aziza</title>
		<link>http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/#comment-2280</link>
		<dc:creator>Aziza</dc:creator>
		<pubDate>Fri, 05 Mar 2010 15:10:51 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=605#comment-2280</guid>
		<description>That&#039;s pretty good... but what about sound files?? how can i read from plist paths of mp3 for example...?</description>
		<content:encoded><![CDATA[<p>That&#8217;s pretty good&#8230; but what about sound files?? how can i read from plist paths of mp3 for example&#8230;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas</title>
		<link>http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/#comment-2279</link>
		<dc:creator>Andreas</dc:creator>
		<pubDate>Wed, 21 Oct 2009 16:36:33 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=605#comment-2279</guid>
		<description>I find my answer alone :p

If anyone has this question email me to send you the source code to achieve that :p

andreasoxinos@me.com my email</description>
		<content:encoded><![CDATA[<p>I find my answer alone :p</p>
<p>If anyone has this question email me to send you the source code to achieve that :p</p>
<p><a href="mailto:andreasoxinos@me.com">andreasoxinos@me.com</a> my email</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas</title>
		<link>http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/#comment-2278</link>
		<dc:creator>Andreas</dc:creator>
		<pubDate>Mon, 19 Oct 2009 14:23:10 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=605#comment-2278</guid>
		<description>In fact my question is how i save into the existing plist, i create a plist with a dictionary which contains 3 strings, and an array with 2 items, i load them into my code, i use them fine, but how i can write into this fields in plist</description>
		<content:encoded><![CDATA[<p>In fact my question is how i save into the existing plist, i create a plist with a dictionary which contains 3 strings, and an array with 2 items, i load them into my code, i use them fine, but how i can write into this fields in plist</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas</title>
		<link>http://www.icodeblog.com/2009/02/14/loading-data-from-plist-files/#comment-2277</link>
		<dc:creator>Andreas</dc:creator>
		<pubDate>Mon, 19 Oct 2009 11:10:27 +0000</pubDate>
		<guid isPermaLink="false">http://icodeblog.com/?p=605#comment-2277</guid>
		<description>Hey thanks for the tuto, great help, so i get the point of loading the data, lets say i save there some variables and i want with a timer to save update them, how i do that?
 (just the update code not the timer)</description>
		<content:encoded><![CDATA[<p>Hey thanks for the tuto, great help, so i get the point of loading the data, lets say i save there some variables and i want with a timer to save update them, how i do that?<br />
 (just the update code not the timer)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

