We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Matthew Nguyen was stuck when converting Obj-C code using sizeof() into RubyMotion. How should I translate: sizeof(CTTextAlignment) ?
Here is a little method to get around the problem
def sizeof(type) size_ptr = Pointer.new(:uint) align_ptr = Pointer.new(:uint) NSGetSizeAndAlignment(type, size_ptr, align_ptr) size_ptr[0] end sizeof(CTParagraphStyleSetting.type) # => 12 sizeof(CGRect.type) # => 16 sizeof(:float) # => 4
The details are in this thread on the RubyMotion Google Groups