Re: Sandboxed app & record-level indexing of Core Data in Spotlight (not working)
Re: Sandboxed app & record-level indexing of Core Data in Spotlight (not working)
- Subject: Re: Sandboxed app & record-level indexing of Core Data in Spotlight (not working)
- From: Vincent CARLIER <email@hidden>
- Date: Tue, 14 May 2013 13:42:44 +0200
Re gt,
2013/5/14 Giacomo Tufano <email@hidden>
> Il giorno 14/mag/2013, alle ore 13:00, Vincent CARLIER <
> email@hidden> ha scritto:
>
> I have a working .mdimporter that works correctly if I copy the importer
>> in /Library/Spotlight (it will index and spotlight find the documents).
>> The problem is that the "embedded" importer in the application (I started
>> with the Xcode template for "use core data" and "create importer" is never
>> called by the system. I checked that the .mdimporter is in the app bundle
>> inside the Contents/Resources/APPNAMEImported.mdimporter directory.
>> I'm planning to use MAS, so I *think* I cannot move anything in
>> /Library/Spotlight.
>>
>
> If your importer is bundled into your app, it should be in :
> Appname.app/Contents/Library/Spotlight
>
>
> Thank you Vincent! In Contents/Library/Spotlight works. I'm wondering
> where's documented, but it's OK (my fault, probably).
>
>
It's documented in the section "Troubleshooting Spotlight Importers", in
Spotlight Importer Programming Guide :
"An application’s Spotlight importer resides within the application’s
bundle in the subdirectory MyApp.app/Contents/Library/Spotlight." (top of
the page).
> I now get errors (one for every file) in mdworker (apparently from
> sandboxing) stating:
> 14/05/13 13:24:43,007 sandboxd[29551]: ([29550]) mdworker(29550) deny
> file-write-create /Users/gt/Library/Containers/it.iltofa.Janus/Data/Documents/SharedCoreDataStores/.localStore_SUPPORT/.LINKS
> (import fstype:hfs fsflag:480D000 flags:240000005F diag:0
> uti:it.iltofa.janus
> plugin:/Janus.app/Contents/Library/Spotlight/JanusImporter.mdimporter -
> find suspect file using: sudo mdutil -t 17981324)
> but it seems to work (records are indexed spotlight find them, etc. (now
> I'll try to understand what else is wrong).
>
Sounds like a permission problem, I never had such a problem though.
>
> Beside that, I'll have to understand how to convince Xcode to copy the
> .mdimporter in Library/Spotlight automatically (but this seems easier).
>
Add a copy files phase in the Build Phases for the app target, select the
"Wrapper" item in the popup button and add the subpath to the directory in
the field below.
> Thank you *very* much,
> gt
>
> btw: a test project just created with Xcode 4.6.2 "cocoa app" template
> generates an .mdimporter bundled under Resources. Should I file a bug or
> this is expected?
>
>
Not sure it is expected, as the documentation tells to put the importer in
another directory. I imagine Xcode defaults to the Resources directory when
it has to copy things.
Vince.
_______________________________________________
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