Home > DeveloperSection > Interviews > What is dynamic?

Posted on    July-27-2015 11:05 PM

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

Tarun Kumar

Total Post:107

Posted on    July-27-2015 11:05 PM

You use the @dynamic keyword to tell the compiler that you will fulfill the API contract implied by a property either by providing method implementations directly or at runtime using other mechanisms such as dynamic loading of code or dynamic method resolution. It suppresses the warnings that the compiler would otherwise generate if it can’t find suitable implementations. You should use it only if you know that the methods will be available at runtime.

[ In other words, the @dynamic keyword tells the compiler that you will provide accessor methods dynamically at runtime. This can be done using the Objective-C runtime functions.]

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

Follow MindStick