[textview resignfirstresponder] is not working its gets crashed app.... i have a about button on main view and ib action for that is (IBAction)About_Click:(UIButton *)sender{
CGRect textFieldFrame = CGRectMake(5,10, 380,440);
UITextView *textView = [[UITextView alloc] initWithFrame:textFieldFrame];
[textView setTextColor:[UIColor blackColor]];
[textView setFont:[UIFont systemFontOfSize:20]];
textView.text = @"\n \n Now is the time";
[textView setBackgroundColor:[UIColor orangeColor]];
CGRect frame = CGRectMake(50.0,10.0, 100.0, 40.0);
UIButton *BackButton = [[UIButton alloc] initWithFrame:frame];
[BackButton setTitle:@"Button" forState:UIControlStateNormal];
[BackButton setTitleColor:[UIColor blackColor] forState:UIControlEventTouchDown];
BackButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
BackButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
[BackButton addTarget:self action:@selector(Back) forControlEvents:UIControlEventTouchUpInside];
[BackButton setBackgroundColor:[UIColor blackColor]];
[self.view addSubview:textView];
[textView addSubview: BackButton];
}
i want to write code for ib action of back button which is present on this text view ,i want to come back to my main view when i press this ....