Cocoa

no_thumbnail

[NSColorPanel isContinuous] and [NSColorWell isContinuous]

A quick comment about these two properties: [NSColorPanel isContinuous] and [NSColorWell isContinuous]. Generally, you want these two things to be in sync. Whenever the color changes in the NSColorPanel, the color in the NSColorWell will... [read more]
Apple, Cocoa, General
no_thumbnail

Xcode shortcuts to finding a file.

Cocoa Developers: While programming with Xcode, I’ve developed several habits to make me a faster programmer. I’ll share these tidbits with you. 1. Use Cmd-Shift-D to quickly open files that you know the names to.... [read more]
Apple, Cocoa, General
no_thumbnail

Cocoa: NSArrayController and two tableview’s

Hi Cocoa Developers, Tip of the day: Don’t bind two NSTableView’s to a single NSArrayController instance. Bugs will happen! More specifically, attempting to multi-select rows will not work properly — the two tableviews will fight... [read more]
Apple, Cocoa, General
no_thumbnail

Cocoa: Targeting the entire tableview in a drop operation

Hi Programmers. If you are doing drag and drop in an NSTableView with Cocoa, you can use the following method in your “validateDrop” datasource method to retarget the row it is going to: – (void)setDropRow:(int)row... [read more]
Apple, Cocoa, General
no_thumbnail

Cocoa: drop down menu buttons

In Cocoa, it is pretty easy to use an NSButton that creates a drop down menu. One of the key-tricks to making it appear to be an NSPopUpButton is to set the [NSCell sendActionOn:]. Generally,... [read more]
Apple, Cocoa, General
no_thumbnail

Cocoa: Creating a custom Color Picker in Cocoa. Part 1.

It is pretty easy to create a custom Color Picker that is available in any application, or for just your particular app. It isn’t difficult to do, but there are some caveats that you must... [read more]
Apple, Cocoa, General
no_thumbnail

Cocoa: Using NSPredicate and NSMetadataQuery

Hi Apple Cocoa developers. Here are some more tips and tricks for Cocoa development. On Tiger, there is a new class called NSMetadataQuery that allows you to do some cool Spotlight searches. See the “Spotlighter”... [read more]
Apple, Cocoa, General
no_thumbnail

Cocoa: Disappearing headers in CoreData generated TableViews

Apple Cocoa developers: Finally another blog entry for you! Everyone else: You may want to skip this one… It has come to my attention that some NSTableView instances created by dragging CoreData objects into Interface... [read more]
Apple, Cocoa, General
no_thumbnail

Removing sort descriptors on a sorted NSTableView / NSOutlineView

I’ve discovered that some people may want to programatically remove the sort descriptors for their tableview: This is easy to do with a little code: - (IBAction)removeSorting:(id)sender { [tableView setSortDescriptors:[NSArray array]]; } However, you may... [read more]
Cocoa, General
no_thumbnail

Cocoa only feed

One of the great things about WordPress is that you can subscribe to the feed that you are intersted in. For instance, if you just interested in Cocoa stuff, you can just watch this feed.... [read more]
Apple, Cocoa, General
no_thumbnail

Yet another way to make connections in Interface Builder (IB)

Some of IB’s features aren’t readily apparent. Most people know about the mode to switch from icon to text by clicking the icon in the lower right hand section seen in this image: But, when... [read more]
Cocoa, General
no_thumbnail

NSOutlineView, reloading items, and the expansion state

NSOutlineView requires all of the items in it to be pointer unique. If they are not, strange things happen. However, they can be equal (meaning [NSObject isEqual] may return YES). However, there is a small... [read more]
Apple, Cocoa, Other Stuff
no_thumbnail

Cmd – click. The subtle secret of Mac OS X.

It seems that a lot of people don’t know how cmd click works in a lot of Mac OS X Cocoa applications. To put it simply, Cmd-clicking on a non key window (or application for... [read more]
Cocoa, General
no_thumbnail

Drag and Drop in an NSTableView

Drag and Drop in an NSTableView is easy to do. However, I think the documentation (Table Views: Using Drag and Drop in Tables) for it isn’t particularly great. It misses a few points, so I’m... [read more]
Cocoa, General
no_thumbnail

Dynamically populating an NSPopUpButtonCell in an NSTableView

It is quite common. You have a PopUpButton (NSPopUpButtonCell) in an NSTableView and you want to dynamically change the contents based on the selected row: How do you do this? There are a few tricky... [read more]
Cocoa, General
no_thumbnail

Different cells on each row in an NSTableView or NSOutlineView

Some people have asked me how to dynamically change the cell that is displayed for each row in an NSTableView or NSOutlineView. Generally, the same cell is used for each row, but it is possible... [read more]
Cocoa, General
no_thumbnail

Debugging OCTest bundles

Another old article: June 20, 2005 Debugging OCTest bundles To debug OCTest bundles: 1. Add a new executable to your Xcode project pointing it to “otest” at /Developer/Tools/otest 2. Double click on the executable, and... [read more]
Apple, Cocoa, General
no_thumbnail

Repost: How to find memory leaks in Cocoa apps with Object Alloc

(The original of this I accidentally killed — here is a copy). If your Cocoa application leaks memory, here is a way to find those leaks! 1) Open your application in Object Alloc 2) Start... [read more]
Apple, Cocoa, General
no_thumbnail

Changing the disclosure triangle in an NSOutlineView

At WWDC I was asked how to remove the disclosure triangle in an NSOutlineView. Well, first things first. You can change it with this bit of code in your delegate: - (void)outlineView:(NSOutlineView *)ov willDisplayOutlineCell:(NSButtonCell *)cell... [read more]
Apple, Cocoa, General
no_thumbnail

Tooltips for NSTableView cell’s in Tiger

At WWDC, I quickly mentioned how easy it is to add tooltip’s to an NSCell for an NSTableView/NSOutlineView. Here is a quick snippet of code on how to do this only if the text doesn’t... [read more]
Apple, Cocoa, General
no_thumbnail

Drawing a “mail like” border on items in an NSTableView

Mail has a cool way of making unread messages stand out. It is really easy to do this type of thing with NSTableView/NSOutlineView. Subclass the one you want, and override drawRow. Toss in the code... [read more]
Apple, Cocoa, General

Subscribe to new posts:

You'll get an email whenever a I publish a new post to my blog and nothing more. -- Corbin

As an Amazon Associate I earn from qualifying purchases.

(c) 2008-2024 Corbin Dunn

Privacy Policy

Subscribe to RSS feeds for entries.

48 queries. 0.219 seconds.

Log in