alexrothenberg / motion-addressbook

MIT License
89 stars 30 forks source link

Basic Picker example raises Cannot show two Pickers (RuntimeError) #64

Open ruckus opened 10 years ago

ruckus commented 10 years ago

Trying to get started with the gem and following along from the README I have:


    if AddressBook.request_authorization
      ab = AddressBook::AddrBook.new
      ab.picker(presenter: self) do |person|
        puts person
      end
    end

Running this does prompt me to authorize the AB and does present my contacts. Tapping on a Contact immediately crashes and the exception is:

(main)> 2014-06-15 20:20:57.237 Asq[61183:70b] picker.rb:7:in `show:': Cannot show two Pickers (RuntimeError)
    from addr_book.rb:107:in `picker:'
    from contact_picker_controller.rb:16:in `viewWillAppear:'
    from picker.rb:36:in `hide:'
    from picker:in `peoplePickerNavigationController:shouldContinueAfterSelectingPerson:'

Is there something else I am missing? Thanks.

ruckus commented 10 years ago

I am using the latest version of 1.7.2

jmay commented 10 years ago

I don't see this form of picker display in the README. I've been unable to reproduce this error condition in the simulator. Do any other approaches work for you? How about a very simple one-liner:

AddressBook::AddrBook.new {|ab| ab.picker {|p| puts p}}