Problem getting textfield.text from other view controller
        Posted  
        
            by wesleydyson
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by wesleydyson
        
        
        
        Published on 2010-03-28T15:07:11Z
        Indexed on 
            2010/03/28
            15:13 UTC
        
        
        Read the original article
        Hit count: 149
        
Hey guys, I'm trying to add a textfield.text entry to an array. I want to pull the textfield.text from a text field in another view. Here's my code.
- (void)addBookmark{
MultiViewViewController *mainView = [[MultiViewViewController alloc] init];
if (mainView.addressTextField.text.length>1) {
NSString *addedString = [[NSString alloc] initWithFormat:@"%@", mainView.addressTextField.text];
[bookmarksArray addObject:addedString];
NSLog(@"addBookmark being called %@", mainView.addressTextField.text);
}
[bmTableView reloadData];
}
The NSLog says the mainView.addressTextField.text is (NULL). What am I doing wrong?
© Stack Overflow or respective owner