NSRange is just a C. structure. I want to create a temporary in lldb in Xcode at a breakpoint.
In particular, for use in the NSArray method objectAtIndex:inRange:
This does not work.
(lldb) expr NSRange $tmpRange = (NSRange){0,4} (lldb) expr $tmpRange (NSRange) $tmpRange = location=0, length=4 (lldb) expr -o -- [items indexOfObject:item4 inRange:$tmpRange] error: no matching constructor for initialization of 'NSRange' (aka '_NSRange') error: 1 errors parsing expression
My code has an NSRange var named badRange at the breakpoint and passes it to work. Thus:
(lldb) expr -o -- [items indexOfObject:item4 inRange:badRange] 0x7fffffffffffffff (lldb) expr badRange (NSRange) $1 = location=0, length=3
What's happening?
Thanks.
source share