Hi guys,
I'm tearing my hair out! I know I'm missing something silly but I just can work it out - any help would be very gratefully received!
Basically I have a class 'Node'
Node.M
And then I have a MainViewController to display the nodes, and remembers which one is selected...
MainViewController.M
The NodeView class inherits from the UIImageView class and just posts a Notification when it's clicked on....
My problem is to do with NewCurrentSelection, for some reason no matter what I do the debugger always sees the inLets array changing to a CALayerArray - which obviously no good to me?
What am I doing wrong????
Thanks very much in advance!!
Yoda
I'm tearing my hair out! I know I'm missing something silly but I just can work it out - any help would be very gratefully received!
Basically I have a class 'Node'
Code:
@interface Node : NSObject {
NSString *name;
NSMutableArray *inLets;
UIImageView *view;
}
@property (nonatomic, retain) NSMutableArray *inLets;
@property (nonatomic, retain) UIImageView *view;
@end
Node.M
Code:
@implementation Node
@synthesize name, isRunning, hasError,inLets;
-(id) init {
if (self = [super init]) {
hasError = NO;
self.inLets = [NSMutableArray array];
self.outLets = [[NSMutableArray alloc] init];
}
return self;
}
And then I have a MainViewController to display the nodes, and remembers which one is selected...
Code:
@interface MainViewController : UIViewController {
NodeView *currentSelection;
}
@property (nonatomic, retain) NodeView *currentSelection;
MainViewController.M
Code:
-(void)viewDidLoad {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(nodeSelected:object:) name:@"nodeselected" object:nil];
}
-(void) nodeSelected:(NSNotification *)aNotification object:(id)object{
if (nodeSelected != nil) {
nodeSelected.isSelected = NO;
} else {
nodeSelected = [[NodeView alloc] init];
}
NodeView *NewCurrentSelection = [[NodeView alloc] init];
NewCurrentSelection = [aNotification object];
nodeSelected = nil;
nodeSelected = NewCurrentSelection;
nodeSelected.isSelected = YES;
bottomHudViewController.nameLabel.text = nodeSelected.owner.name;
[bottomHudViewController showBottomHudView:(YES)];
}
The NodeView class inherits from the UIImageView class and just posts a Notification when it's clicked on....
My problem is to do with NewCurrentSelection, for some reason no matter what I do the debugger always sees the inLets array changing to a CALayerArray - which obviously no good to me?
What am I doing wrong????
Thanks very much in advance!!
Yoda