Hey all,
I am trying objcetive-c and iphone sdk so I am creating a navigation app that has a list of people w/ pictures. When I click on the view button it loads up the next view and should pass along the picture and name of the person. The second view loads up fine but done not pass along the picture or name. Could anyone help to figure this out.
here is the code that handles the button pressed event.
here is the setDetails method code.
the first log in the setDetails function returns the right value but the second log returns null.
Thanks in advance
I am trying objcetive-c and iphone sdk so I am creating a navigation app that has a list of people w/ pictures. When I click on the view button it loads up the next view and should pass along the picture and name of the person. The second view loads up fine but done not pass along the picture or name. Could anyone help to figure this out.
here is the code that handles the button pressed event.
Code:
- (IBAction)buttonPressed:(id)sender {
PeopleDetailsViewController *detailView = [[PeopleDetailsViewController alloc] initWithNibName:@"PeopleDetailView" bundle:nil];
[detailView setDetails:PersonOneImage.image name:@"John Doe" status:@"On the train"];
[self.navigationController pushViewController:detailView animated:YES];
[detailView release];
}
here is the setDetails method code.
Code:
@interface PeopleDetailsViewController : UIViewController {
IBOutlet UIImageView *personImage;
IBOutlet UILabel *personName;
IBOutlet UILabel *personStatus;
}
- (void)setDetails:(UIImage *)personPic name:(NSString *)Name status:(NSString *)Status;
@end
- (void)setDetails:(UIImage *)personPic name:(NSString *)Name status:(NSString *)Status {
personImage = [[UIImageView alloc] initWithImage:personPic];
personName.text = Name;
personStatus.text = Status;
NSLog(@"Person's name is: \"%@\" and their status is: \"%@\"", Name, Status);
NSLog(@"The Name Label is:%@", personName.text);
}
the first log in the setDetails function returns the right value but the second log returns null.
Thanks in advance