batoulapps / adhan-swift

High precision Islamic prayer time library for Swift
MIT License
185 stars 46 forks source link

Issue with Singapore Method - Objective C code #25

Closed ghost closed 5 years ago

ghost commented 5 years ago

There is an issue with Singapore method in objective C code in the latest release, can you please check and fix it as soon as possible.

Thread 1: Fatal error: unexpected enum case 'BACalculationMethod(rawValue: 11)'

z3bi commented 5 years ago

Can you please post the code you’re using.

ghost commented 5 years ago
BACalculationParameters *params;
    NSDateComponents *date = [cal components:NSCalendarUnitDay|NSCalendarUnitMonth|NSCalendarUnitYear fromDate:prayerTimesDate];
    if ([countryCode isEqualToString:@"SG"])
    {
        params = [[BACalculationParameters alloc] initWithMethod:BACalculationMethodSingapore];
    }

This code works fine with Adhan 1.0.2 but not with 1.1.0

z3bi commented 5 years ago

I am unable to reproduce this error. Please try doing a clean build and see if that helps. In version 1.1.0 a new calculation method was added, so it looks like you're code is somehow initing a case that it doesn't have, perhaps because the old enum is still cached.

ghost commented 5 years ago

@z3bi

It works after clean build. Thank you for the quick response.