Array controllers again: still in dark...
Array controllers again: still in dark...
- Subject: Array controllers again: still in dark...
- From: Ondra Cada <email@hidden>
- Date: Sat, 24 Apr 2004 00:45:34 +0200
Hello mmalc or anybody who understands the thing,
please, tell me why have I to use explicitly the lines marked /**/? I
have thought this would be done automagically for me?
@interface AppController: NSObject { // note: have tried an
NSController, did not help either
IBOutlet NSArrayController *controller; // bound properly to an
NSTableView in IB
NSMutableArray *resultList;
}
-(IBAction)testResult:sender;
@end
@implementation AppController
-(void)applicationDidFinishLaunching:(NSNotification*)nn {
resultList=[[NSMutableArray alloc] init];
[controller bind:@"contentArray" toObject:self
withKeyPath:@"resultList" options:nil];
}
-(IBAction)testResult:sender {
[self willChangeValueForKey:@"resultList"]; /**/
[resultList replaceObjectsInRange:NSMakeRange(0,[resultList count])
withObjectsFromArray:COMPUTED_ARRAY];
[self didChangeValueForKey:@"resultList"]; /**/
}
@end
This code works right. If I remove the two /**/ lines though, the
NSTableView never redisplays new data...
Thanks alot,
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.