I would greatly appreaciate any help with this code. Yes it is from the Stanford course exercises. I am new to Objective c though I am not new to programming. I passed the half million debugged lines of code somewhere around 2005. If you have purchased a used car in the southeast in the 80's 90's and 2000's there is a good chance the finance man used software I wrote. I'm just telling this so you know I have a small bit of experience as a programmer.
My problem is I can't get anything to display in the UIImageView.
here's the code:
I put a break in the setPhoto method and all of the variables are ok. But nothing displays.
My segue seems ok and gets called.
The connections to the imageview appear to be correct.
If anyone sees a reason why this displays nothing I'd be very happy to get some guidance.
I'm stuck here now for over a week and I have nobody local to ask for help.
Thank you
My problem is I can't get anything to display in the UIImageView.
here's the code:
Code:
#import "PhotoImageViewController.h"
#import "FlickrFetcher.h"
@interface PhotoImageViewController () <UIScrollViewDelegate>
@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@end
@implementation PhotoImageViewController
@synthesize photo = _photo;
@synthesize imageView = _imageView;
@synthesize scrollView = _scrollView;
NSURL *photoURL;
-(void)setPhoto:(NSDictionary *)photo{
_photo = photo;
photoURL = [FlickrFetcher urlForPhoto:photo format:FlickrPhotoFormatLarge];
NSLog(@"%@",photoURL);
NSData *data = [[NSData alloc] initWithContentsOfURL:photoURL];
UIImage *tmpImage = [[UIImage alloc] initWithData:data];
[self.imageView setImage:tmpImage];
}
-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{
return self.imageView;
}
-(void)viewDidLoad{
//self.scrollView.delegate = self;
[super viewDidLoad];
//self.scrollView.contentSize = self.imageView.image.size;
}
I put a break in the setPhoto method and all of the variables are ok. But nothing displays.
My segue seems ok and gets called.
The connections to the imageview appear to be correct.
If anyone sees a reason why this displays nothing I'd be very happy to get some guidance.
I'm stuck here now for over a week and I have nobody local to ask for help.
Thank you
Last edited by a moderator: