It would be helpful to see the output in xcode's debugger console window. Usually when you get a crash, there is some extra information available from the debugger console (open with command-shift-R, or Run > Console in the menu). If there was an exception that caused the crash, it will say which one. In any case, you can type bt
(for backtrace) right after a crash and see the call stack when the crash occurs.
In your particular case, it's possible that you've accidentally released the UIScrollView
object, but still have a pointer to where the old deallocated object was. This would give you a crash on the next call to any method in UIScrollView
, and since zoomScale
is a getter accessor, it counts as a method call. The most obvious symptom of this problem would be an EXC_BAD_ACCESS
exception in the debugger console when the crash occurs.