Hello,
I'm dabbling in QC and it's been an uphill battle. I'm trying to
display an NSString in a QCView. The string is an instance variable of
my class 'Controller', and I'm attempting to supply the string to the
QCView using bindings.
I really don't think the issue is my composition (.qtz) file, because
I've gotten it working with an NSTextField scenario. I just can't seem
to get it working with a straight NSString with bindings.
Here's my code:
Controller.h
========
@interface Controller : NSObject
{
IBOutlet NSController *patchController;
NSString *aString;
}
@property (retain) NSString * aString;
@end
Controller.m
========
@implementation Controller
@synthesize aString;
+ (void)initialize
{
if ([self class] != [Controller class])
return;
[Controller exposeBinding: @"aString"];
}
- (void)awakeFromNib
{
[self bind: @"aString" toObject: patchController withKeyPath:
@"patch.aString.value" options: nil];
self.aString = @"Hello, World!";
}
@end
With this code, I would expect the QCView to display 'Hello, World!'
when the app launches, but it doesn't display anything.
patchController is definitely hooked up correctly in IB, and I've made
sure the XIB file is referencing the correct .qtz file.
I know I could supply an NSString directly to the
QCCompositionRenderer using setValue:forInputKey:, but I would much
rather have the value updated automatically whenever the NSString
changes. This is possible, no?
Any help would be greatly appreciated!
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]