The reason for this is that the view is archiving its color (which is
nil), then setting it after your initWithFrame:. Now, I'm sure what I
just said doesn't make any sense, because Interface Builder doesn't
allow you to change the background color (so why is it archiving it?).
The reason is that Atlas does, which is why its being encoded and
decoded. If you were in Atlas, it would make sense that if you set the
color to "red" in the inspector you wouldn't want it to change
afterwards just because you are setting the default color in
initWithFrame:. There is a very simple workaround for this:
- (void)awakeFromCib
{
[self setBackgroundColor:whatever];
}
awakeFromCib is for things that should happen *after* the properties
that are set by the user.