hi i’m studying iOS programming.
i have a trouble to use UITextView.
i made a project and open viewController.xib
i dragged in UISearchBar, UITextView and UILabel
and my viewController is followed UISearchBarDelegate
i want to change textView.text’s contents but it doesn’t.
here’s my code.
-(void)viewDidLoad
{
[super viewDidLoad];
self.mySearchbar.delegate = self;
}
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
[searchBar resignFirstResponder];
self.myLabel.text = @"hoho";
self.myTextview.text = @"hoho";
}
when i clicked search bar and typing any character and return,
myLabel’s text is set to hoho.
but myTextview.text doesn’t set. no effect.
why is that?? i’m confused.. please help me
Did you link up the Outlet in Interface Builder? In IB, click File’s Owner, select Outlets on the right pane, link myTextview to the UITextview you put on the view?
Also, since you are calling “self” I assume you created a property for myTextview as an IBOutlet in your .h file?