NSColorWell setColor crash
NSColorWell setColor crash
- Subject: NSColorWell setColor crash
- From: "Mark's Studio" <email@hidden>
- Date: Wed, 5 Sep 2001 17:54:47 +0200
I have a window with a colorwell ,a tableview , a textfield, a Add and a
Edit button.
I can add an item to a MutableArray of Group (a NSString and a NSColor)
taking the string from textfield and the color from the colorwell,
and if i select something in the tableview the textfield and colorwell
shows whats stored in the Group.
But if i change the color in the colorpanel and change selection in the
tableview
without first pressing the Add or Edit button it Crashes.
-[NSConcreteValue drawSwatchInRect:]: selector not recognized
What am i doing wrong?
is it something to do with the continuous state of the colorwell, and my
setColor makes the exception
(Pause just trying!!)
no difference, maybe it's not working the colorpanel still updates the
colorwell continuous,
unless continuous works differently.
- (IBAction)addNewGroup:(id)sender
{
Group *aGroup = [[Group alloc]init];
[GroupDB addObject:aGroup];
[aGroup setGroupName:[editGroupName stringValue]];
[aGroup setGroupColor:[myColorWell color]];
}
- (IBAction)editGroup:(id)sender
{
Group *aGroup = [[Group alloc]init];
int index = [GroupEditView selectedRow];
[GroupDB replaceObjectAtIndex:index withObject:aGroup];
[GroupEditView reloadData];
[GroupView reloadData];
[aGroup setGroupName:[editGroupName stringValue]];
[aGroup setGroupColor:[myColorWell color]];
}
- (IBAction)selectedInEditGroupView:(id)sender
{
Group *aGroup;
int index = [GroupEditView selectedRow];
if(index > -1 && index <=[GroupDB count]){
aGroup = [GroupDB objectAtIndex:index];
NSLog(@"Selectedcolor(%@)",(NSColor *)[aGroup groupColor]);
[editGroupName setStringValue:[aGroup groupName]];
[myColorWell setColor:(NSColor *)[aGroup groupColor]];
}
}
Peter Mark
Mark's Recording Studio A/S
Faelledvej 19 b DK2200 N
Copenhagen Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden