iPhone noob - different method types?

Posted by codemonkey on Stack Overflow See other posts from Stack Overflow or by codemonkey
Published on 2010-06-08T01:21:09Z Indexed on 2010/06/08 1:32 UTC
Read the original article Hit count: 252

My apologies in advance for what is probably a really dumb question. I'm familiar (or at least getting familiar) with instance and class methods in objective-c, but have also seen method implementations that look like this:

#import "Utilities.h"
#import "CHAPPAppDelegate.h"
#import "AppState.h"

@implementation Utilities

CHAPPAppDelegate* GetAppDelegate() {
    return (CHAPPAppDelegate *)[UIApplication sharedApplication].delegate;
}

AppState* GetAppState() {
    return [GetAppDelegate() appState];
}

@end

What are these? While I'm sure this is documented somewhere, I don't know what term to use in searching for an explanation of what's being done here. I like the syntax methods like this let me use when calling them, but I'm not sure exactly what I'm doing, what the implications are, how to send parameters to these types of functions, etc?

To clarify how I ended up in this position, I started using these methods in a "utilities" class of mine after reading some online blog describing the author's preference for declaring these functions this way. Now I can't seem to track down a more detailed explanation of what exactly the differences are, etc.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c