NSData & IconFamily handles
NSData & IconFamily handles
- Subject: NSData & IconFamily handles
- From: Philip Streck <email@hidden>
- Date: Fri, 23 Aug 2002 19:08:24 -0400
I'm trying to intialize an IconFamilyHandle with SetIconFamilyData using
the NSData object from a NSDocument loadDataRepresentation. I am new to
cocoa and carbon so the topics of Mac OS's old Handle mechanism and
cocoa are new to me. Here is the section of code that I'm using to load
the data:
- initWithData:(NSData*)data
{
OSErr result;
Handle dataHandle;
dataHandle = NewHandle( [data length] );
//[data getBytes:dataHandle];
PtrToHand( [data bytes], &dataHandle, [data length] );
self = [self init];
if (self) {
if (hIconFamily) {
DisposeHandle( (Handle)hIconFamily );
hIconFamily = NULL;
}
result = SetIconFamilyData( hIconFamily, 'icns', dataHandle );
if (result != noErr) {
[self autorelease];
return nil;
}
}
return self;
}
when I call SetIconFamilyData it returns -50, which translates to an
invalid parameter. Does anyone know what I'm doing wrong here.
Thanks,
Philip Streck
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.