Home > DeveloperSection > Interviews > Define * and @ in Objective-C.

Posted on    December-18-2015 12:08 AM

 iPhone iPhone  Ios  Objective C 
Ratings:
 1 Answer(s)
  393  View(s)
Rate this:

Tarun Kumar

Total Post:107

Points:535
Posted on    December-18-2015 1:08 AM

* is used for indicating pointers, because Obj-C is based on C language and C language having pointers. Since all object variables are pointers that's needed for each and every object. and

@ is used to identify NSString literals. If we will not use @ sign then it will be a C string. @ is a compiler directive which tell the compiler that this string is an Objective-C string. NSString and C strings are different so @ sign is used to differentiate them. but sometimes it relates to code or file constructs like @interface, @protocol, @implementation, and @end.


Modified On Dec-18-2015 12:17:20 AM

Don't want to miss updates? Please click the below button!

Follow MindStick