Re: MDSchemaCopyAllAttributes() returning nil
Re: MDSchemaCopyAllAttributes() returning nil
- Subject: Re: MDSchemaCopyAllAttributes() returning nil
- From: Benjamin Stiglitz <email@hidden>
- Date: Thu, 18 Jun 2009 12:35:02 -0400
I'm working on a project that works a lot with Spotlight, and we're
trying to get a list of all the attributes that Spotlight knows
about. We found a really nice function called
MDSchemaCopyAllAttributes that returns a CFArrayRef of CFStringRefs,
each one corresponding to a spotlight attribute in the schema.
The problem is that when we run this program as root (which we have
to), MDSchemaCopyAllAttributes seems to consistently be returning
nil. Is this normal behavior? If so, how can we get a list of all
Spotlight attributes across an entire machine (and not just the user
domain)?
You should be using a privileged helper process for the privileged
operations your application performs instead of running as root. There
was a great session on Authorization Services at WWDC; until the video
is up, you can take a look at:
• The Authorization Services Programming Guide: <http://developer.apple.com/documentation/security/conceptual/authorization_concepts/01introduction/introduction.html
>
• BetterAuthorizationSample: <http://developer.apple.com/samplecode/BetterAuthorizationSample/index.html#//apple_ref/doc/uid/DTS10004207
>
-Ben_______________________________________________
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