Answer:
- Id is a generic datatype available in Objective-C. Id is capable of holding any kind of object but not primitive Datatype value.
Answer:
- Any variable is capable of holding primitives and Objects whereas id variable only holds objects.
Answer:
- @synthesize tells to the compiler that the accessor methods (Setters and Getters) should be generated for the given variables.
Answer:
- NSObject is the Root class in Object-C.
Answer:
- Category is an alternate way to add new functionality without subclassing. The newly added functionality gets available to the all instances of this.
Answer:
- Protocol is a set of methods declaration.
- A formal protocol declares a list of methods that client classes are expected to implement.
Answer:
- Informal protocol is a Protocol which is the combination of Required and Optional Methods.
Answer:
- Objective-C enum does not have raw and associated values.
- Swift enums can have methods.
Answer:
- #import includes the files or frameworks only once
- #include includes the files or frameworks every time you compile
Answer:
- A chunk of memory dedicated for auto-released objects. Objects added to auto-release pool will be cleaned by the runtime system when the objects are of no use.
Answer:
- Auto-release is delayed release. When you call auto-release over an object, the object will be added to auto-release pool.
Answer:
- Use auto-release when you are not sure that when to release the object.
- The best usecase is when you are creating an object and sharing it with different parts of the program. Use autorelease while sharing so that when different parts of the program done using the object, the object will be released from the autorelease pool.
Answer:
- retain / strong
- weak
- assign
- readwrite
- readonly
- copy
- setter=
- getter=
- atomic
- nonatomic
Answer:
- Weak just shares the ownership without increasing the retain count.
- Copy entirely creates new object and sets the retain count as 1 for the newly created object.
Section 3, Conditional Statement
Section 10, static type vs dynamic type
Section 15, higher order function
Section 22, Exception Handling
Section 24, Objective-C