0

I made a project with Xcode 9 beta and now for release it I have to use Xcode 8 for archiving and releasing,but when try to build with Xcode 8,some error accord. I have an enum that works correctly in Xcode 9,but Xcode 8 can not recognize members of that.

enum TestAcceptionStatus:Int {
case pricePending = 1
case payReady
case payed
case testerPending
case admissionRegistration
case testerDetail
case sampleRegistration
case answered = 20 }

this is the error image:

this is the error image

so, can anybody help me !!

2 Answers2

0

I found answer. Just should unwrap statusType from switch condition. this may be an Xcode bug,because statusType is not an optional but when I added ! at the end of statusType,errors disappeared.

-1

Try this:

    let i : Int = 4
    switch i {
    case TestAcceptionStatus.pricePending.rawValue:
        print("1")
    case TestAcceptionStatus.payReady.rawValue:
        print("2")
    case TestAcceptionStatus.payed.rawValue:
        print("3")
     .
     .
     .
    default:
        print("0")
    }
Monika Patel
  • 111
  • 5