According to the docs the designated initializer should always be called, however when I try to get the blood type of user without having the permissions an NSError
is created but its designated initializer (- [NSError initWithDomain:code:userInfo:]
) is never called.
The code I'm using is:
HKHealthStore *healthStore = [[HKHealthStore alloc] init];
HKBloodTypeObject *bloodType = [healthStore bloodTypeWithError:&error];
NSLog(@"Blood type: %@, error: %@", bloodType, error);
Obs: I know that the designated initializer is not being called because I've swizzled it. Other methods like - [NSFileManager contentsOfDirectoryAtPath:error:]
behave as expected.
Why is it happening? Am I missing something? Should I open a radar?