I have this method which gets called from a different class:
-(void)artworkInfo:(NSNumber *)pos{
[image setImage:(UIImage *)[[mainDelegate.mapAnnotations objectAtIndex:(NSUInteger)pos]image]];
[pos release];
}
I put debugger stop-points on all three lines. When debugging, just after the method is called and before setImage
is called, hovering the mouse over pos
in the method definition and in the setImage
line shows the correct value which was sent from the method call. But, when I advance in the debugger and the next line [image setImage...]
gets run hovering over both pos
s shows "Out of scope", and the app, therefore, does not display the image it should. Why does this happen?
EDIT: Well, it seems my issue may just be in how the method is called in the class, because even a hardcoded value is not producing the image in the method, but if I copy and paste that line into viewDidLoad:
, it does. Why would that line work in viewDidLoad:
, but not when it is called in the method it's in now?