Eliminate compiler warning by casting NSInteger to int