Reputation: 32207
I've read recently that iOS is "message" based. Is that similar to an "event"-based lingo?
Could I technically send a "touch notification" to a UIButton
and expect the UIButton
to process the event/message as though I had actually touched the button? Is this how things work behind the scenes? I'm just trying to grasp how much messages and events are similar (or not).
Upvotes: 2
Views: 149
Reputation: 7348
To answer your question, yes you can simulate a touch notification similar. http://cocoawithlove.com/2008/10/synthesizing-touch-event-on-iphone.html
Messages, however, are not the same in any way to events. Events are things that happen whereas messages are simply "commands" sent to objects. These messages can tell an object to do something or simply notify the object that something has happened.
Events are tightly tied to the design of the application whereas messages are more hands-off, "Hey object I'm just letting you know this message.." and the object can then do as it pleases. This provides an infrastructure for separation of concerns. My object only handles what it is in charge of and throws messages to other objects when needed. Make sense?
Upvotes: 4