Thursday, October 29, 2009

viewWillAppear


This is me right now: http://xkcd.com/621/

I've tried updating my blog on a regular basis and I fail. I'm just going to not commit on any level. But I'll post what I learned yesterday.

I was working on an iphone project and I needed to check a property list to see if a value existed, if it doesn't exist, I need to slide in a new modal view, add the information I need, then move the modal view out of the way and update the initial view with the data that was entered.

I learned about viewWillAppear. Basically it is called by the delegate whenever this....here it comes..."view will appear". Imagine that. In this case, I update the view to reflect the new data from the user. When the modal view goes away, the new data is updated.

- (void)viewWillAppear:(BOOL)animated {
NSLog(@"viewWillAppear in home table view controller");
[self updateMiniProfile:[NSDictionary dictionaryWithContentsOfFile:@"Profile.plist"]];
[super viewWillAppear:animated];
}


Seem's easy to you, but it's all greek to me still.