Assign inputAccessoryView to UIViewController causes Memory Leak

Originator:guime.sprint
Number:rdar://18541143 Date Originated:10/03/2014
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 8.0.2
Classification:Serious Bug Reproducible:Always
 
Summary:
When you add a custom inputAccessoryView to the UIViewController, somehow the inputAccessoryView (or a subobject) holds a strong reference to the UIViewController that originated the call. This causes a retain cycle and the View Controller never gets released.

Steps to Reproduce:
1. Create a UINavigation based app
2. Create a UIViewController on the second level of the stack.
3. Assign a custom inputAccessoryView to the UIViewController
> - (BOOL)canBecomeFirstResponder
>{
>    return YES;
>}
>
>- (UIView *)inputAccessoryView
>{
>    return self.accessoryView;
>}
4. Run the app and navigate to that screen
5. Navigate back, to pop the view controller

Expected Results:
The UIViewController should get popped and dealloc after that.


Actual Results:
It's not what happens. - dealloc is never called, and UIViewController remains in Memory.

Version:
iOS 8.0.2

Notes:


Configuration:
iPhone 5s, or Simulator 8.0

Attachments:

Comments


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!