Can NSString constants be weak linked? AVCaptureSessionPresetiFrame960x540
isn't defined prior to iOS 5. I avoid actually referencing it and it loads fine in gdb, but when I load an ipa, it seems to crash in dyld before ever invoking main.
The related question, Using Weakly Linked Framework's extern constants Crash, seems to say "no" and I've taken the same apporoach: using the string value directly.
Constants can be weak linked too. To test if the constant is available you must check if it’s address is not NULL
before you try to use it:
if (&AVCaptureSessionPresetiFrame960x540 != NULL) {
// Constant is available and can be used
}
Note the &
operator to take the address of the constant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With