Assignment 4 zooming and threads

33 views
Skip to first unread message

Brad Ringel

unread,
Apr 18, 2012, 9:04:27 AM4/18/12
to iphone-appd...@googlegroups.com
Hi all,

having some issues with the zooming requirement. I think that I probably have the algorithm set up properly in viewWillAppear, but the problem is that the lines are running out of order. because my imageView's bounds aren't really getting set until after the image loads, the zoom scale is always coming out as infinity. I spun all that off into a thread, which means that viewWillAppear is being called before that operation finishes, I can see that by NSLogging some things out. Did you run into this problem, how did you fix it?

Thanks

Harry

unread,
Apr 19, 2012, 3:31:33 PM4/19/12
to iphone-appd...@googlegroups.com

Hi Brad,


I'm not sure what you mean, "… lines are running out of order?"

You don't need to put the zooming on another thread. In fact I think that' s the wrong way to do it.

In any case, try to set the zoom scale to a number, like so:

self.scrollView.minimumZoomScale = 0.5;

self.scrollView.maximumZoomScale = 2;


Good luck 

Brad Ringel

unread,
Apr 20, 2012, 9:40:00 AM4/20/12
to iphone-appd...@googlegroups.com
To test it I put an NSLog in viewDidLoad and in viewWillAppear. basically, because the image is being downloaded on a thread, the bounds for the UIImageView aren't set so trying to calculate the zoom scale fails. Is there a way to get around this?
Reply all
Reply to author
Forward
0 new messages