Object specifier function
Object specifier function
- Subject: Object specifier function
- From: Olivier Destrebecq <email@hidden>
- Date: Wed, 15 May 2002 19:27:13 -0500
i have a hierarchy of object for which when i try to get an object
specifier for i always got the result "+class ;1" instead of "hub 1".
Here is my Objectspecifier function, it gets called, but apparently i
did something wrong.
If anybody knows about this, please let me know.
Olivier
@implementation DeviceHub (ObjectSpecifying)
- (NSScriptObjectSpecifier *)objectSpecifier
{
// Set 'containerRef' to your 'container'.
//
NSScriptObjectSpecifier *containerRef;
unsigned index;
if ([self container] != nil)
{
containerRef = [[self container] objectSpecifier];
index = [[self container] indexOfItem: self ofClass:[self
class]]; // Fix this!
}
else
{
containerRef = [[NSApplication sharedApplication]
objectSpecifier];
index = 0;
}
// Calculate 'index'.
//
//create and return the specifier
//
return [[[NSIndexSpecifier allocWithZone:[self zone]]
initWithContainerClassDescription: [containerRef
keyClassDescription]
containerSpecifier:
containerRef
key: @"hubs"
index: index]
autorelease];
}
@end
_______________________________________________
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.