I'm trying to get to grips with Objective-C, having programmed in Java and C in the past.
I have a class, Unzip, which contains the following method:
- (void)unzipFile:(NSString*)fileName
I'm trying to call this method from the AppDelegate class, to respond to a button click, using the following code, which creates an instance of Unzip and calls the unzipFile method with a string value, but nothing happens.
- (IBAction)unzipIt:(id)sender {
NSLog(@"Unzip clicked");
NSString *zipString = [_testField stringValue];
NSLog(@"Calling unzip with the string %@", zipString);
Unzip *unzip;
[unzip unzipFile:(zipString)];
}
The actual button click works, because the two initial NSLogs appear, but nothing further happens. The method is fine as I've tested it elsewhere so at least something should happen. Could anybody please tell me where I'm going wrong?
Thanks for your time.