This is free Cocoa source code written by David Sinclair of Dejal. Portions may be based on third-party code.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
You are welcome to use it in your own projects (including commercial), but please provide credit for used code in your documentation, website, or About window. I'd appreciate it if you'd let me know you use this code, too. See the source code for details of the license terms.
If you are registered as a member on this site, you can quickly access each page via the Navigation menu in the sidebar. Guests can navigate via the links at the bottom of each entry.
Read the Dejal Blog filtered for development topics for news of additions and changes.
These headers include some utility macros and #imports for the Dejal Cocoa categories, to easily include them all, if appropriate.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h attachments to view the source code, or the .zip file to download all of the categories in one archive.
Foundation-level categories.
Cocoa categories to extend NSArray and NSMutableArray, including object location, bulk insertion, toolbar helpers, and more.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSAttributedString and NSMutableAttributedString, mainly to provide more convenient class methods for various types of data.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSData. Just a couple of methods to make archiving an object slightly easier.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSDate and NSCalendarDate, including accessing and setting the date and time parts separately.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSDictionary and NSMutableDictionary, including methods to get and set bools, ints, floats, colors, etc, like NSUserDefaults has.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSFileManager, including convenience methods for file attributes, working with files, and gathering paths with certain attributes.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSObject, including performing selectors with various argument types and return values.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSString and NSMutableString. This includes lots of methods to make various string operations easier, for display, file paths, and more.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSUserDefaults, including getting and setting types like points and colors, managing a restore factory defaults feature for preferences windows, and managing login items.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
AppKit-level categories.
Cocoa categories to extend NSBezierPath, to draw rounded rects, triangles, gradients, etc.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSImage, including adding a badge to an image.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSMenu, including convenience methods for menu items with icons and represented objects.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSOutlineView, including managing selected items and more.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSPopUpButton, including adding items with tags, represented objects, and file paths.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSTableView, including pasteboard support, all/selected rows enumeration, table column utilities, sort descriptor utilities, custom header and cell helpers, and more.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSTextField, including prompt, value, and slider synchronization utilities.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSTextView, including attributes and selection utilities, convenience methods to append, get and set strings, attributed strings, and RTF data.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSToolbar, including getting and setting various attributes.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSView, including manipulating autoresizing masks, plus view scaling.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.
Cocoa categories to extend NSWindow, including fading in and out, and resizing so a subview has a specified size.
This code is compatible with Mac OS X 10.3 and later. Much of it dates from the pre-bindings etc days, so there may be better ways to do things now, but hopefully you will find some of these useful.
If you use them, I'd appreciate mention in your application credits or website, and let me know! If you have any improvements or bug fixes, I'd appreciate them, too.
Click on the .h and .m attachments to view the source code, or the .zip file to download them. Note: you can download all of the categories in one archive via the DSCategories page.