Objective C etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
Objective C etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

19 Şubat 2015 Perşembe

Mobile Developer Questions and Answers

  • What’s the difference between directly calling a object’s method and perform 
Selector on a method? 

"performSelector": method allows you to send messages that aren’t determined until runtime. We can use main thread or another thread with"performSelector" or we can add delay time.

                    "directly calling a object’s method" : is a call to a known method on a known object. 

  • Do you use Automated Reference Counting? What are some of its 
(dis)advantages? 

I used only with third party library. ARC helps us to save time and skip the writing of deallocs and other memory management calls. When we develop in past projects without ARC, we must implement ARC for all of the class files so we lost a lot of time for past projects.

  • What does the @dynamic keyword do?  When might you use it? 

@dynamic: the keyword provides us to use accessor methods dynamically at runtime. It can be use for the Objective-C runtime functions

  • When might you use a CFArray/Dictionary instead of a NSArray/Dictionary? 
  
When we want to store non-reference-counted objects, we can create a CFArray or a CFDictionary.  


  • What is toll-free bridging and when is it useful? 

The some data structures are interchangeable. When we use the type on one side of the bridge, we can use the other. For example, we can create a CFString and then send NSString messages to it.

  • What’s a Objective C category and when might you use one? 

A category provides us to add methods to an existing class. We can extend the functionality of existing classes without subclassing

What usually (should) happens in a view controller when your app gets a low memory   warning? 

When the view controller gets a low-memory warning, it should be prepared to reduce its memory usage if it is not visible onscreen

  • What are blocks? What does the block keyword do? 

Blocks allow us to create distinct segments of code that can be passed around to methods or functions as if they were values. Blocks are Objective-C objects, which means they can be added to collections like NSArray orNSDictionary. They also have the ability to capture values from the enclosing scope, making them similar to closures or lambdas in other programming languages.