Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How does dispatch_once manages to run only once?



How does dispatch_once manages to run only once?..

Answer / Pankaj Kumar Yadav

dispatch_once is a macro in Objective-C that ensures a block of code is executed exactly once during the lifetime of a program. It uses thread local storage and a static variable to check if the code has been executed before. If not, it executes the block and sets the variable to true, ensuring the same block will not run again.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Objective-C Interview Questions

How to use objective c file in swift?

1 Answers  


Explain what is protocol in objective-c?

1 Answers  


What are some of the major differences between objective c and swift?

1 Answers  


What is umbrella header?

1 Answers  


Explain what is the principle distinction between the function calls and messages?

1 Answers  


How to sort array of dictionary in objective c?

1 Answers  


Why is objective c syntax so weird?

1 Answers  


What are the characteristics of the category?

1 Answers  


Explain what is data encapsulation in objective-c?

1 Answers  


What is gcd objective c?

1 Answers  


What is difference between null and nil?

1 Answers  


What is difference between objective c and swift?

1 Answers  


Categories