Is it possible to override operator use in Objective-C?
For example
myClassInstance + myClassInstance
calls a custom function to ad
First, operator overloading is evil. Second, C doesn't have operator overloading, and Objective-C is a proper superset of C, which only adds a handful of keywords and a messaging syntax.
That being said, if you're using Apple's development environment, you can use Objective-C++ instead of Objective-C, which gives you access to all of C++'s mistakes and misfeatures, including operator overloading. The simplest way to use Objective-C++ is just to change the extension on your implementation files from ".m" to ".mm"