Objective C Interview Questions and Answers
Most Frequently Asked Objective C Interview Questions
It is a pointer to any type, but unlike a void *, it points to an object. For instance, you add anything of type id to an NSArray as long as those objects are responding to retain and release it.
@interface A:
NSObject;
@end
@interface B : A
@end
Here, the init method is inherited from A to B. However, the method has a different return type in both classes.
No. Objective-C does not support overloading, so you will need to use a different method.
It is an object that acts in coordination with, on behalf of, other objects when those objects encounter an event in a program.
If you want to retain a delegate, it can be retained. However, the rule is not to retain it because it must e already retained you will avoid unnecessary retain cycles.
Because it is a synchronous process. The idea of dispatch_once() is to perform a task only once, no matter how violent the threading becomes.
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Code benefitting from a local autorelease pool.
[pool release];
You would write:
@autoreleasepool
{
// Code benefitting from a local autorelease pool.
}