Sushil Kumar
Sushil Kumar

Reputation: 130

-[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

Upvotes: 4

Views: 1115

Answers (2)

Vizllx
Vizllx

Reputation: 9246

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.

Upvotes: 1

Sushil Kumar
Sushil Kumar

Reputation: 130

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.

Upvotes: 0

Related Questions