<?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: How To Read a File From Your Application Bundle</title>
	<atom:link href="http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle/feed" rel="self" type="application/rss+xml" />
	<link>http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle</link>
	<description>Tips and Tricks for iPhone, iPod, iPad and iOS Developers</description>
	<lastBuildDate>Tue, 17 Apr 2012 16:54:31 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ramesh</title>
		<link>http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle/comment-page-2#comment-23299</link>
		<dc:creator>ramesh</dc:creator>
		<pubDate>Mon, 09 Apr 2012 10:58:04 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=30#comment-23299</guid>
		<description>i m working on textview..i m entering sum text in text view and i wil save the text with btn prewss event..it wil save on local path...bt how to create a duplicate file with the same name like text2.txt....

-(IBAction)SaveNote{
	NSError *error;
	
	NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString *documentsDirectory = [documentPaths objectAtIndex:0];
	NSString *documentTXTPath = [documentsDirectory stringByAppendingPathComponent:@&quot;Note.txt&quot;];
	NSString *savedString = textView.text;

	     NSLog(@&quot;The Save file is:%@&quot;, savedString);
	     NSLog(@&quot; file exists at path:%@&quot;, documentTXTPath);
	
		[[savedString description] writeToFile:documentTXTPath atomically:YES encoding:NSUTF8StringEncoding error:&amp;error];
	
		   NSArray *directoryContent = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentTXTPath error:NULL];
	int Count;
	    for (Count = 0; Count &lt; (int)[directoryContent count]; Count++)
	{
	        NSLog(@&quot;File %d: %@&quot;, (Count + 1), [directoryContent objectAtIndex:Count]);
				    }
	
}</description>
		<content:encoded><![CDATA[<p>i m working on textview..i m entering sum text in text view and i wil save the text with btn prewss event..it wil save on local path&#8230;bt how to create a duplicate file with the same name like text2.txt&#8230;.</p>
<p>-(IBAction)SaveNote{<br />
	NSError *error;</p>
<p>	NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);<br />
	NSString *documentsDirectory = [documentPaths objectAtIndex:0];<br />
	NSString *documentTXTPath = [documentsDirectory stringByAppendingPathComponent:@"Note.txt"];<br />
	NSString *savedString = textView.text;</p>
<p>	     NSLog(@&#8221;The Save file is:%@&#8221;, savedString);<br />
	     NSLog(@&#8221; file exists at path:%@&#8221;, documentTXTPath);</p>
<p>		[[savedString description] writeToFile:documentTXTPath atomically:YES encoding:NSUTF8StringEncoding error:&amp;error];</p>
<p>		   NSArray *directoryContent = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentTXTPath error:NULL];<br />
	int Count;<br />
	    for (Count = 0; Count &lt; (int)[directoryContent count]; Count++)<br />
	{<br />
	        NSLog(@&quot;File %d: %@&quot;, (Count + 1), [directoryContent objectAtIndex:Count]);<br />
				    }</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle/comment-page-2#comment-14928</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Wed, 02 Nov 2011 02:10:12 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=30#comment-14928</guid>
		<description>@mb: If you just want to play audio from a URL you can use [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&amp;error]; If you want to save the data locally use [NSData dataWithContentsOfURL:url]; to get the audio data, and then save it to a file with writeToFile. The method for saving to a database depends on the specifics of the database. But if you have an NSData object it shouldn&#039;t bee too difficult.</description>
		<content:encoded><![CDATA[<p>@mb: If you just want to play audio from a URL you can use [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&amp;error]; If you want to save the data locally use [NSData dataWithContentsOfURL:url]; to get the audio data, and then save it to a file with writeToFile. The method for saving to a database depends on the specifics of the database. But if you have an NSData object it shouldn&#8217;t bee too difficult.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mb</title>
		<link>http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle/comment-page-2#comment-14891</link>
		<dc:creator>mb</dc:creator>
		<pubDate>Mon, 31 Oct 2011 18:10:39 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=30#comment-14891</guid>
		<description>i want to get the content of URL : 
http://something.com/sth.mp3

i want to play it using audioPlayer .. and want to save it on the Database 
how can i do that?</description>
		<content:encoded><![CDATA[<p>i want to get the content of URL :<br />
<a href="http://something.com/sth.mp3" rel="nofollow">http://something.com/sth.mp3</a></p>
<p>i want to play it using audioPlayer .. and want to save it on the Database<br />
how can i do that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle/comment-page-1#comment-14799</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Thu, 29 Sep 2011 01:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=30#comment-14799</guid>
		<description>@SHAYIN: There are many ways to do this depending on your requirements. Here are a few examples:

	Create a web service on the Windows servers side. The app communicates with the web service to read/write data.
	Export the data from the MS SQL database and import it into a SQLite database that you can store in the app bundle.
</description>
		<content:encoded><![CDATA[<p>@SHAYIN: There are many ways to do this depending on your requirements. Here are a few examples:</p>
<p>	Create a web service on the Windows servers side. The app communicates with the web service to read/write data.<br />
	Export the data from the MS SQL database and import it into a SQLite database that you can store in the app bundle.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SHAYIN</title>
		<link>http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle/comment-page-1#comment-14181</link>
		<dc:creator>SHAYIN</dc:creator>
		<pubDate>Wed, 28 Sep 2011 05:39:24 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=30#comment-14181</guid>
		<description>I want to use Iphone to communicate with the Windows MS SQL database, what is the best methods that I can try? export sql data into *.txt than read from iphone??</description>
		<content:encoded><![CDATA[<p>I want to use Iphone to communicate with the Windows MS SQL database, what is the best methods that I can try? export sql data into *.txt than read from iphone??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle/comment-page-1#comment-14929</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Sun, 25 Sep 2011 02:13:38 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=30#comment-14929</guid>
		<description>@Tyler: Keep track of the articles that the user saves. Store information about the articles (name, URL, etc) in a data file. The datafile can be created in many ways: a serialized NSArray object, a serialized array of your own objects, a plist, etc. When displaying the table view, read the data from the data file and show one table row per entry in the data file.</description>
		<content:encoded><![CDATA[<p>@Tyler: Keep track of the articles that the user saves. Store information about the articles (name, URL, etc) in a data file. The datafile can be created in many ways: a serialized NSArray object, a serialized array of your own objects, a plist, etc. When displaying the table view, read the data from the data file and show one table row per entry in the data file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tyler</title>
		<link>http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle/comment-page-1#comment-14041</link>
		<dc:creator>Tyler</dc:creator>
		<pubDate>Thu, 22 Sep 2011 20:36:39 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=30#comment-14041</guid>
		<description>I have a blog app, and want to feature a save button where the user can save the article they are reading, and read it later.  All of the HTMLs save fine in the documents directory, but I am unsure of how to get the tableview to show those htmls from the documents directory.  any suggestions?</description>
		<content:encoded><![CDATA[<p>I have a blog app, and want to feature a save button where the user can save the article they are reading, and read it later.  All of the HTMLs save fine in the documents directory, but I am unsure of how to get the tableview to show those htmls from the documents directory.  any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle/comment-page-1#comment-14930</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Sun, 18 Sep 2011 02:18:30 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=30#comment-14930</guid>
		<description>@Ayaz: Yes that is definitely possible. With local file names, spaces are typically not a problem.
For generic URLs you need to replace spaces in the URL in some situations. See the stringByAddingPercentEscapesUsingEncoding method in NSString.</description>
		<content:encoded><![CDATA[<p>@Ayaz: Yes that is definitely possible. With local file names, spaces are typically not a problem.<br />
For generic URLs you need to replace spaces in the URL in some situations. See the stringByAddingPercentEscapesUsingEncoding method in NSString.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ayaz...</title>
		<link>http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle/comment-page-1#comment-13920</link>
		<dc:creator>Ayaz...</dc:creator>
		<pubDate>Fri, 16 Sep 2011 12:10:09 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=30#comment-13920</guid>
		<description>i have one Question on NSData.

i have one File It name is &quot;my book&quot; this is &quot;.doc&quot; file i want to download it so tell me one thing is this possible to download file of this name i mean to say in this file name there is a space so tell me it is possible or not...</description>
		<content:encoded><![CDATA[<p>i have one Question on NSData.</p>
<p>i have one File It name is &#8220;my book&#8221; this is &#8220;.doc&#8221; file i want to download it so tell me one thing is this possible to download file of this name i mean to say in this file name there is a space so tell me it is possible or not&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://iPhoneIncubator.com/blog/data-management/how-to-read-a-file-from-your-application-bundle/comment-page-1#comment-13278</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Sat, 06 Aug 2011 15:03:32 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneIncubator.com/blog/?p=30#comment-13278</guid>
		<description>@Adriana: Yes, the iPhone has very limited amount of memory compared to your browser on your desktop computer. It&#039;s not very difficult to run out of memory by loading too much data into a web view. If you have control over the web page you&#039;re trying to display you can try to remove stuff until it gets down to a reasonable size. If you don&#039;t have control over the web page then you could try to load the HTML into a mutable string and then delete stuff from it before you load it into the web view. But this is dicey too since you may run out of memory when you&#039;re loading data into the string, and you will probably have two instances of the data in memory as you load the HTML from the string into the web view.</description>
		<content:encoded><![CDATA[<p>@Adriana: Yes, the iPhone has very limited amount of memory compared to your browser on your desktop computer. It&#8217;s not very difficult to run out of memory by loading too much data into a web view. If you have control over the web page you&#8217;re trying to display you can try to remove stuff until it gets down to a reasonable size. If you don&#8217;t have control over the web page then you could try to load the HTML into a mutable string and then delete stuff from it before you load it into the web view. But this is dicey too since you may run out of memory when you&#8217;re loading data into the string, and you will probably have two instances of the data in memory as you load the HTML from the string into the web view.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 6/18 queries in 0.157 seconds using disk: basic
Object Caching 358/368 objects using disk: basic

Served from: iphoneincubator.com @ 2012-05-17 03:02:29 -->
