SwissChecklist

Checklist: iPhone development - differences between Objective-C and C-#

A list of differences to make getting started easier. It assumes you know C#, and want to know Objective-C. For a list of differences the other way around, feel free to create another list and link it here :)
  • Differences in Application Structure

    Show Details Show Substeps Show Substeps Show Substeps
  • Application always starts with the file main.m

    Show Details Show Substeps Show Substeps Show Substeps
    This is basically a c-language convention, but not used in c#, so it's a bit confusing the first time.
  • Classes are split into two files MyClass.h and MyClass.m

    Show Details Show Substeps Show Substeps Show Substeps
    • The ".h" file is the so called "header" defining what the object looks like, namely it's interface. It will list all properties and methods but not contain any code
    • the ".m" file contains the implementation of the class, so it basically repeats the interface and add all the code
    • the .m-file needs to mention that it refereces the header file, so it usually starts with something like #import "MoveMeAppDelegate.h" and then continues with @implementation MoveMeAppDelegate
  • Syntax differences

    Show Details Show Substeps Show Substeps Show Substeps
  • Defining a method

    Show Details Show Substeps Show Substeps Show Substeps
  • Calling a method

    Show Details Show Substeps Show Substeps Show Substeps
  • Defining a property

    Show Details Show Substeps Show Substeps Show Substeps
  • Calling a property

    Show Details Show Substeps Show Substeps Show Substeps
  • Event handling (called Messages in this language)

    Show Details Show Substeps Show Substeps Show Substeps
    The terminology is a bit different, probably because it's not fully object oriented. So when a view is done loading, it sends a message to the linked delegate, which is just like raising an event in object oriented languages to the instantiated object.
  • Terminology differences: Message vs. Event

    Show Details Show Substeps Show Substeps Show Substeps
  • Neuer Schritt

    Show Details Show Substeps Show Substeps Show Substeps
  • Dritte Aufgabe

    Show Details Show Substeps Show Substeps Show Substeps
  • ...

    Show Details Show Substeps Show Substeps Show Substeps
  • New Step

    Show Details Show Substeps Show Substeps Show Substeps
Use this Checklist

Preview/Print

Use

Change

Sort