Categories: OS X, C++, Cocoa03/29/07Par Explorer: My First Open Source ProjectI have officially started my first open source project. It is a program called Par Explorer. What is Par Explorer? The purpose of it is to allow you to open a PAR or PAR2 file and view all the packets stored in it and the contents of each one. All it… more » 03/27/07Renaming Document Classes in CocoaI've been learning Cocoa on OS X lately. One of the things I've been experimenting with is document based applications. I've been working on an application that processes Par and Par2 files. So, in the process of developing this application, I needed… more » 02/28/07C++ Support in Objective-COk, this truly sucks.
Last night, I was playing with Objective C. I had written an O-C class and tried to include a C++ class as a member variable of the O-C class. Now, you would think this would be possible, since you can create Objective-C++ cla… more » 01/04/07Custom Delegates in CocoaA delegate is a kind of 'helper class' in Cocoa. Very often in Cocoa, you won't subclass a class, instead you'll just use the base class and register yourself as a delegate. This means that whenever interesting events happen in the base class, it calls… more » 01/03/07Exceptions in CocoaHere's how to do exceptions in Cocoa... It's nearly identical to C++ exceptions:
@try
{
// Do some code here that might throw an exception.
}
@catch( NSException* e )
{
// Log the exception.
NSLog( @"Exception: %@, %@", [e name],… more » XCode Tip #1: Quick Documentation LookupIn the XCode editor, if you hold down the Option key (which is the Alt key on PC keyboards) and double click a class name or method, it will look up that word in the API documentation. This is great way to look up the info on a class method. more » Mutexes in CocoaHere's how to do a mutex when writing a multithreaded Cocoa app. Use the NSLock class...
// In your class' header. (ClassName.h)
@interface ClassName: NSObject
{
NSLock* mutex;
}
// In your class' source. (ClassName.m)
@implementa… more » 12/29/06Displaying a File Open Dialog in Cocoa with Objective COk, so I've been learning Mac programming using Objective-C. I'm still a horrible rank amateur at this stuff, but here's one thing I've learned. Here is an example of how to display a modal File Open dialog box...
int i; // Loop counter.
// C… more » 11/17/06The First is Always the HardestI've been interested in programming on the Mac for a while - nearly since the day I bought my first Mac last year. Well after a year of off-again, on-again reading up on it, I've finally started working on my first small Mac application. As a programme… more » 06/21/05Cocoa vs. C#, Part 3: Memory Management in CocoaIn my previous blog, I covered how C# handles memory management. In this one, I'll explain how Cocoa handles memory management and why I feel it is a better way to do things than the C# way.
In C#, you allocate objects on the heap using the 'new' op… more » |