This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MyViewController.m | |
#import “ZPAlertView.h” | |
#import “MyViewController.h” | |
@implementation MyViewController | |
- (void) doLengthyOperationPrompt { | |
enum { | |
ButtonIndexCancel = 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation NSTableView (Reordering) | |
- (void) moveRowsWithOldObjects:(NSArray*)oldObjects newObjects:(NSArray*)newObjects | |
{ | |
NSMutableArray* oldSortedArray = [oldObjects mutableCopy]; | |
NSArray* newSortedArray = newObjects; | |
[self beginUpdates]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Makes the text in an NSTextFieldCell vertically centered. Works with single line, non-editable cells. | |
// Maybe doesn't work with others. | |
// Stolen from this stackoverflow question: | |
// http://stackoverflow.com/questions/1235219/is-there-a-right-way-to-have-nstextfieldcell-draw-vertically-centered-text | |
import Cocoa | |
class VerticallyCenteredTextFieldCell: NSTextFieldCell { | |
override func titleRect(forBounds rect: NSRect) -> NSRect { |