Wednesday, 3 August 2011

iOS Coding 101 : Objective-C and the History

Hello world!

Need some help coding for the iOS? We will open an iOS, Java (Android), HTML, and JavaScript Coding 101 sections to help you out for your coding. We, personally, take coding as a brain squeezing time. Therefore, we would like to help out people for coding.

I will be helping you with the iOS coding using Objective-C. Alex Jeon will help you code Java, and Jeffrey will help you code both HTML and JavaScript.

Let's get started.

What's the history behind Objective-C?

NeXT computers were using Objective-C making the NeXTSTEP OS. Brad Cox and Tom Love developed a language which is an strict superset of C, which was called Objective-C. NeXTSTEP was developed by NeXT computers and Sun Microsystems. However, Sun Microsystems lost interest and gave up. The Sun Microsystems went on and made Java, which was greatly influenced by Objective-C and very similar. NeXT computers were bought by Apple and influenced the birth of the Mac OS.

So, what's the basic of Objective-C?

When you make a Hello World programme, you will use a code like this:

#import <Foundation/Foundation.h>

int main (int argc, const char *argv[]){
      NSAutoReleasePool *pool = [[NSAutoReleasePool alloc]init];
      //insert code here...
      NSLog(@"Hello world!");
      [pool drain];
      return 0;

I will go over the code line by line.

Line 1: #import <Foundation/Foundation.h>
    This imports the code that is stored in the Foundation.h file. Developers that developed the language have made this statement to lessen the anger of typing the same code over and over.

Line 2:  int main (int argc, const char *argv[])
           This line of code is a function header or a line of code that starts a function. Main is a function that tells the computer to start with this function. The code in the brackets insist that the function doesn't take any arguments and instead of writing all this, we can just replace it with void. 

Line 3:  NSAutoReleasePool *pool = [[NSAutoReleasePool alloc]init];
            This line of code creates a pool of memory that we are going to use to run this programme. A part of NSObject called NSAutoReleasePool points (symbol : *) at the object pool which means instead of using NSAutoReleasePool, we can now use pool to insist that it is NSAutoReleasePool. Inside the braces, NSAutoReleasePool allocates (alloc) some memory for the programme. Then it initialises (init) the allocation.

Line 5: //insert code here...
             This is called commenting. You can comment and put notes to remind you of what you're doing here. However, when the computer complies this to run the programme, it ignores your comments and will not take it. For example, you are building a game that has HUGE amounts of methods that you want it to do. We can make HUGE amounts of comments so that it reminds you what it's doing. Commenting with two forward slashes (//) indicates a one line comment and you cannot press enter to keep on commenting unless it's a different comment. However, if you use forward slash and a star (/*) you can comment on as many lines you want but it will need a ending point which is star and a forward slash (*/) **.

Line 6: NSLog(@"Hello World");
            This line of code logs words to show up. This means that if you see the programme running, it will show you Hello World. NSLog is a part of NSObject. 

Line 7 : [pool drain];
             This line of code drains the pool of memory we have been using to run the programme. This means that we're giving back the amount of memory we have used to run the programme back to the computer. Since we pointed that pool can be used for NSAutoReleasePool, we can use pool instead. 

Line 8 : return 0;
             This line of code asks for an integer back of the value 0. If the value other than 0 was returned, it means there was some kind of error somewhere. Thus, if the value 0 is returned, it means your programme went well.


1. Your statements are in curly braces ({ }). These statements tell your computer what to do.
2. Your statements end with a semi-colon (;). You must have these.

** Multiple line comment example: 





To see some videos to get better understanding, go here:

Setting up Xcode :
Explaining the Program :

[TheNewBoston is a YouTube teacher who teaches programming languages, etc.]

Tuesday, 26 July 2011

Dear Dr. Valerio..

Hello world!

This project was a hard project. Nonetheless, we wish to thank someone in advance to a teacher in SIS (the school Jeffrey and I go to).  Alex Jeon will post his separtely since he has moved to USA.

Letter to Dr. Valerio:
"Dear Dr. Valerio,

Your encouragement of coding and exciting social studies led me and Jeffrey Park to making a big project—at least in our thoughts—called Stay Wired In.

When I teamed up with Jeffrey, it was actually called Debate With You. It was a social network where you debate about a topic. However, we thought—who would want to come in like Facebook or Twitter just to debate? Or rather, who would want to debate at all if they aren't in a debating class or have an interest in it?

Thus, Jeffrey came up with an idea of Stay Wired In, where it gathers all the current news from CNN, TechnoBuffalo, Yahoo News, etc. I said it was great. I think now Jeffrey and I are integrating the love of social studies and technology to be a part of the internet network society. Thank you with all our might for teaching us the best social studies class so far.

Stay Wired In CEO, Jeffrey Park and Stay Wired In CEO and CFO, Kyung Phil Ko"

(Letter written by Kyung Phil Ko)

About Stay Wired In

Hello world!

We are fellow Korean middle schoolers from an international school. Well, we've like to tell you that we are introducing a website called Stay Wired In. We have not published it on the WWW. Jeffrey Park and Kyung Phil Ko have come up with this idea and employed Alex Jeon, a very favourable member to be a co-worker. We do hope you could enjoy our site!

Main purpose: We made it to be a little news hub where you can read news articles from different sites.