How to declare global variable in objective c?



How to declare global variable in objective c?..

Answer / Girijesh Singh

"To declare a global variable in Objective-C, you can place the declaration outside of any function or method. Here's an example:nnextern int myGlobalVar;nextime_t myGlobalTime;" (Note: External declarations require the 'extern' keyword when used in multiple files.)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Objective-C Interview Questions

What is parsing? Mention which class can you use for parsing of xml in iphone?

1 Answers  


What optional binding?

1 Answers  


Does objective-c contain private strategies?

1 Answers  


What is the purpose of the protocol?

1 Answers  


What is objective c runtime?

1 Answers  


Tell us the result when you invoke a particular method on a nil pointer?

1 Answers  


When would you use nsarray and nsmutablearray?

1 Answers  


What is an m file?

1 Answers  


Who calls dealloc method?

1 Answers  


Can a protocol have properties?

1 Answers  


What does __ block do?

1 Answers  


Explain what do you mean by synthesized in objective-c?

1 Answers  


Categories