Re: [MacRuby-devel] MacRuby pointers and Obj-C function returning a alue by reference

2013-01-21 Thread Watson
Hi Maybe, you could write your code as following: $ macirb --simple-prompt >> framework 'AppKit' => true >> range = Pointer.new(NSRange.type) => # >> range.assign NSMakeRange(0,1) => # >> str = NSAttributedString.alloc.initWithString("hello") => hello{ } >> str.attribute(NSUnderlineStyleAttribute

Re: [MacRuby-devel] MacRuby pointers and Obj-C function returning a value by reference

2013-01-21 Thread stephen horne
I've only ever made ranges in the past using this syntax: range = NSMakeRange(0,1) Which allows you to set the start point and length. On 21/01/2013, at 22:08, "kwic...@wichry.net" wrote: > I am trying to implement the following method of NSAttributedString in > Macruby: > > - (id)attri

[MacRuby-devel] MacRuby pointers and Obj-C function returning a value by reference

2013-01-21 Thread kwic...@wichry.net
I am trying to implement the following method of NSAttributedString in Macruby: - (id)attribute:(NSString *)attributeName atIndex:(NSUInteger)index effectiveRange:(NSRangePointer)aRange As by definition, it `Returns the value for an attribute with a given name of the character at a given index,