[MacRuby] #417: can't access vCardRepresentation.bytes of ABPerson
#417: can't access vCardRepresentation.bytes of ABPerson -------------------------------------+-------------------------------------- Reporter: vilandgr@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: pointer -------------------------------------+-------------------------------------- I tried to get the vCard representation of an ABRecord, but got an error that results in vm termination. To reproduce the error try the following steps: {{{ user ~ $ macruby -v && uname -a MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64] Darwin CoolMacBook.local 10.0.0 Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 i386 user ~ $ macirb irb(main):001:0> framework "addressbook" => true irb(main):002:0> ab = ABAddressBook.sharedAddressBook => #<ABAddressBook:0x2003817a0> irb(main):003:0> ab.people.first.vCardRepresentation.bytes Assertion failed: (ValueType->getTypeID() != VoidTyID && "Pointer to void is not valid, use i8* instead!"), function get, file Type.cpp, line 931. Abort trap }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/417> MacRuby <http://macruby.org/>
#417: can't access vCardRepresentation.bytes of ABPerson -------------------------------------+-------------------------------------- Reporter: vilandgr@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: pointer | -------------------------------------+-------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.5 Comment: I suspect you are using MacRuby 0.5 beta1. This bug has been fixed in trunk since a few days (you can install the latest nightly build from http://macruby.icoretech.org/): {{{ $ macruby -e "framework 'AddressBook'; p ABAddressBook.sharedAddressBook.people.first.vCardRepresentation.bytes" #<Pointer:0x2003768c0> }}} Note that this returns you a Pointer instance, which behaves like an Array of bytes. If you want to save the data on disk I recommend using the NSData object. -- Ticket URL: <http://www.macruby.org/trac/ticket/417#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby