Expected method to read array element not found on object of type 'NSArray *'

509 Views Asked by At
+ (UIColor*)hll_backgroundColorForIndex:(NSUInteger)index
{
index = index % [self hll_backgroundColors].count;
UIColor *color = [self hll_backgroundColors][index];

NSAssert(nil != color, @"nil color");
return color;
}

this is my code showing error at [self hill backgroundColors][index]

1

There are 1 best solutions below

0
Pascal On

Is the array empty? Log it with NSLog(). Plus, I would put [self hll_backgroundColors] in an array variable within the method, I don't know whether you do some magic in the getter method.