Coding

macOS Monterey

macOS 12 Monterey and User Interface Inconsistencies

Details matter, but they are getting lost. At Apple I worked on the main User Interface (UI) framework called AppKit for about 13 years. I would help enforce UI consistency in applications by logging bugs... [read more]
Apple, Cocoa, Coding

FermentationTracker – Tracking Beer Fermentation with a Tilt

I’ve been brewing beer for the past few years, and it is a lot of fun. As a programmer, I want to play around with code to track data. One of the things that frustrated... [read more]
Cocoa, Coding

Implementing [NSCell copyWithZone:] in Swift to Avoid Crashes in AppKit

Quick Summary If you add a Swift property to an NSTextFieldCell subclass and you may suddenly start getting random crashes! Implement an override of [NSCell copyWithZone:] that retains any properties to fix this: Gory Details... [read more]
Apple, Cocoa, Coding

The Sad State of Logging Bugs for Apple

You find a bug in macOS or iOS. Something in the software isn’t working the way it should work. You decide to let Apple know, and head over to http://bugreport.apple.com and login with your Apple ID.... [read more]
Apple, Cocoa, Coding

Updated WordPress Theme for 2018

After many years, I finally updated my theme for WordPress.
Apple, Coding

Hosting WordPress Locally on macOS for Theme Development

Whenever I want to refresh my Wordpress website design I like to host the entire site locally on my Mac so I can freely develop things without affecting my live website.
Apple, Coding
no_thumbnail

Code Reviews, Part 2: When to do them, and how to avoid them

Part 1 discussed why you should not be doing code reviews. Part 2: When to do code reviews and how to not do them. If you are creating mission critical code, then by all means: have... [read more]
Cocoa, Coding
no_thumbnail

Code Reviews, Part 1: Don’t do them.

You probably don’t need to be doing code reviews. Have confidence in the code you write, and understand it well. Click through to read all the details on why.
Cocoa, Coding
no_thumbnail

Arduino: Tricks for fast Bluetooth LE data transfers

I’ve been using the Adafruit LE friend to do some data transfer tests. With the basic setup, I was sending 1 kB of data in about 9.5 to 10 seconds. That is horribly slow! About... [read more]
Cocoa, Coding

WWDC 2015: Improving the Full Screen Window Experience

For the past 10 years I’ve given a talk at every Apple World Wild Developer Conference (WWDC). Well, except for one. That was 2007 when I was busy working on UIKit for the iPhone 1.0.... [read more]
Apple, Cocoa, Coding
no_thumbnail

SD Card errors with Arduino / Teensy 3.0

With my LED cyr wheel I kept getting random errors in reading data from my SD card with Ardunio code. Sometimes init would fail, even at half speed. Most often I would get corrupted data,... [read more]
Coding, General

NSTableView Tips: Doing Animations with Core Data

For my “Cyr Wheel Pattern Editor” app I am using CoreData and an NSTableView. However, I’m sort of “manually” doing bindings for the array content itself to get animations in the View Based NSTableView. Here’s... [read more]
Cocoa, Coding

NSTableView Tips: View Controller per row

Sometimes you may find your application has rather complex rows, and you want an NSViewController to manage each row in a “View Based” NSTableView. This is fairly easy to do, and I did it in... [read more]
Cocoa, Coding

NSTableView Tips: Not delaying the first responder

I have a little home-brew Cocoa app for making Cyr Wheel patterns. The UI is built with an NSTableView and looks like this: Now normally when you try to directly click on one of the... [read more]
Cocoa, Coding
no_thumbnail

Implementing delete in an NSTableView

I’ve seen many ways to implement delete in an NSTableView. Many are good. Many hardcode references to something they shouldn’t, and those are bad. Here’s an easy way: Subclass NSTableView and override keyDown: - (void)keyDown:(NSEvent... [read more]
Cocoa, Coding
no_thumbnail

Why the API? NSTableView -preparedCellAtColumn:row:

I think I’ll do a few articles on why certain API was introduced in Leopard. I’ll start with one of the new methods in NSTableView: /* Returns the fully prepared cell that the view will... [read more]
Apple, Cocoa, Coding

Cocoa programmers: avoid writing to the user defaults when you don’t need to

[Edit: ecto ate this post, so I’m typing it in again!] I discovered that a lot of applications will unnecessarily write to NSUserDefaults. This causes your app to hit the disk when it shouldn’t, and... [read more]
Cocoa, Coding
no_thumbnail

Getting rid of the undo warning in Xcode after saving

One of the most annoying dialogs in Xcode is the undo warning dialog you get when attempting to undo after a save. I do this all the time, and I hate the warning. Luckily, there... [read more]
Cocoa, Coding

Your most important breakpoint in Cocoa

…..drumroll please…and it is…is: objc_exception_throw. You should always have this breakpoint setup in any Cocoa or Cocoa Touch app that you are building. How do you do it? In Xcode, Run -> Show -> Breakpoints... [read more]
Cocoa, Coding

Xcode code completion and your code

How can you become a faster Cocoa programmer? One way is to adequately name your variables, enums and classes. Let’s start with enums and take an example from something new to NSTableView in Leopard. This... [read more]
Apple, Cocoa, Coding

WWDC 2008

WWDC 2008! Howdy to my fellow Cocoa Developers. Take a look at the conference schedule: http://developer.apple.com/wwdc/schedules/ and be sure to come to my talk! Tuesday at 10:30 AM, iPhone for Mac Developers. If you have... [read more]
Apple, Cocoa, Coding
no_thumbnail

Cocoa: willDisplayCell delegate method of NSTableView, [NSCell setTextColor], and “source lists”

Mac OS 10.5 added a “source list” highlighting style to NSTableView, with the API below for your reference: enum { NSTableViewSelectionHighlightStyleRegular = 0, NSTableViewSelectionHighlightStyleSourceList = 1, }; typedef NSInteger NSTableViewSelectionHighlightStyle; – (NSTableViewSelectionHighlightStyle)selectionHighlightStyle; – (void)setSelectionHighlightStyle:(NSTableViewSelectionHighlightStyle)selectionHighlightStyle; Source... [read more]
Apple, Cocoa, Coding
no_thumbnail

Overriding shortcut keys in the NSOpenPanel or NSSavePanel

It recently came up where someone needed to override some of the default shortcut keys in the NSOpenPanel or NSSavePanel. This is quite trivial to do. First off, the “easy way” would be to add... [read more]
Apple, Cocoa, Coding
no_thumbnail

Leopard: PhotoSearch demo app now live

PhotoSearch, a demo app I wrote for WWDC a few years ago, is now live: http://developer.apple.com/samplecode/PhotoSearch/ It demonstrates some cool custom cell stuff that is only available on Leopard.
Apple, Cocoa, Coding
no_thumbnail

Instruments on Leopard: How to debug those random crashes in your Cocoa app

Update: Sept 9, 2009: Mac OS 10.6 Snow Leopard now has this feature built into Instruments! In Xcode, choose “Run -> Run with Performance Tool -> Zombies”, and repeat your steps that cause the crash.... [read more]
Apple, Cocoa, Coding
no_thumbnail

New Leopard user features – Open and Save Panels

Leopard, the new Mac OS 10.5, is out! There are a lot of new features, but not everything is mentioned on the features page. Here are some of the cool “power user” features which you... [read more]
Apple, Cocoa, Coding

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.

53 queries. 0.576 seconds.

Log in