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
2010-10-14 00:38:46
But when I try to use it in another file xcode says my prefs are undeclared. Do I need to redefine my NSUserDefault ?
Rushil
2010-10-14 01:04:55
You already marked this answered. So you should have your answer.
Jason McCreary
2010-10-14 01:27:54
+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
2010-10-14 00:38:51