Asked 30+ days ago
7 Jul 2017
Views 154
jaman

jaman posted

comparison between pointer and integer ('int *' and int) in iOS objective c

initialisation

     int *selectedType;

trying to save selected picker view row to selectedType integer

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
    
     
         selectedType =   &row;
[self  showdata]
    }
-(void)Showdata{

        if(  selectedPaymentType == 1 || selectedPaymentType == NULL){
//other code goes here 
}
}


on selecting the picker view . application crash

i can see warning at code .
comparison between pointer and integer ('int *' and int)



Post Answer