I need to create a UTI to enable copying a custom data type to the pasteboard. In the pasteboard programming guide in the XCode documentation, in the Custom Data section, there are example of the required methods to comply with the NSPasteboardWriting and NSPasteboardReading protocols.
In the sample code they use a defined type - BOOKMARK_UTI. Can anyone tell me which one of the three required keys, UTTypeIdentifier, UTTypeDescription or UTTypeTagSpecification this is?
Also two statements in the code examples won't compile:
The compiler doesn't know what a "url" is. You can change this to "URL" but this won't work either. If you change this to "NSURL" the first statement will compile but the second won't because the type "NSURL" has no method "absolute String.
In the sample code they use a defined type - BOOKMARK_UTI. Can anyone tell me which one of the three required keys, UTTypeIdentifier, UTTypeDescription or UTTypeTagSpecification this is?
Also two statements in the code examples won't compile:
Code:
if ([type isEqualToString:(NSString *)kUTTypeURL]) {
return [url pasteboardPropertyListForType:(NSString *)kUTTypeURL];
}
if ([type isEqualToString:NSPasteboardTypeString]) {
return [NSString stringWithFormat:@"<a href=\"%@\">%@</a>",
[url absoluteString], title];
}
The compiler doesn't know what a "url" is. You can change this to "URL" but this won't work either. If you change this to "NSURL" the first statement will compile but the second won't because the type "NSURL" has no method "absolute String.