I am working on an application (Cocoa/Objective-c) where I have the blueprint of each floor of a building. I need to be able to clic开发者_C百科k on any room, and print some data about that room. I would also want to highlight the rooms on mouseover. I have no ideea on how to start doing any of this, so any help is appreciated.
Thanks
NSView which I assume is how your handling your UI is a subclass of NSResponder. Which handles all the user events like mouse movements and clicking.
See Apple's documentation of the class http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSResponder_Class/Reference/Reference.html#//apple_ref/occ/cl/NSResponder
And here is an Apple guide to event handling http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/EventOverview/Introduction/Introduction.html#//apple_ref/doc/uid/10000060i
精彩评论