I am getting the error "unrecognized selector sent to instance" but I can't seem to figure out the cause. I am new to Objective-c, and this seems to be something basic, but I'm not getting it. Why is setNodes not being recognized?
Thanks in advance!
[NetBuilder setNodes:]: unrecognized selector sent to instance 0x1b3e20
NetBuilder.h
NetBuilder.m
Thanks in advance!
[NetBuilder setNodes:]: unrecognized selector sent to instance 0x1b3e20
NetBuilder.h
Code:
#import <Cocoa/Cocoa.h>
@class Network;
@class Node;
@interface NetBuilder : NSObject {
}
-(id)init;
-(void)dealloc;
-(IBAction)buildNetwork;
@property (retain) Network * network;
@property (retain) NSMutableDictionary * nodes;
@end
NetBuilder.m
Code:
#import "NetBuilder.h"
#import "Node.h"
#import "Network.h"
#import "Path.h"
// private methods
@interface NetBuilder ()
-(void)buildNodePaths:(Node *)node minI:(int)i1 maxI:(int)i2 minJ:(int)j1 maxJ:(int)j2 minK:(int)k1 maxK:(int)k2;
-(int)getDeltaIndex:(int)low startIndex:(int)start maxIndex:(int)max deltaIndex:(int)delta;
-(int)getIndex:(int)i andJ:(int)j andK:(int)k;
-(void)assignNodes:(int)n forZ:(int)z;
-(int)followPaths:(Node *)node;
@end
// actual implementation
@implementation NetBuilder
@dynamic network;
@dynamic nodes;
- (id)init
{
if ( self = [super init] )
{
[self setNodes:[[NSMutableDictionary alloc] init] ];
}
NSLog(@"NetBuilder init");
return self;
}