Search attached to tableview causes crash with storyboard after memory warning

Originator:tewha
Number:rdar://12092942 Date Originated:13-Aug-2012 11:52 PM
Status:Open Resolved:
Product:iPhone Product Version:5.1.1
Classification:Crash Reproducible:Always
 
13-Aug-2012 11:52 PM Steven Fisher:
Summary:
Search attached to tableview causes crash with storyboard after memory warning.

Steps to Reproduce:
1. Start a new project, using Master-Detail Application. Use Storyboards, exclude Core Data. ARC can be on or off.
2. Open the storyboard.
3. Drag a search bar & controller into the table view header.
4. Run.
5. Add a new row.
6. Tap the new row.
7. Choose Hardware->Simulate Memory Warning.
8. Tap the pop button in the navigation bar ("Master").

Expected Results:
App should function.

Actual Results:
Crash, log attached.

Regression:

Notes:
I'm attaching the project I built using steps 1-3.
These steps are specific to the simulator, but the same crash will occur if a memory warning occurs on the device. (There's no way to invoke a low memory warning on the device, so I haven't included details for that.)

13-Aug-2012 11:52 PM Steven Fisher:
'SearchCrash.zip' and 'SearchCrash_2012-08-13-235127_Steves-Home-iMac.crash' were successfully uploaded

Comments

Workaround

A workaround is to add your own strong searchDisplayController property, like this:

@interface MyViewController()

//* Workaround for Apple defect rdar://12092942
@property (strong, nonatomic) IBOutlet UISearchDisplayController *searchDisplayController;

@end

@implementation MyViewController
@synthesize searchDisplayController;
@end

Note that you CAN NOT use synthesize-by-default here, as it becomes @synthesize searchDisplayController = _searchDisplayController, and you'll get an error that you're trying to use the superclass's ivar. I believe this is another bug, in that under llvm 4.0 the synthesize-by-default ought to create an ivar with the same name in the subclass, in a way that doesn't interact at all with the superclass's.


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!