Scanning system directory for files with NSFileManager traversing each node ? I think it is not an efficient ... not to mention so many nodes in an hierarchy you need to scan

A simple google search will help you in this regard, for starters there are file handlers and spotlight guides could be your friends

Good luck

Rajesh

On Mar 5, 2009, at 10:49 AM, Graham Cox wrote:


On 05/03/2009, at 8:41 PM, haresh vavdiya wrote:

          I  am developing one application in which user can retrieve
music file from machine and use can play this music file also.

So i have to search for ".mp3" files in all folders and then display into table. Can anyone tell me that how can i search, retrieve .mp3
file and play this particular file into my apps.


Briefly, scan the disk using NSFileManager. You can use - enumeratorAtPath: to get an NSDirectoryEnumerator that will perform the scan. Gather the results into some sort of data storage that suits the purpose - a simple array would probably do, such as NSMutableArray.

To display the results in a table, NSTableView hooked to a controller e.g. NSArrayController that uses the above array as its data model.

To play an mp3 file, the simplest way is to use Quicktime via QTKit. e.g. [QTMovie movieWithURL:error:] followed by [myMovie play];

--Graham






_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rajesh%40vangennep.nl

This email sent to raj...@vangennep.nl

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to