UIScrollView crashes when delegate not nilled with ARC

Originator:heath.borders
Number:rdar://12575794 Date Originated:25-Oct-2012 04:14 PM
Status:Open Resolved:
Product:iPad SDK Product Version:Version 4.5.1 (4G1004)
Classification:Serious Bug Reproducible:Always
 
25-Oct-2012 04:14 PM Heath Borders:
Summary:

Since UIScrollView's delegate is weak, it should not be necessary to explicitly nil it before the delegate is dealloced.

Steps to Reproduce:
Run the attached project, observe the crash.
To observe the workaround, rerun the project with WORKAROUND 1 defined.

Expected Results:
No crash

Actual Results:
Crash in objc_msgSend because UIScrollView is trying to message its deallocated delegate.

Regression:

Notes:


25-Oct-2012 04:14 PM Heath Borders:
'UIScrollViewDelegateNilCrash.zip' was successfully uploaded

Comments

Nevermind, this is expected behavior because the delegate is assign, which means "unsafe_unretained" to ARC.

By heath.borders at Oct. 25, 2012, 9:50 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!