Hi, i'm playing with two views and try to change one image in die second view, which is visible in first view. I found many tutorials with passing data between views, for example typing text in label (second view) and display it in a label in first view.
in my first view:
Code:
- (void)updateLabel
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
userInfoLabel.text = [defaults objectForKey:@"userInfoKey"];
}
and in second (IBAction):
Code:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *string = [[NSString alloc] initWithFormat:@"%@ %@\n%@", firstNameField.text, lastNameField.text, addressField.text];
[defaults setObject:string forKey:@"userInfoKey"];
[defaults synchronize];
[self dismissModalViewControllerAnimated:YES];
How can I change this code to get it working with images??