Replaced cast from pointer to int with NSInteger