Cocoa
[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]
Feb
24
2006
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]
Feb
24
2006
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]
Feb
2
2006
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]
Feb
2
2006
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]
Jan
29
2006
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]
Jan
8
2006
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]
Jan
5
2006
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]
Jan
5
2006
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]
Nov
7
2005
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]
Oct
3
2005
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]
Sep
28
2005
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]
Sep
9
2005
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]
Aug
2
2005
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]
Jul
29
2005
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]
Jul
27
2005
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]
Jun
30
2005
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]
Jun
20
2005
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]
Jun
17
2005
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]
Jun
15
2005
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]
Jun
10
2005
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]
Jun
10
2005
As an Amazon Associate I earn from qualifying purchases.
(c) 2008-2024 Corbin Dunn
Subscribe to RSS feeds for entries.
48 queries. 0.219 seconds.