I have the following code in my application:DidFinishLaunchingWithOptions:
where I attempt to set tab bar tint colour:
UIColor *colour = [UAColors getSeasonalColour];
self.tabBarController.tabBar.tintColor = colour; // SIGABORT here
[colour release];
getSeasonalColours
is:
+(UIColor *)getSeasonalColour {
UIColor *seasonalColour = 0;
if ( [UADates isSpring:[NSDate date]] )
seasonalColour = [UIColor greenColor];
else if ( [UADates isSummer:[NSDate date]] )
seasonalColour = [UIColor blueColor];
else if ( [UADates isAutumn:[NSDate date]] )
seasonalColour = [UIColor orangeColor];
else if ( [UADates isWinter:[NSDate date]] )
seasonalColour = [UIColor redColor];
else
seasonalColour = [UIColor blackColor];
return seasonalColour;
}
Right now UADates
is only a stub that returns true for isWinter
.
Why would this cause a crash? Using the same getSeasonalColours
works perfectly fine when I set the tintColor
on a navigation bar.
colour
in the offending line with[UIColor redColor]
? This should help isolate the problem. – PengOne