Explain keywords alloc and new?



Explain keywords alloc and new?..

Answer / Anjana Gupta

In Objective-C, 'alloc' is used to allocate memory for an object, while 'new' initializes the newly allocated memory with zeros. When you use '[Class new]', it's syntactic sugar for '[Class alloc] init'. Both are essential for creating objects in memory.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Interview Questions

How can we prevent ios 8 app’s streaming video media from being captured by quicktime player on yosemite during screen recording?

1 Answers  


What json framework supported by ios?

1 Answers  


Is xcode a framework?

1 Answers  


What is appdelegate?

1 Answers  


Explain about the applications that can be used with iphone ?

1 Answers  


What are all the difference between iOS3, iOS4 and iOS5?

1 Answers   UGC Corporation,


What is cocoa and cocoa touch?

1 Answers  


Does iOs supports multitasking?

1 Answers  


Explain formal protocols?

1 Answers  


What is a struct in iOS operating system?

1 Answers   B-Ways TecnoSoft,


Explain UIApplication delegate

1 Answers  


What is background mode in ios?

1 Answers  


Categories