Thanks very much for your help.
Importing the header gave me definitions for the ICNSAppSpec struct.
It's working now, but something I Dicovered about the NSData class is that you have to get the data out of it with the getBytes: method before you can cast it in to the appropriate type.
If your are interested below is my code:
- (IBAction)getProtocolInfo

id)sender
{
NSString *helperCreatorCode;
NSString *keyBuilder = @"Helper:"; // With this string we build the key for the ICData object we need.
ICAppSpec theICAppSpec;
ICAppSpecPtr theICAppSpecPointer;
OSType theOSType;
CFStringRef theCFStringRef;
keyBuilder=[keyBuilder stringByAppendingString: [[[protocolTextField stringValue] uppercaseString] lowercaseString]];
// we take the contents of the text field and make it lowercase. Then we add "helper:" beforehand.
// e.g. "FTP" becomes "helper:ftp" which is the appropriate key in the "ic-added" dictionary.
dataDictionary=[addedDictionary objectForKey:keyBuilder];
if (nil==dataDictionary)
{
[protocolNameTextField setStringValue:@"no helper"];
}
else
{
NSData *theICData = [dataDictionary objectForKey:@"ic-data"];
// this dictionary only ever has one key-data pair.
// the key always being "ic-data"
theICAppSpecPointer=&theICAppSpec;
[theICData getBytes:theICAppSpecPointer];
// make the pointer theICAppSpec point to the Address of theICData
theCFStringRef =CFStringCreateWithPascalString(NULL, theICAppSpec.name, kCFStringEncodingMacRoman);
// Carbon call to convert Pascal Strings into CFStrings
// NSLog(@"theCFStringRef, %@", theCFStringRef);
[protocolNameTextField setStringValue:theCFStringRef];
}
}
[ 11-08-2001: Message edited by: Diggory Laycock ]