I’m guessing this must be new functionality as this code fail on my iOS4 device, works fine on iOS5. I need this to work on both. I haven’t moved to iOS5 yet as I still need to support iOS4, so I’m at a loss as how to workaround this ?
static dispatch_once_t oncePredicate;
dispatch_once(&oncePredicate, ^{ //EXC_BAD_ACCESS
_sharedStoreManager = [[super allocWithZone:nil] init];
});
It’s from https://github.com/MugunthKumar/MKStoreKit/blob/master/MKStoreManager.m
dispatch_once()is not new with iOS 5.0, it’s been around since 4.0. I use it all the time in applications that target 4.0, such as in this singleton from one of my frameworks:From Apple’s documentation:
I’m guessing your problem exists within the
-initof your _sharedStoreManager. For example, is there a reason why you are using-allocWithZone:there?