[MacRuby] #660: ER: Pointer needs a #cast for untyped pointers
#660: ER: Pointer needs a #cast for untyped pointers ---------------------------------------+------------------------------------ Reporter: joshua.ballanco@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------------+------------------------------------ We need a method to change the type of a Pointer object. For example: {{{ framework 'CoreData' NSPersistentStoreCoordinator.alloc.init ptr = NSPersistentStoreCoordinator.registeredStoreTypes[NSSQLiteStoreType].pointerValue puts ptr.inspect klass = ptr[0].migrationManagerClass puts klass.inspect }}} ...results in: {{{ #<Pointer:0x40074e420> undefined method `migrationManagerClass' for 40:Fixnum (NoMethodError) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/660> MacRuby <http://macruby.org/>
#660: ER: Pointer needs a #cast for untyped pointers ---------------------------------------+------------------------------------ Reporter: joshua.ballanco@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: | ---------------------------------------+------------------------------------ Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.6 Comment: I added the Pointer#cast! method in r3945 + specs in r3946. However in your case, I recommend using the following instead: {{{ framework 'CoreData' val = NSPersistentStoreCoordinator.registeredStoreTypes[NSSQLiteStoreType] klass = val.nonretainedObjectValue klass.migrationManagerClass }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/660#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby