[Solved] Crash when trying to access [NSCursor hotpot] and [NSImage size]
Posted: Wed Jun 13, 2018 11:01 pm
I'm working with [NSCursor] and I'm trying to get hotspot and image size information. I've successfully extracted PNG image data of the cursor and return that to LCS. I am getting crashes when I try to access the [NSCursor hotSpot] and [NSImage size]. No crash report is generated so there isn't much to go on.
Here are the docs for [NSCursor hotSpot]:
https://developer.apple.com/documentati ... guage=objc
I've defined NSPoint as follows:
I've defined the foreign handler as follows:
I define a variable for NSSize as follows:
Then I put it all together to try and get the hotSpot:
(tCursor is valid as that is the variable I use to get the cursor image.)
Here is the line in my code that causes the crash:
https://github.com/trevordevore/lc-maco ... r.lcb#L107
Any ideas?
Here are the docs for [NSCursor hotSpot]:
https://developer.apple.com/documentati ... guage=objc
I've defined NSPoint as follows:
Code: Select all
public foreign type NSPoint binds to "MCAggregateTypeInfo:ff"
Code: Select all
private foreign handler ObjC_NSCursorHotspot(in pCursor as ObjcId) \
returns NSPoint \
binds to "objc:NSCursor.-hotSpot"
Code: Select all
variable tSize as NSSize
Code: Select all
put ObjC_NSCursorHotspot(tCursor) into tHotspot
Here is the line in my code that causes the crash:
https://github.com/trevordevore/lc-maco ... r.lcb#L107
Any ideas?