• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting objectSpecifier right...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Getting objectSpecifier right... (From: Doug Knowles <email@hidden>)

  • Prev by Date: Re: Getting objectSpecifier right...
  • Next by Date: Formatting double values
  • Previous by thread: Re: Getting objectSpecifier right...
  • Next by thread: Re: Getting objectSpecifier right...
  • Index(es):
    • Date
    • Thread