From: Rolando Abarca Date: 2009-05-08T03:13:25+09:00 Subject: Re: storing c pointers in ruby hash No luck yet with this (still banging my head with the keyboard). After looking at swig source code and reading this: I realized that using a ruby hash was a bad idea. Although I had tested using a simple pointer, I changed the approach using a NSDictionary. I also added some debug output, and the VALUE I get back from the hash is the same, but If I call any function on that object, I get a crash: #0 0x000a56c6 in st_lookup (table=0x0, key=760, value=0xbfffe20c) at / Users/rolando/Documents/GFF/ShinyCocos/ruby/st.c:286 #1 0x00105702 in search_method (klass=92295000, id=760, klassp=0x0) at vm_method.c:229 #2 0x0010574c in rb_get_method_body (klass=92295000, id=760, idp=0xbfffe2b4) at vm_method.c:256 #3 0x00107f9d in rb_call0 (klass=92295000, recv=92302820, mid=760, argc=0, argv=0x0, scope=1, self=6) at vm_eval.c:205 #4 0x00107e4b in rb_call (klass=92295000, recv=92302820, mid=760, argc=0, argv=0x0, scope=1) at vm_eval.c:255 #5 0x00108273 in rb_funcall (recv=92302820, mid=760, n=0) at vm_eval.c:427 #6 0x000d1811 in sc_ruby_instance_for (hash=0x10622e0, obj1=0x5778810) at SC_common.h:86 ... should I fill a bug report? :-S I'll try to put a simple demo file to simplify the example (although the latest code that reflects this is in , you might need iPhone SDK to test it though). Thanks for any tip! -- Rolando Abarca M.