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

Can you use swift and objective c together?

1 Answers  


What is nonatomic in objective c?

1 Answers  


What are the two types of m files?

1 Answers  


How to check array contains value in objective c?

1 Answers  


What is difference between objective c and swift?

1 Answers  


How to call methods in objective c?

1 Answers  


What is the difference between weak and unowned?

1 Answers  


How do I create a bridge header in objective c?

1 Answers  


List out the methods used in nsurl connection?

1 Answers  


What are benefits of collections views?

1 Answers  


Who invented objective c?

1 Answers  


How much does m files cost?

1 Answers  


Categories