Objective-C Cocoa utility functions/methods I can't live without
Objective-C Ruby
Permalink
Failed to load latest commit information.
Tests Added MYAction Sep 3, 2015
vendor/google-toolbox-for-mac Add missing files (for MYNetwork) Jun 19, 2012
CollectionUtils+Old.h Converted many of the files to ARC. Pruned old stuff out of Collectio… Jun 7, 2015
CollectionUtils+Old.m Converted many of the files to ARC. Pruned old stuff out of Collectio… Jun 7, 2015
CollectionUtils.h CollectionUtils, MYBlockUtils: Added MYNoEscape attribute Jun 27, 2016
CollectionUtils.m CollectionUtils, MYBlockUtils: Added MYNoEscape attribute Jun 27, 2016
ConcurrentOperation.h Add missing files (for MYNetwork) Jun 19, 2012
ConcurrentOperation.m Add missing files (for MYNetwork) Jun 19, 2012
ExceptionUtils.h Oops: Declaration of MYBreakpoint needs "(void)" param list May 5, 2016
ExceptionUtils.m MYExceptionUtils: Updated alert code to remove deprecated API calls Apr 16, 2016
LICENSE.txt Create LICENSE.txt Nov 19, 2014
Logging.h New logging implementation: MYLogging Feb 24, 2016
Logging.m Changed return type of MYLoggingCallback from void to BOOL Oct 27, 2015
MYAction.h Added MYAction Sep 3, 2015
MYAction.m Added MYAction Sep 3, 2015
MYAnonymousIdentity.h Changed MYGetCertificatePublicKeyDigest to MYGetCertificateDigest Jan 5, 2015
MYAnonymousIdentity.m MYAnonymousIdentity: Fixed new Xcode 8 compiler warning Jul 21, 2016
MYBackgroundMonitor.h -[MYBackgroundMonitor endBackgroundTask] now returns BOOL Feb 8, 2016
MYBackgroundMonitor.m -[MYBackgroundMonitor endBackgroundTask] now returns BOOL Feb 8, 2016
MYBlockUtils.h CollectionUtils, MYBlockUtils: Added MYNoEscape attribute Jun 27, 2016
MYBlockUtils.m Added #errors if not compiling with ARC Apr 16, 2016
MYBuffer+Zip.h Added MYZip and MYBuffer+Zip Apr 27, 2015
MYBuffer+Zip.m Updated copyrights & licenses in comments. May 13, 2015
MYBuffer.h Updated copyrights & licenses in comments. May 13, 2015
MYBuffer.m MYBuffer: Make sure input stream is open before reading Jun 11, 2015
MYData.h Fixed bug in MYLengthOfVarUInt Apr 10, 2015
MYData.m Minor changes to MYData and MYErrorUtils for MYLogging compatibility Feb 24, 2016
MYDynamicObject.h MYDynamicObject: Workaround for handling Swift-class-valued property … Jun 19, 2015
MYDynamicObject.m MYDynamicObject: Needs to #import "MYLogging.h" Mar 15, 2016
MYErrorUtils.h MYErrorUtils: Added .my_failingURL Jun 15, 2016
MYErrorUtils.m MYErrorUtils: Added .my_failingURL Jun 15, 2016
MYLogging.h New logging implementation: MYLogging Feb 24, 2016
MYLogging.m MYLogging: EnableLogTo() now supports "Verbose" and "Debug" suffixes May 5, 2016
MYReadWriteLock.h MYReadWriteLock: Doc-comments and additional error checking Oct 23, 2014
MYReadWriteLock.m MYReadWriteLock: Doc-comments and additional error checking Oct 23, 2014
MYRegexUtils.h Fixed some copyrights. Nov 12, 2013
MYRegexUtils.m MYErrorUtils: Added NSError.my_compactDescription Feb 26, 2016
MYStreamUtils.h Updated copyrights & licenses in comments. May 13, 2015
MYStreamUtils.m Converted many of the files to ARC. Pruned old stuff out of Collectio… Jun 7, 2015
MYURLHandler.h Fixed some copyrights. Nov 12, 2013
MYURLHandler.m Fixed some copyrights. Nov 12, 2013
MYURLUtils.h MYURLUtils: Added .my_sanitizedPath Jun 28, 2016
MYURLUtils.m MYURLUtils: Restored iOS 7 / macOS 10.9 support Jul 14, 2016
MYUtilities.xcconfig Removed some obsolete build settings from the xcconfig file Apr 23, 2014
MYUtilities_Debug.xcconfig First commit into git. A subset of the files in Mercurial revision 31… Jan 26, 2012
MYUtilities_Prefix.pch Add missing files (for MYNetwork) Jun 19, 2012
MYUtilities_Release.xcconfig First commit into git. A subset of the files in Mercurial revision 31… Jan 26, 2012
MYZip.h Added MYZip and MYBuffer+Zip Apr 27, 2015
MYZip.m Updated copyrights & licenses in comments. May 13, 2015
ObjDelta.h Made MYDynamicObject work with object types that include protocol names Feb 19, 2015
ObjDelta.m Made MYDynamicObject work with object types that include protocol names Feb 19, 2015
README.md License clarification and some updates. Nov 19, 2014
Target.h Updated copyright years. Sep 18, 2013
Target.m Updated copyright years. Sep 18, 2013
Test.h New logging implementation: MYLogging Feb 24, 2016
Test.m Added #errors if not compiling with ARC Apr 16, 2016
Test_Assertions.m Added #errors if not compiling with ARC Apr 16, 2016
setObjToARC.rb Added -[Target retainTargets]. Added setObjToARC conversion utility. May 29, 2013

README.md

MYUtilities

Objective-C utilities for Cocoa programming on Mac OS X and iPhone

by Jens Alfke jens@mooseyard.com

These are useful things I've built over the years and can't live without. All of this code is released under a BSD license; see the file LICENSE.txt.

(This Git repo is a continuation of the earlier Mercurial repo at Bitbucket.org, which is by now quite out of date.)

The core parts are:

CollectionUtils

A grab-bag of shortcuts for working with Foundation classes, mostly collections. Some of it has been made obsolete by the recent addition of Objective-C object literal support, but there's still a lot of useful stuff.

Logging

Everyone seems to build their own logging utility; this is mine. The main nice feature is that you can log different categories of messages, and individually enable/disable output for each category by setting user defaults or command-line arguments. There's also a separate Warn() function that you can set a breakpoint on, which is itself a lifesaver during development.

Test

My own somewhat oddball unit test system. I like being able to put unit tests in the same source file as the code they test. The tests run at launch time (if a command-line flag is set) not in a separate build phase. You can set dependencies between tests to get some control over the order in which they run. The output is IMHO easier to read than SenTest's.