Re: Double property name in AppleScript problem
Re: Double property name in AppleScript problem
- Subject: Re: Double property name in AppleScript problem
- From: email@hidden
- Date: Wed, 12 Mar 2003 10:32:26 +0100
>
Hi Gluca,
>
>
You need to make sure that the property name has the same 4 character
>
code in each class. When AppleScript compiles your script it converts
>
"property1" into the first matching 4 character code it sees for that
>
word, so you need to make sure that each word you use has the same code
>
everywhere that you use it.
>
The AppleEventCode for the two properties is equal (pnam). The class1 objets
are into an array in another class 'Pluto'. Class2 objects are in a controller
class situated in class 'Pluto'.
@interface Class1 : NSObject
.....
- (NSString *)property1;
@end
@interface Class2 : NSObject
....
- (NSString *)property1
@end
@interface Class2Ctrl : NSObject
....
- (NSArray *)classes2
@end
@interface Pluto : NSObject
...
- (NSArray *)classes1
- (Class2Ctrl *)class2Ctrl;
@end
@implementation Pluto (ScriptingSupport)
- (id)valueInClasses1AtIndex:(unsigned)index
{
return [classes1 objectAtIndex:index];
}
//With GDB i see that return correctly the object class2 but the final value
[class2 property1] fails with an NSReceiver error (3)
- (id)valueInClasses2AtIndex:(unsigned)index
{
return [[class2Ctrl classes2] objectAtIndex:index];
}
@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.