I am new to this, so please dumb it down for me. I have been tinkering with Objective-C for an iPhone app and have hit a road block.
I am trying to pass the value contained in a variable (string) to a method but it doesn't work. I am guessing it is because the variable is probably a pointer to the value, not the value itself. I wonder if you can suggest how I fix.
Here is the method
- (UIImage *)newUIImageWithURLString:(NSString *)urlString
{
return [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]]];
}
Sending this message works ... Here I have hard coded the URL, being sent.
UIImage* newimage = [self newUIImageWithURLString:@"http://images.mydomain.com/PhotoServer/Thumb/97/83358897.jpg"];
This one doesn't ... Here the variable is being passed.I get an error that the passed value has no value.
UIImage* newimage = [self newUIImageWithURLString:newListing.ListingPhotoUrl];
I know it does have a value as the following does works.
self.ListingtitleLabel.text = newListing.ListingPhotoUrl;
Any thoughts?