In OS X Lion Apple introduced the concept of document versions, the ability to go back in time on documents and view or restore a version from the past. With this they introduced a “Lock” on documents that hadn’t been changed in over a week or so and requires you to unlock the document or duplicate it and save it elsewhere.
In this tutorials I’ll show you the basics of taking screenshots on a range of devices including computers and tablets/smartphones. I’ll also show you some extra little tricks for taking a screenshot of only the content you want captured. Tutorial covers Windows, Mac, iOS and Androids.
When developing on the Mac and using custom frameworks in your application, when you compile the frameworks are copied into your applications bundle then linked at runtime. These frameworks will most likely be bundled up with their headers. Some of the frameworks you include may not be things you want to make public to the world, which you are essentially doing by including the headers with the framework.
In Xcode the build settings screen can be pretty daunting for some people, especially when you start iOS/Mac development. Knowing which settings to pick can be tricky, but I still see a lot of people that do this individually for each of their projects, which makes it easy to miss crucial build parameters you don’t want to distribute your app without. Using a .xcconfig file is extremely useful for solving this problem, it is a type of file for determining build parameters, meaning you can have this file sitting in one spot and have each of your projects referencing it. If you need to make a build setting change to all your projects, you can just add it to this one file and the next time you compile each of the projects the change will be taken into account.
In a project I’ve been working on recently I need to interact with other process’ windows on the Mac. The application lets you drag windows around that will ‘bolt-on’ to another application’s window and follow it around the screen
When using delegates in an object in Objective-C it is important that the delegate is only assigned within your object, and never retained. The reason for this is to prevent a retain loop, where two objects retain each other; they will never be released. The fix is simple, but can catch you off guard if you want to create an array or dictionary of delegates (using an NSDictionary or NSArray).
Many times during development I have needed to attach simple user info to objects in Objective-C, such as a table row, context info and other object pointers. Previously to achieve this I would subclass my target object’s class and add the variables needed to hold the extra information. This worked, but had a couple of problems.
So you’re coding away, everything is coloured nicely so you can distinguish between reserved words, datatypes and variables, but then the unthinkable happens; all your code turns black. Not to worry, you can live without the colours, but when you see the “symbol not found” message and Xcode is no longer autocompleting variables and functions for you, you start the panic. Your development time rolls to a halt and you can no longer quickly jump around from method to method. You realise Xcode has broken it’s intellisense index.
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.