Best practise - Accessing preferences globally

Posted by JK on Stack Overflow See other posts from Stack Overflow or by JK
Published on 2010-03-24T06:00:06Z Indexed on 2010/03/24 6:03 UTC
Read the original article Hit count: 215

Filed under:
|
|

User preferences for my app is store in NSUserDefaults. This includes a "theme" preference, which needs to be accessed frequently by multiple classes. I would prefer not to call "[[NSUserDefaults standardUserDefaults] objectForKey:..." repeatedly as it makes for inconcise code and I assume will incur overhead. What is the preferred and most concise method for accessing preferences in any class?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa-touch