[Drawkit] File format extensions

Graham Cox graham.cox at bigpond.com
Wed May 21 00:31:58 PDT 2008


I think there will be a problem with this. If you link against the  
10.5 SDK (currently I don't recommend this, but soon this needs to be  
addressed, so that people can use 10.5 features if they want to extend  
DK) the <typeName> will be a UTI. A UTI typically contains dots, so  
you'll end up with a method name like 'dataFornet.apptree.drawing'  
which is not a valid Obj-C method name.

An easy workaround would be to remove the dots or replace them with  
underscores or another character.

But the other, more difficult, problem is that <typeName> is going to  
be different on 10.4 and 10.5. On 10.4 it's the type name specified by  
your info.plist, on 10.5 it's the UTI. I'm only just trying to make  
sense of UTIs and how these affect file opening and saving so I'm not  
sure the best way to resolve this. You might prefer to pass the  
typeName to another function that returns the function name, so that  
it can be overridden, and possibly consider making that work using a  
look-up table (dictionary) so that multiple typeNames can be mapped to  
the same function. Or you might have a better idea!

I thought I'd better let you know since I want to make sure that DK is  
UTI-savvy and can be built against the 10.5 SDK.



On 16 May 2008, at 9:43 am, Brad Larson wrote:

> - (NSData *)			dataOfType:(NSString*) typeName error:(NSError**)  
> outError
> {
> 	NSString *nameOfFiletypeSavingMethod = [NSString  
> stringWithFormat:@"dataFor%@", typeName];



More information about the Drawkit mailing list