i've read one book on Objective-C, am currently reading a book on Cocoa Programming, and i've just ordered 2 more books on C and Objective C... after reading those i plan on reading the Cocoa Programming book again... learning is a process that's different for everyone... i learn a lot from example.
and it's still not working... it tells me that windowColor may not respond to fillColor...?
i will be continuing to learn cocoa programming after i manage to have this problem solved, and over time it will become easier... but for now, it's not easy... and i'm not sure how correct it is that some people feel they have to walk on egg shells for asking questions in a developer forum.
[EDIT] ok so at first i didn't really get what you were talking about (classes communicating thru accessors), and i sort of still don't, but i *think* i do now...
so to the view class i added:
and the controller class i added as you suggested:
i do not receive any compile errors, but ultimately it doesn't work. when the view is white, the menu item is still enabled.
[EDIT AGAIN] nevermind, it totally works now... i forgot to change the tags in interface builder
thanks to everyone for replying
and it's still not working... it tells me that windowColor may not respond to fillColor...?
i will be continuing to learn cocoa programming after i manage to have this problem solved, and over time it will become easier... but for now, it's not easy... and i'm not sure how correct it is that some people feel they have to walk on egg shells for asking questions in a developer forum.
[EDIT] ok so at first i didn't really get what you were talking about (classes communicating thru accessors), and i sort of still don't, but i *think* i do now...
so to the view class i added:
Code:
.h file-------------------------------
- (NSColor *)fillColor;
.m file------------------------------
- (NSColor *)fillColor
{
return fillColor;
}
and the controller class i added as you suggested:
Code:
.m file------------------------------
- (BOOL)validateMenuItem:(NSMenuItem *)item
{
int itemTag = [item tag];
if ((itemTag == 5 || itemTag == 6) && ([[NSColorPanel sharedColorPanel] isKeyWindow]))
return NO;
if ((itemTag == 7 || itemTag == 8) && ([myWhiteSelection fillColor] == [NSColor whiteColor]))
return NO;
return YES;
}
i do not receive any compile errors, but ultimately it doesn't work. when the view is white, the menu item is still enabled.
[EDIT AGAIN] nevermind, it totally works now... i forgot to change the tags in interface builder
thanks to everyone for replying