Re: Getting objectSpecifier right...
Re: Getting objectSpecifier right...
- Subject: Re: Getting objectSpecifier right...
- From: Jim Correia <email@hidden>
- Date: Sat, 9 Oct 2004 19:15:42 -0400
On Oct 9, 2004, at 4:13 PM, Doug Knowles wrote:
- (NSScriptObjectSpecifier *)objectSpecifier
{
NSLog( @"Category: objectSpecifier requested for %@", [self
recordDescription] );
// try to specify the category by id
NSScriptObjectSpecifier *containerRef = [[self repository]
objectSpecifier];
// NSScriptClassDescription *classDesc = (NSScriptClassDescription
*)[NSScriptClassDescription classDescriptionForClass:[Category
class]];
NSScriptSuiteRegistry *reg = [NSScriptSuiteRegistry
sharedScriptSuiteRegistry];
NSDictionary *classes = [reg classDescriptionsInSuite:@"Prospector"];
NSScriptClassDescription *classDesc = [classes
objectForKey:@"Category"];
NSLog( @"...found category description %@", classDesc );
NSNumber *myID = [[NSNumber alloc] initWithLong:[self recordID]];
NSUniqueIDSpecifier *spec = [[NSUniqueIDSpecifier alloc]
initWithContainerClassDescription:classDesc
containerSpecifier:containerRef
key:@"recordID"
uniqueID:myID];
return spec;
}
Dustin answered the question asked. I'd also point out that the above
code leaks both myID and spec.
Jim
_______________________________________________
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