Featured post

Difference between protocol and delegates?

A protocol, declared with the ( @protocol syntax in Objective-C) is used to declare a set of methods that a class "adopts" (de...

Thursday, 9 April 2015

Difference b/w #define and #pragma and #import?

#define
There are different ways to create   constants in Objective-C, but the easiest way is to use #define statements.#define however is a      preprocessor that replaces all          instance with it  even before            compilation starts.

#import

Objective-C has the #import preprocessor instruction. This does almost the same as #include.The #import line is only replaced by the contents of the named file for the first time it is encountered. Every time after that it is just ignored

#pragma

#pragma mark is the fascility for Xcode but it has no impact on your code.It is used for categorizing methods, so you can find your methods easily. It is very useful for long projects

No comments:

Post a Comment