We all love Siri’s little witty quips, but I recently read a heartwarming article over on Mashable that reflects the power of technology to change lives in ways that most of us would never appreciate. I won’t spoil
After developing iPhone applications for a while you tend to develop some ‘must have’ pieces of code that you use on all of your apps. Being able to share the code on multiple projects is great but having the code duplicated among many projects is very annoying, especially if you make an update, you would need to change all files to reflect the changes. Of course you could just reference the same source files from all your apps, but this can cause conflicts when other developers try to pull the project from the repo as the path to the source files has probably changed. It’s time to make a Framework, a compiled binary of your source that can be included in your projects, keeping the source in one place.
Objective C categories are great for extending classes, however if you want to override methods then you’re going to have some problems as you can no longer call the method on your original class owns, usually breaking a lot of functionality the higher up the class food chain you travel (try this on NSObject‘s init, return nil). If you called the same method on self you would end up with an infinite loop, and calling super will skip the original class completely.