Alex Rivera | Logout

How to check whether a NSPoint lays inside a NSRect

Asked 2009-04-06T10:49:29.757
26

I've created a mutable array containing NSRect values. I want to check whether the NSPoint I created is within this rectangle. What is the best way to do this in cocoa.

Edit
Report

1 Answer

2

A valid question because not everyone realises that there are a great many helper functions provided in the Foundation NSRect Extensions Reference file which save you having to re-invent the wheel all over the place.

Have a quick read through the reference to see all the different places it can help. I found it very useful when starting out.

answered 2009-04-06T11:42:55.540

Your Answer