Objective-C Quick Syntax Reference by Matthew Campbell

Objective-C Quick Syntax Reference by Matthew Campbell

Author:Matthew Campbell
Language: eng
Format: epub, mobi, pdf
ISBN: 9781430264873
Publisher: Apress


Method Forward Declarations

Methods also need forward declarations. While properties describe an object, methods represent actions that an object can take. Here is how you would add a forward declaration to the Project class:

#import <Foundation/Foundation.h>

@interface Project : NSObject

@property(strong) NSString *name;

-(void)generateReport;

@end

Method forward declarations start with the minus sign followed by the return type in parenthesis. This method has a void return type, but you can have any datatype or class as a return type for a method.

After that is the method’s signature, which I will talk more about once you see a method that includes parameters. Here is an example of a method that includes parameters:

#import <Foundation/Foundation.h>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.