views:

32

answers:

2

If I set an NSUserDefault in one file(playerdata.m) could I access that value from another file(calculator.m)?

A: 

Yes. NSUserDefaults are available to your app and accessed by the standUserDefaults object. Check the documentation.

Jason McCreary
But when I try to use it in another file xcode says my prefs are undeclared. Do I need to redefine my NSUserDefault ?
Rushil
You already marked this answered. So you should have your answer.
Jason McCreary
+2  A: 

Yes, so long as both are running under the same instance of NSApplication (meaning both files exist within the same program).

Dave Gallagher