How do I detect memory leaks?
You may use the command line tool named dtrace, or you may use the tool integrated in Xcode 3.0+ called Instruments. It is described briefly here:
What is Cocoa?
Cocoa is the name of an object oriented framework, or class library, originally written by a company named NextStep, now owned by Apple Computer.
What is Objective-C?
Objective-C is an object-oriented programming language that is an extension to the C programming language.
What is "The Book" ?
"The Book" refers to Aaron Hillegass' "Cocoa Programming for Mac OS X", now in its third edition. This forum is to discuss the contents of The Book, its challenges, errors, and needed updates. At the time of this writing Xcode is at version 3.1.1 and Hillegass' third edition predates that release, so some discrepancies exist.
What is Cocoa Touch?
Cocoa Touch is Apple's Objective-C framework for programming the iPhone. Cocoa Touch is based on Cocoa, however, Cocoa Touch is not completely identical. While some features from Cocoa are not included in Cocoa Touch, other features are added to utilize the unique capabilities of the iPhone.
Do I need to know C?
Yes. If you do not know the C programming language, learn that first.
self = [super init]; // memory leak?
Can anyone explain why this is not a memory leak?
@implementation MyDocument
- (id)init
{
self = [super init]; // memory leak?
if (self)
{
// Add your subclass-specific initialization here.
// If an error occurs here, send a [self release] message and return nil.
}
return self;
}
// rest of auto-generated coded deleted for brevity
@end
Aaron Hillegass' "Cocoa Programming For Mac OS X"
This site has no association with Aaron Hillegass or his outstanding book "Cocoa Programming For Mac OS X" ( up to third edition, at the time of this writing ), other than the fact that I have purchased a copy of this great book.
Welcome Message to New Members
Welcome to The Cocoa Forum! The purpose of this forum is to give programmers a place to discuss Apple's Cocoa and Cocoa Touch frameworks. This involves understanding of Objective-C and Mac OS X.