I have a view controller with a BOOL property (not a pointer) which I assumed would be NO or just garbage seeing as though it doesn't get assigned in viewDidLoad. The BOOL gets assigned when it is needed. When the view controller gets deallocated (I'm using arc) and later recreated, if the previous instances value of that BOOL was YES (before the VC was deallocated) then the initial value of the new instances BOOL variable will also be YES. Finding this very strange.
- Property declared (nonatomic, assign)
- It's not set in viewDidLoad, set elsewhere in an action method
- Not changed in dealloc
I know this is strange, in the meantime I've set the appropriate default values in viewDidLoad.
UPDATE
Bearing in mind this was happening with the BOOL as an iVar (I changed it to a property) and the comparison was made before the BOOL was assigned. I'm putting the strange behaviour down to that.