Link to home
Start Free TrialLog in
Avatar of thenrich
thenrich

asked on

uiPickerview tap gesture no longer works in iOS 7

Here is my code:

-(IBAction)txtInd:(id)sender{
    inProjectField=NO;
    inIndField=YES;
    inTaskField=NO;
    pvProjects.hidden=YES;
    curInd = @"";
    txtInd.text=@"";
    [TaskArray removeAllObjects];
    txtTask.enabled=NO;

    UIPickerView *picker = [[UIPickerView alloc]
                            initWithFrame:CGRectMake(-45, 290, 410, 270)];
    picker.delegate = self;
   
    myGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(indirectTap:)];
   
   
    [myGR setNumberOfTapsRequired:1];
    [myGR setNumberOfTouchesRequired:1];
    [picker addGestureRecognizer:myGR];
   
   
   
    picker.backgroundColor = [UIColor lightGrayColor];
   
    picker.transform= CGAffineTransformMakeScale(.7f, .7f);
    [picker selectRow:0 inComponent:0 animated:YES];
    picker.showsSelectionIndicator=YES;
    picker.userInteractionEnabled=YES;
   
   [self.view addSubview:picker];
    pvProjects = picker;
    [pvProjects release];
   
}

Never makes it here:
-(void)indirectTap:(id)sender{

    pvProjects.hidden=YES;
    lblBidHrs.text=@"";
    lblActualHrs.text=@"";
    [TaskArray removeAllObjects];
    txtTask.backgroundColor= [UIColor whiteColor];
    if ([curInd isEqualToString:@"-none-"]){
        txtInd.text = @"";}
    else{
        txtInd.text = curInd;
        txtProject.text = @"";
        txtTask.text =  @"";
    }
    [self playTone];
     [self.view endEditing:YES];
}

Worked fine up until the 7.1 update?
ASKER CERTIFIED SOLUTION
Avatar of darbid73
darbid73
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial