Back to Basics

After some more reading I find myself a bit lost and wishing to go back through some of the things I have read. So I put together this review of sorts summarizing the things I read which I am certain will serve as a great cheat sheet afterward.

//defining the structure of the class
#include "stuff"
@interface ClassName : SuperClassName
{
    variableTypes stateVariables;
}
//functions go here
@end

//building the structure of the class
#include "theInterface"
@implmentation Class
//functions implemented
@end

//running the main routine to execute logic
#include "stuff"
int main (int argc, char *argv[])
{
    NSLog(@"printing out to the console");
    return 0;
}
//variables used same way as in C/Java
int aVariable;

//objects are declared and initialized
NSObject anObject = [[NSObject alloc] init];
//they are freed by
[anObject dealloc];

//functions go this way
methodIdentifier (returnType)functionName:(parameterType)parameterName selector:(parameterType)parameterName
{
    return somethingOfReturnType;
}
//functions are called
[anObjectTakingMessages functionName:argument selector:argument];

That’s all I can think of being basic for now. I will update this posts if I think up some more things that should be considered basic.

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s