Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Problem.

Hey guys looks like there is a problem in the ribbit app after we finish the ImageViewController and load the picture in to UIImageView for me the image does not load on to the screen. So i even typed the same code they typed in the tutorial. IF you guys know anything about it please reply ASAP

can you post the code for your imageView controller

1 Answer

  • (void)viewDidLoad { [super viewDidLoad];

    PFFile *imageFile = [self.message objectForKey:@"file"]; NSURL *imageFileUrl = [[NSURL alloc] initWithString:imageFile.url]; NSData *imageData = [NSData dataWithContentsOfURL:imageFileUrl]; self.imageView.image = [UIImage imageWithData:imageData];

    NSString *senderName = [self.message objectForKey:@"senderName"]; NSString *title = [NSString stringWithFormat:@"Sent from %@", senderName]; self.navigationItem.title = title; }

  • (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated];

    if ([self respondsToSelector:@selector(timeout)]) { [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(timeout) userInfo:nil repeats:NO]; } else { NSLog(@"Error: selector missing!"); } }

pragma mark - Helper methods

  • (void)timeout { [self.navigationController popViewControllerAnimated:YES]; }