I\'ve just finished debugging an issue where an iOS Google Map (GMSMapView
) showed on some devices and in some iOS version simulators, but not others. It was odd t
I've had issues like this before between release and debug builds. There is some difference in timing between when weak references are nilled out, presumably because the debugger is holding on to references for some reason. I don't know the details of how ARC is implemented but it seems to be a fairly consistent pattern.
Directly assigning a newly created object to a weak reference is wrong - under the rules of ARC it would be instantly deallocated and nilled out, because nothing else has a strong reference to it.
This is the main reason I don't like to have view or IBOutlet properties set to weak - there is no need, since views don't get unloaded any more, and it just leads to subtle bugs like this.