Mobile Application Development – Objective-C

mobile programming

Sharing is caring!

When you embark on your mobile programming journey and ambitions, you will find that it is very easy to have a problem on choosing the platform that you are going to use for your mobile apps.

However, if you take your time to understand the purpose of your application you will be able to find the right programming platform, where you can learn to use the right programming language.

In today’s article, we are going to talk about objective C

We will see how it can help you make an easier choice when you build your mobile applications.

Software that are made for Operating System X (OS X) and i-Operating System (iOS) are all written in Objective-C because this is the primary programming language you would use for these Operating Systems.

So Objective-C is a programming language used to build mobile applications that are geared towards Apple’s products, because as you may already know OS X and iOS both belong to Apple’s technologies.

Object-oriented classes

Objective-C is capable of giving C programming its extended object-oriented classes and method capabilities, which means that you can now use extended object-oriented classes and methods on the C programming language.

Objective-C is also able to provide a dynamic runtime to the C programming language and this simply means that the method that is to be invoked is determined during runtime and not during compile time, this process is also called dynamic binding or late binding.

Methods in Objective-C

All methods in Objective-C are resolved during runtime, which means that all methods are dynamically selected during runtime.

Okay, I hope you just understood what was just mentioned earlier, but if you are not is probably because you don’t know what a class and a method are, but we’ll explain it here on this post, so that you may be able to follow what Objective-C entails and is all about.

A method, is part of your programming and it is usually inside of a class or an object, in this case an object and they act as functions that do some specific task or tasks, with the required arguments.

You will find that methods are also used in other programming languages that are object-oriented, such as Java.

Objective-C is not difficult at all, but you will have to start from the beginning and build upon your knowledge, but it is time-consuming, also don’t be bother by the amount of work that you’ll have to do to build a killer app with Objective-C, because you’ll be happy you went through the process.

The syntax of a programming language

The syntax for defining methods and classes in Objective-C is added by Objective-C, however, the basic syntax, the primitive types and the flow control statements are all inherited from the C programming language.

The syntax of a programming language is one of the basic concepts of any programming language and it is the required and standard layout of words and symbols of that particular programing language.

Each and every single programming language abide by their own set of rules and principles, to layout or write out the code, this is known as the syntax of the programming language.

However, all of the programming languages do develop similarities because they all use the same formulas and already created tools that are necessary to solve programming problems, such tools are (for, if…else, do…while, variables, arrays, etc).

Program in Objective-C

One of the first things you need to do in order for you to be able to start to program in Objective-C is that you would need to create the environment in which you will be programming, without your environment you will never be able to program in any language.

Remember that you need to understand what your environment would be in any type of system for you to be able to create or even use that system.

The reason why you need to set up your environment on your computer to start programming in Objective-C is so that you can compile and execute all of the coding that you do to create the next big thing that you have in mind.

Set up your own environment on your computer

You can also go online and find many environments where you can easily set up and use other people’s computer, to compile and execute your code.

Try to always set up your own environment on your computer though, because you just never know if the online environment would always be available for you to use.

If you don’t think that setting up your environment locally on your computer will not be too much of a hassle for you, then you will need a couple of things; well actually you will only need two things, you will need a text editor and a GCC compiler.

A text editor

As far as a text editor is concerned you probably already know and have one on your computer because most Operating Systems (OS) comes with a very basic text editor.

You may know Windows notepad, because most people use Windows XP or Windows 7; but there are other text editors that are not OS specific.

Some of the other text editors that you may want to also consider using is Brief, EMACS, vim or vi, and Epsilon as well as Eclipse, NetBeans and Notepad++.

The text editors will be the place where you would be creating your source code and are going to be your source files when you are ready to compile and execute your Objective-C piece of code.

In Objective-C, you would name your source files with a .m extension so that they may be executable by your computer

You need to have experience to be able to use a text editor, write your computer program, save it to a file on your computer and then execute your program so that it works and does what you intended for the program to do.

The end outcome that you want for anything that you create with programming is that it needs and has to work, if you don’t get it to work then you will be losing the programming war that will be waged against you by your computer when you start programming.

You will also have to face that battle against your own programming skills and your own brain.

As a developer, it is your job to get things to work

The reason why you will feel as if you are in a war zone would be because getting a complex system to work with programming on your computer, is not an easy thing to accomplish. However, as a developer, it is your job to get things to work when you are creating a system or an application.

So be ready to be thrown into the wolf when you engage into your programming journey, because you will have to prove your programing skills to yourselves for you to be able to successfully accomplish your programming goals.

Anyhow back to the fact of the matter, Objective-C would have to first be installed in your computer or find a place where you can execute your Objective-C programs, If you don’t already have an environment to compile and execute your Objective-C programs on your local computer, it is recommended that you do create one.

It is time for you to start programming with Objective-C

Once you have your environment set up, now it is time for you to start programming with Objective-C.

You won’t be able to learn everything you need to learn with this post alone, but you will be able to have a basic introduction of what the Objective-C programming language is.

Alright let’s get into the code, Objective-C is a superset of the C language, which means that the same basic syntax of C is the same basic syntax of Objective-C which supports it.

The Objective-C programming language specifies its own syntax

Except the Objective-C programming language specifies its own syntax for defining classes, methods and for calling the methods that belong to objects.

By defining classes we mean that Objective-C is able to take the classes that would be defined in C a certain way and define that same class a different way so that you can do more with that class, this is what we meant when we said that Objective-C is able to extend the classes and methods of the C programming language.

Classes can also be extended dynamically using the Objective-C programming language, which address specific problems that can also be resolved with these extended classes.

Familiar elements such as, the structures, functions, control flow (if…else and for statement), pointers and primitive types such as int, float and many others are all part of the Objective-C programming language, which you would find in the C programming language.

The Objective-C programming though does add its own features to the C programming syntax

The Objective-C programming though does add its own features to the C programming syntax to form what we all know now as Objective-C.

Some of the features that Objective-C adds to C are: Class and instance methods, declaration of properties, extension to the base language (protocol and categories), static and dynamic typing, method invocation, definition of new classes and encapsulated segment of code that can be executed at any time known as blocks.

The standard libraries of C such as stdlib.h and stdio.h are also available to you when you use Objective-C.

We have discussed a lot of information about the Objective-C programming language and we won’t be able to continue our discussion because we don’t want to bore you when you read our articles.

But you did cover a lot of information and important concepts about the Objective-C programming language that you may or may have known before.

Now it is up to you to continue to do your research and find more information about the different important and new features that the Objective-C programming language brings to the C programming language.

Until then keep on researching and continue to read valuable and reliable information because it will help you accomplish your ambitions.

You should already be aware about what is a computer program and what is a computer programming language. Objective-C is general-purpose language that is developed on top of C Programming language by adding features of Small Talk programming language, and making it an object-oriented language. It is primarily used in developing iOS and Mac OS X operating systems as well as its applications.

Initially, Objective-C was developed by NeXT for its NeXTSTEP OS from whom it was taken over by Apple for its iOS and Mac OS X.

Object-Oriented Programming fully supports object-oriented programming, and there are four pillars of object-oriented development:

  • Encapsulation
  • Data hiding
  • Inheritance
  • Polymorphism

Example Code


int main (int argc, const char * argv[])

{ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

NSLog (@”hello world”);

Foundation Framework provides a large set of features and they are listed below

It includes a list of extended datatypes like NSArray, NSDictionary, NSSet and so on.

It consists of a rich set of functions manipulating files, strings, etc.

It provides features for URL handling, utilities like date formatting, data handling, error handling, etc

Alright, that’s it for now, but make sure to check back, or leave a comment below and tell me what you think about this article.

The purpose of learning a programming language is to become a better programmer

Become more effective at designing and implementing new systems and at maintaining old ones.

So remember when you are stuck trying to figure out how to do something, but you can’t do it, don’t be frustrated because it is all part of you becoming a better programmer.

Thank you for reading this post!!!