Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception raised using rx_didChangeAuthorizationStatus #89

Closed
kjf opened this issue Aug 9, 2015 · 6 comments
Closed

Exception raised using rx_didChangeAuthorizationStatus #89

kjf opened this issue Aug 9, 2015 · 6 comments
Labels

Comments

@kjf
Copy link

kjf commented Aug 9, 2015

I'm just wrapping my head around the whole Rx thing so apologies if this is something of my own doing.

My viewDidLoad method looks something like this:

  override func viewDidLoad() {
    super.viewDidLoad()

    locationManager.rx_didChangeAuthorizationStatus
      >- subscribeNext() { status in
        println(status)
      }
      >- disposeBag.addDisposable
  }

Upon execution an exception is raised inside the rx_didChangeAuthorizationStatus CLLocationManager extension.

Could not cast value of type '__NSCFNumber' (0x7fe523b6b0b8) to 'C.CLAuthorizationStatus' (0x102105250).

Using swift 1.2 and iOS SDK 8.4

@kzaher
Copy link
Member

kzaher commented Aug 9, 2015

Hi @kjf,

I'm looking at the code, and I think you are right, this looks like a bug.

We are casting to AnyObject as! CLAuthorizationStatus and I think compiler will need our help there.

AnyObject -> Int -> CLAuthorizationStatus

@kzaher
Copy link
Member

kzaher commented Aug 12, 2015

Hi,
the fix should be in develop branch right now

commit c4b392c
Author: Krunoslav Zaher krunoslav.zaher@gmail.com
Date: Wed Aug 12 19:37:07 2015 +0200

Fix for #89 (CLAuthorizationStatus casting crash)

I've tried to confirm does it work, let me know if it doesn't :)

@kjf
Copy link
Author

kjf commented Aug 12, 2015

Just tested and it's working great for me. Thanks!

@kzaher
Copy link
Member

kzaher commented Aug 12, 2015

I'm preparing a small patch release end week. So it will be released then ;)

Let me know if you find anything else.

@kjf
Copy link
Author

kjf commented Aug 12, 2015

Awesome, will do.

@kzaher
Copy link
Member

kzaher commented Aug 17, 2015

I've released 1.9.1

This should be fixed there :)

@kzaher kzaher closed this as completed Aug 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants