so to use it you have to either give NSButton a custom cell (which I don't know how to do)
.

is this what you mean?
so to use it you have to either give NSButton a custom cell (which I don't know how to do)
.
![]()
is this what you mean?
That is exactly how you do it. If the class does not appear in the menu, try dropping the header file onto the main nib window (the one that lists everything).
i knew how to do it but he didnt. i was see if that what he dint know how to do.
on post #22 i where i put all the problems of your code does. is there to reloop it also?
Can you post you exact code?
arrayIndex++ ;
if ( arrayIndex >= [colorArray count] ) arrayIndex = 0 ;
NSUInteger *arrayIndex;
[self setButtonColor:[colorArray objectAtIndex:arrayIndex]];
As far as the looping goes, you need to find a way to detect when arrayIndex runs past the limit of the array and revert it to zero. The proper form to use would be:
Code:arrayIndex++ ; if ( arrayIndex >= [colorArray count] ) arrayIndex = 0 ;
arrayIndex++;
arrayIndex %= [colorArray count];
arrayIndex = (arrayIndex+1) % [colorArray count];
Just because I love mod:
Code:arrayIndex++; arrayIndex %= [colorArray count];
-Lee
EDIT:
or
Code:arrayIndex = (arrayIndex+1) % [colorArray count];
I'm not saying these are better or clearer than Sydde's examples, I just love mod.
arrayIndex = ( ( ( arrayIndex + 1 ) >= [colorArray count] ) ? 0 : arrayIndex + 1 ) ;
To really confuse the issue, one could also write
Code:arrayIndex = ( ( ( arrayIndex + 1 ) >= [colorArray count] ) ? 0 : arrayIndex + 1 ) ;
so in other ways NSUInteger is not a object there fore it can not be assigned a pointer to it. so take off the "*" and i should be all set.