Karelia Software's Cocoa Open Source

A random collection of useful bits of Cocoa, as found in Watson and in other sundry Karelia applications and testbeds. Feel free to adapt these for use in your Cocoa applications.

Output a dictionary suitable for attaching to an HTTP request /Foundation_Categories/NSDictionary
"Flatten" a string of HTML, removing all HTML tags /Foundation_Categories/NSString
NSFileManager: Resolve an alias /Foundation_Categories
NSSet or NSArray: Show the contents as a comma-separated list /Foundation_Categories
NSColor: Instantiate from Web-like Hex RRGGBB string /Foundation_Categories
NSCalendarDate: Short description plus relative dates like Today, Yesterday /Foundation_Categories
NSFileManager: Get the path within the user's Library directory /Foundation_Categories
Simple checksum of a string /Foundation_Categories/NSString
Return the range of a substring, searching between a starting and ending delimeters /Foundation_Categories/NSString
Split a string into an array of lines; unicode-aware /Foundation_Categories/NSString
General search-and-replace mechanism to convert given substrings /Foundation_Categories/NSString
Strip out anything in the string that is not a digit /Foundation_Categories/NSString
Return the range of a substring, inclusively from starting to ending delimeters /Foundation_Categories/NSString
Remove lines from a text file that start with # /Foundation_Categories/NSString
Parse a TSV string into an array of dictionaries /Foundation_Categories/NSString
Encode a string legally so it can be turned into an NSURL /Foundation_Categories/NSString
General search and replace, replacing strings found between starting and ending delimeters. /Foundation_Categories/NSString
Return an NSString composed of the given single unicode character /Foundation_Categories/NSString
Convert a string into an attributed string that looks like a hyperlink -- blue and underlined. /Foundation_Categories/NSString
Return a non-nil string for the given key /Foundation_Categories/NSDictionary
bzip2 decompression and compression /Foundation_Categories/NSData
Parse data as a property list /Foundation_Categories/NSData
Truncate a string to a desired width, appending ellipses... /Foundation_Categories/NSAttributedString
NSScrollView subclass to insert a "placard" within the scrollbar area. /AppKit_Classes
NSBox subclass that just fills itself with white /AppKit_Classes
Parse some HTML data, and adjust the attributes /Foundation_Categories/NSData
NSComboBoxCell subclass to do auto-complete case-insensitively /AppKit_Classes
NSProgressIndicator subclass that hides itself when it's empty (not indeterminate, and a value of 0.0) /AppKit_Classes
NSMovieView subclass to put an NSMovieView in an NSDrawer /AppKit_Classes
NSImageView subclass to make sure a bitmap doesn't "blur" by being aligned to half pixels /AppKit_Classes
NSButton subclass that hides itself when it's disabled /AppKit_Classes
NSMovieView subclass to force movie to maintain proper aspect ratio /AppKit_Classes
NSView: Set and get a view's single subview /AppKit_Categories
NSBrowser: access its scroller /AppKit_Categories
NSImage: Normalize bitmap's size to 72DPI /AppKit_Categories
NSWorkspace: Return the user's temporary directory /AppKit_Categories
NSTabView: Return the tab view item with the given identifier /AppKit_Categories
Return an array of the selected rows /AppKit_Categories/NSTableView
NSWorkspace: Open a URL in the background (10.2) /AppKit_Categories
Get Ascending and Descending Sort indicator images, 10.1 and 10.2 compatible /AppKit_Categories/NSTableView



· Karelia Home