access music database from cocoa
How do I access the iTunes database from my application. I seems apple can access iphone and itunes from their apps. How do I do the same?
Applescript will give you to access to iTunes and many other applications -- not sure how it works with iPhone. If you open the Applescript-Editor in the /Applications/Utilities folder, you will find the 'Open Dictionaries' command under the File menu. This will list all the applications you can access with Applescript and the methods and properties they support.
Apple has a special object, NSApplescript, that helps you integrate Applescript in your Cocoa app, see Technical Note TN2084 - Using AppleScript Scripts in Cocoa Applications. Applescript does have a bit of a steep learning curve, but examples are easily found on the internet and on your own computer in the /Library/Scripts folder
You might want to look into MPMediaLibrary Class Reference. This link might help you.