Skip to main content

Posts

Objective-c vs Swift

Today we will discuss about one of the feature in which Objective-c is better than swift.  We all have read Turtle & Rabbit story. To start with today's discussion, let's treat topic as turtle & rabbit race where Objective-c is Turtle & Swift is Rabbit. Today Discussion Topic: 1) Run Time Flexibility  2) Dynamism On Your Mark: Apple introduced swift with the tagline "more safer than Objective-C". As we know  to win something, have to lose something .   So to become safer swift becomes Statically Typed Language. Statically Typed Language is one which does type checking at compile time. However, the old turtle (Objective-C) is a runtime language i.e. Most of the linkage between your methods,  ivar and classes are checked at runtime. What benefit you will get with run time flexibility? 1) Fix Critically issue in deployed application on app store : Method Swizzling can be used to fix any critical issue in the application which already distri
Recent posts

Constant Weds Literals Venue Objective C

Arrangement: While working on a application you may have used some predefined values. The visibility of these values can be application level, feature level or class level. For the  convenience  we give name to these values and then use in the application. In this case the name given by you only representing the single value and it never change to represent some other value thats why it is called Constant. On the other hand variables are like us doing jobs in IT World and can switch from one organization( value ) to other. Like while choosing a partner for marriage you may choose best for you by seeing multiple persons and still after sometime you feel stuck. Same may happen you choose a best option to declare a constant and after sometime this constant can create a issue for you in code due to its scope or any other reason. On the other hand you may have a fixed mind that you always declare a constant in a same way in any situation like a love marriage and again  after

What does enable bitcode do in Xcode

Background: Now days compilation process for any language is divided into two parts and same is applicable for objective c. Frontend Compiler (Clang) Backend Compiler (LLVM) Frontend Compiler (Clang):  Responsibility of front-end compiler is to take a source code and convert into intermediate representation (IR).  In case of clang it is LLVM IR.  Backend Compiler(LLVM):  Responsibility of backend compiler is to take a IR as input and convert into object code. LLVM input is bitstream of LLVM IR (Bitcode) and output is sequence of machine instruction(Object code). Each  cpu or processor has different set of  M achine   instruction, So  LLVM output is CPU dependent or it can be executed on specific CPU only.   There may be question in your mind that  1) What is the need to divide into these phases? 2) What is LLVM IR? Can we see the LLVM IR as Output? What is the need to divide into these phases? It is beneficial for both the programming language designer a