Hi All,
I think this is an easy issue...for those with more knowledge than I :) but it has had me stumped for a while now.

I am puzzled about one of the calls (the "invalidateGraphic method") of the setter of the NSArray (_graphics) in the document.m file. The sequence occurs when data is read from an (archived) saved file. The sequence, I believe, goes like this.


- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error: (NSError **)outError {
....set up stuff.......
 [self setGraphics:graphics];



Which calls:



- (void)setGraphics:(NSArray *)graphics {
    unsigned i = [_graphics count];
    while (i-- > 0) {
        [self removeGraphicAtIndex:i];
    }
    i = [graphics count];
    while (i-- > 0) {
        [self insertGraphic:[graphics objectAtIndex:i] atIndex:0];
    }
}


which calls


- (void)insertGraphic:(SKTGraphic *)graphic atIndex:(unsigned)index {
[[[self undoManager] prepareWithInvocationTarget:self] removeGraphicAtIndex:index];
    [_graphics insertObject:graphic atIndex:index];
    [graphic setDocument:self];
    [self invalidateGraphic:graphic];

and the part that I do not get:

- (void)invalidateGraphic:(SKTGraphic *)graphic {
    NSArray *windowControllers = [self windowControllers];
[windowControllers makeObjectsPerformSelector:@selector (invalidateGraphic:) withObject:graphic];} I **think** I see what each line is doing, but, fail to grasp the overall essence of the call.
Thanks in advance.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to