I'm calling an Objective-C method in my swift 2.3 code in Xcode 8.2 (build target 8.0). It accepts an NS_ENUM as a parameter:
typedef NS_ENUM(NSUInteger, MLCMultipleChoiceSlideSubtype) {
MLCMultipleChoiceSlideSubtypeQA,
MLCMultipleChoiceSlideSubtypeFillInTheBlank,
MLCMultipleChoiceSlideSubtypeUnknown
};
The .h file containing this enum and method is in my bridging-header.h file. This is the signature of the objc method:
+ (nullable instancetype)slideWithSubtype:(MLCMultipleChoiceSlideSubtype)subtype testSlide:(nonnull TestSlide *)slide distractorFinder:(nonnull MultipleChoiceDistractorFinder *)distractorFinder;
Then I call it from Swift 2.3 like this:
if let mcSlide = MultipleChoiceSlide(subtype: .QA, testSlide: slide, distractorFinder: distractorFinder) {
return mcSlide
}
This works fine when I compile it for debug and run it. However, when I try to archive it and compile for release, I get this message:
... LessonConvertToMultipleChoiceOperation.swift:55:64: Static member 'QA' cannot be used on instance of type 'MLCMultipleChoiceSlideSubtype'
I have no idea why this only happens when I archive the build or what to do to fix it.
Edit: Based on answers to similar problems I saw elsewhere, I changed the archive build configuration from Release to Debug in my scheme, and now it archives. This doesn't seem like a good thing to do however. Will the archive contain my debug symbols by doing this?