Re: How to search for mop3 files, retrieve those file and play these file into apps
Re: How to search for mop3 files, retrieve those file and play these file into apps
- Subject: Re: How to search for mop3 files, retrieve those file and play these file into apps
- From: Graham Cox <email@hidden>
- Date: Thu, 5 Mar 2009 20:49:53 +1100
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 (email@hidden)
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:
This email sent to email@hidden