0

I have stored some values in NSUserDefaults and now I need to check, using NSFileManager, whether a certain value exists in the defaults. If the value exsists then I need to skip some parsing, and display information in a tableview. Please help me figure out how to do this check.

jscs
  • 63,694
  • 13
  • 151
  • 195

2 Answers2

0

You can use something like

[[NSUserDefaults standardUserDefaults] objectForKey:...]

to retrieve the value.

hennes
  • 9,147
  • 4
  • 43
  • 63
  • i know that but how to do that with nsfile manager, means should check that file exsist in nslibrarydirectory. –  Mar 18 '11 at 11:13
  • Maybe Niels Castle's response from [this question](http://stackoverflow.com/questions/1676938/easy-way-to-see-saved-nsuserdefaults) helps. – hennes Mar 18 '11 at 11:22
0

You need to use NSData instead NSFile manager

Get values from nsuserdefaults to nsData and check whether any values available in nsData, if yes then perform some activity else ignore.

HERE is the link for the same discussion.

Hope this will help you.

Community
  • 1
  • 1
V.V
  • 3,082
  • 7
  • 49
  • 83