Join GitHub today
Code Snippets to be used in iPhone projects http://en.ennowelbers.info/node/28
Fetching latest commit…
Cannot retrieve the latest commit at this time.
*** Code Snippets for iPhone Projects *** Copyright (c) 2010, Enno Welbers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *** Overview *** This is a small collection of code snippets in form of objective-C additions to existing classes. They are intended for iPhone projects. Here is a brief summary of all additions: 1. NSArray (SortArray) This addition adds an initializer to NSArray which generates an array containing a single NSSortDescriptor object. Very useful when it comes to core data. 2. NSSortDescriptor (Initializer) This adds a static initializer to reduce the alloc/init/autorelease lines. 3. NSString (ApplicationDirectory) Adds an initializer which returns a String containing the Documents Directory for the current application. One can also initialize a string containing the cache directory. 4. NSString (KeychainAdditions) Adds a few functions to interface the Keychain using NSString. Supports Keychain's internet account data type and allows to query, add and delete those accounts. 5. NSData (Base64Conversion) Adds functions to convert a binary stream to it's Base64 Counterpart and vice versa. 6. UIViewController (EasyConstructor) Provides a faster way to instantiate view controllers which are based on a sib.