简体   繁体   中英

-[UIViewControllerWrapperView frame]: message sent to deallocated instance getting Crash in IOS7

My project is made for IOS5 and 6. After IOS7 launch we are upgrading our project for IOS7 also.But i am facing one issue in IOS7.

When i install my app first time in IOS7 simulator ,it's getting crash with following message.

*** -[UIViewControllerWrapperView frame]: message sent to deallocate

But below IOS7 it's working fine. Thanks

OS 7 did change some rules concerning tableviews and their delegate. Of course, this is not highlighted somewhere easy to find.

But basically, in earlier version of iOS, you could nil out tableView delegate and datasource optionally. Not doing so was not sending any error message.

From iOS 7, you MUST nil them in your dealloc otherwise it can lead to this crash.

- (void)dealloc
{
fetchedResultsController.delegate = nil;
self.searchDisplayController.delegate = nil;
self.searchDisplayController.searchResultsDelegate = nil;
self.searchDisplayController.searchResultsDataSource = nil;
self.tableView.delegate = nil;
self.tableView.dataSource = nil;    
}

Let me know if this solved your issue.

The apple changed the hierarchy of classes . So, UiSearchbar subviews in iOS6 and iOS7 are different. Below the iOS7 UiTextField is the subview of the UiSearchBar directly ,But in iOS7 UiSearchBar's subview is UIView and Then UITextField is the subView of UIView.

So same code was not working and crashing in iOS7.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM