• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting UTI's in non-document based app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting UTI's in non-document based app


  • Subject: Setting UTI's in non-document based app
  • From: Adam Leonard <email@hidden>
  • Date: Fri, 21 Apr 2006 00:08:41 -0700

Hi, sorry to ask another question, but I can't figure this out and it is semi-urgent

I have a non-document based app that makes a bunch of files with my custom extension. I write the files like this:

NSDictionary *result = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[titles objectAtIndex:i],[URLs objectAtIndex:i], [descriptions objectAtIndex:i],[self searchTerms],nil]
forKeys:[NSArray arrayWithObjects:@"titleArrayKey",@"urlArrayKey",@"descriptionsArrayKey" ,@"searchTermsKey",nil]];


NSData *resultAsData = [NSArchiver archivedDataWithRootObject:result];
NSFileWrapper *wrapper = [[NSFileWrapper alloc] initRegularFileWithContents:resultAsData];
NSMutableDictionary *fileAttributes = [[wrapper fileAttributes] mutableCopy];
[fileAttributes setObject:[NSNumber numberWithUnsignedLong:'GOSP']
forKey:NSFileHFSCreatorCode];

[fileAttributes removeObjectForKey:NSFileModificationDate];
[fileAttributes removeObjectForKey:NSFileCreationDate];


[wrapper setFileAttributes:fileAttributes];
if(![wrapper writeToFile:[applicationSupportDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"% i.resulturl",i]]
atomically:YES
updateFilenames:YES])
{
...


			}
			[wrapper release];
			[fileAttributes release];

I then have a spotlight importer that declares the UTI in its info.plist file

It seems that after a while (many hours, usually), the system recognizes the UTI. However, before that, mdls says that it has a dynamic UTI like dyn.xxxx...

So, my question is how can I get this to happen immediately.

Any advice would be appreciated.

Adam Leonard

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: NSArrayController sorting
  • Next by Date: Re: Why do people in the UK put a u in the word color?
  • Previous by thread: Re: NSData Vs NSFileHandle For Extracting From Archive Files
  • Next by thread: Finding all apps for
  • Index(es):
    • Date
    • Thread