OK, I'm looking to try and give something back to the Mac community by helping out on some of the open-source projects and wish to learn Cocoa with Objective-C. I've been working my way through the tutorials posted at cocoadevcentral.com but I've come across some syntax that I have no idea what its significance and no where have I seen it explained. For your information I'm coming to Cocoa and Objective-C from a Java background and my first experience of C has been the tutorials that I've worked through.
Anyway, the issue that I have is that I keep seeing the asterisk symbol appearing in method and variable declarations, as illustrated in the following example:
What the heck does that asterisk mean for the instance variables? Equally, the same sort of thing shows up in method invocations, such as the following:
Much of everything else that I have read about the Objective-C language and the tutorials that I have performed make sense but this eludes me at the moment so can someone put me out of my misery? Thanks.
Anyway, the issue that I have is that I keep seeing the asterisk symbol appearing in method and variable declarations, as illustrated in the following example:
Code:
#import <Cocoa/Cocoa.h>
#import "Converter.h"
@interface ConverterController : NSObject
{
IBOutlet NSTextField *amountField;
IBOutlet Converter *converter;
IBOutlet NSTextField *dollarField;
IBOutlet NSTextField *rateField;
}
- (IBAction)convert:(id)sender;
@end
What the heck does that asterisk mean for the instance variables? Equally, the same sort of thing shows up in method invocations, such as the following:
Code:
NSArray * foo = SomeFunctionReturningAnNSArray();
NSMutableArray * bar = [foo mutableCopy];
[foo release];
Much of everything else that I have read about the Objective-C language and the tutorials that I have performed make sense but this eludes me at the moment so can someone put me out of my misery? Thanks.