for (NSUInteger i=0; i<4; i++)

this should be (0..3)