Hi,

will do.. not much to it though:

The document class header:

#import <Cocoa/Cocoa.h>

@interface MyDocument : NSDocument
{
        NSMutableArray *array;
}

@property (readonly) NSMutableArray* array;

@end

All I changed in the doc impl is
@synthesize array
and
array =[ [NSMutableArray]alloc init]; in the init method.

The simple node class:

#import <Cocoa/Cocoa.h>


@interface Node : NSObject {
        NSString* string;
        
}

-(NSMutableArray*)children;

@end

#import "Node.h"

@implementation Node

-(NSMutableArray*)children
{
        return [NSMutableArray array];
}

-(id)init
{
        self = [super init];
        if(self)
        {
                string =@"This is a node";
        }
        return self;
}

-(void)dealloc
{
        NSLog(@"Deallocating Node");
        [string release];
        [super dealloc];
}

-(id)retain
{
        [super retain];
        NSLog(@"Retaining with count = %d", [self retainCount]);
        return self;
}

-(oneway void)release
{
        NSLog(@"Releasing to count = %d", [self retainCount]-1);
        [super release];
}

@end

Everything else is hokked up via IB and bindings. An NSTreeController controls Node-objects in the documents array member and displays them in a one-column NSOutlineView.


Thank you,
Mads

On Nov 8, 2009, at 21:51 , Greg Guerin wrote:

Mads Paulin wrote:

... big description ...


Can't debug descriptions.  Post your code.

 -- GG


_______________________________________________

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