Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Chapter 13 using label and textfield help

I am trying to make button that when pressed takes the text in a text field and updates a lable
then using the persistence code in chapter 13 I am trying to make it save that display label so that everytime the app is opened the label loads the  Text into it and the user can go change that label by typing text into the text field and submitting it again

However with the NSArray IBoutletCollection  keybaord dismissing no longer works... and I cant figure out how to do this.
Any help would be appreciated as I have been at this over 6 hours and cant get it to work



// Load User Persistent Data
    NSString *filePath = [self dataFilePath];
    if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
    {
        NSArray *array = [[NSArray alloc] initWithContentsOfFile:filePath];
       // for (int i = 0; i < 4; i++) {
            UITextField *theField = self.displayLabel[0];
            theField.text = array[0];
    //}
   
    UIApplication *app = [UIApplication sharedApplication];
    [[NSNotificationCenter defaultCenter]
     addObserver:self
     selector:@selector(applicationWillResignActive:)
     name:UIApplicationWillResignActiveNotification
     object:app];




I made my label an IBoutlet Collection so that the text field now can use  resignResponder and dismiss the keybaord
Any help would be appreciated

Sorry my code is all over Im so brain fried right now


Comments

  • I went back to change my code as I may have found a way to do it but I cant edit the post any more....
    I wont post new under myself as it gets to messy
    Can I change my post or delete it?
Sign In or Register to comment.