Well, Declare Maker was able to successfully parse the class into Xojo code if you want it, but here are a few hints:
for the methods songsQuery and albumsQuery that you want, you will need to use NSClassFromString to get the class reference, then you can call the class functions.
You would do it like this:
declare function NSClassFromString lib "Foundation.framework" (clsName as CFStringRef) as Ptr
This gives you a pointer to the obj-C class like you could use directly in Obj-C. Since it is a flat C declare you do not need to use a selector in it.
For the class function you will do:
declare function songsQuery lib "MediaPlayer.framework" selector "songsQuery" (clsRef as Ptr) as ptr
This declare is slightly different since you have to use a selector since all class and instance methods are selectors in Obj-C. If you wanted to create a declare for the albumsQuery you would just have to change the selector in quotes. These selectors can be found directly in the apple docs, and must include any colons which are present there in your declare.
Now that you have these two (or more) declares, you can string them together to get the object back.
First we get the class reference
dim MPMediaQueryClass as Ptr = NSClassFromString("MPMediaQuery")
Then we get the songs query:
dim songs_Query as Ptr = songsQuery(MPMediaQueryClass)
Then you can use this object with further declares to get your NSArray of MPMediaItems.
Altogether the code for this would be:
declare function NSClassFromString lib "Foundation.framework" (clsName as CFStringRef) as Ptr
declare function songsQuery lib "MediaPlayer.framework" selector "songsQuery" (clsRef as Ptr) as ptr
dim MPMediaQueryClass as Ptr = NSClassFromString("MPMediaQuery")
dim songs_Query as Ptr = songsQuery(MPMediaQueryClass)
Note that I haven’t actually tested this, I’ve just written it up in the forum, but it should work.
If you have more questions, just ask.
Jason