Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- self.searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 44.0)];
- self.searchBar.placeholder = @"placeholder doesn't work in 7.1";
- [self.view addSubview:self.searchBar];
- self.button = [[UIButton alloc] initWithFrame:CGRectMake(0.0, 44.0, 100.0, 44.0)];
- self.button.backgroundColor = [UIColor redColor];
- [self.button setTitle:@"print text" forState:UIControlStateNormal];
- [self.button addTarget:self action:@selector(printSearchText) forControlEvents:UIControlEventTouchUpInside];
- [self.view addSubview:self.button];
- }
- - (void)printSearchText
- {
- NSLog(@"print nil here: %@", self.searchBar.text);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement