Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Global Variables In iOS?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="xstep" data-source="post: 1335012" data-attributes="member: 11647"><p>See this <a href="http://en.wikipedia.org/wiki/Global_variable" target="_blank">Wikipedia entry about global variables</a> and read the section on C & C++. It should apply to Objective-C as well, since Objective-C is a superset of C.</p><p></p><p>If your global variable is going to be an object, then look into the <a href="http://developer.apple.com/library/ios/#documentation/General/Conceptual/DevPedia-CocoaCore/Singleton.html" target="_blank">singleton</a>.</p><p></p><p>Lastly, if one view controller is calling the other one, just pass a reference to the firsts local variable.</p></blockquote><p></p>
[QUOTE="xstep, post: 1335012, member: 11647"] See this [URL="http://en.wikipedia.org/wiki/Global_variable"]Wikipedia entry about global variables[/URL] and read the section on C & C++. It should apply to Objective-C as well, since Objective-C is a superset of C. If your global variable is going to be an object, then look into the [URL="http://developer.apple.com/library/ios/#documentation/General/Conceptual/DevPedia-CocoaCore/Singleton.html"]singleton[/URL]. Lastly, if one view controller is calling the other one, just pass a reference to the firsts local variable. [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Global Variables In iOS?
Top