Advertisement
Guest User

Having trouble with NSDictionary

a guest
Feb 22nd, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. Hello.
  2.  
  3. If you frequent http://reddit.com/r/iOSThemes, I created [HTML]<a href="http://www.reddit.com/r/iOSthemes/comments/1xenq2/release_simplisticls_cydget_customize_with_16/">SimplisticLS</a>[/HTML] for Cydget. This makes use of preference loader. I see that you have worked pretty extensively with Cydget and was wondering if you could help me out. I have the following cycript code:
  4.  
  5. [CODE]<script type="text/cycript">
  6. var EnableClock = new Boolean(true);
  7. var EnableCalendar = new Boolean(true);
  8. var EnableWeather = new Boolean(true);
  9. var locale = "";
  10. var city = "";
  11. var isFahrenheit = new Boolean(true);
  12. var useRealFeel = new Boolean(true);
  13. var format24 = new Boolean(false);
  14. var showampm = new Boolean(false);
  15. var showSeconds = new Boolean(false);
  16. var showYear = new Boolean(false);
  17. var fmonth = "short";
  18. var fweekday = "long";
  19. var fday = "number";
  20. var fdate = "mdy";
  21. var showWeatherIcon = new Boolean(true);
  22. var useWOEID = new Boolean(false);
  23. var wsource = "yahoo";
  24. var nlBack = new Boolean(false);
  25. var mcBottom = new Boolean(true);
  26.  
  27. try{
  28. var main = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.ibbignerd.simplisticls.plist"];
  29. alert("made it past main");
  30. if(main != null){
  31. if(main.showTime!=null){EnableClock = main.showTime;}
  32. if(main.format24!=null){format24 = main.format24;}
  33. if(main.showampm!=null){showampm = main.showampm;}
  34. if(main.showSeconds!=null){showSeconds = main.showSeconds;}
  35. if(main.showDate!=null){EnableCalendar = main.showDate;}
  36. if(main.showYear!=null){showYear = main.showYear;}
  37. if(main.fmonth!=null){fmonth = main.fmonth;}
  38. if(main.fweekday!=null){fweekday = main.fweekday;}
  39. if(main.fday!=null){fday = main.fday;}
  40. if(main.fdate!=null){fdate = main.fdate;}
  41. if(main.showWeather!=null){EnableWeather = main.showWeather;}
  42. if(main.showIcon!=null){showWeatherIcon = main.showIcon;}
  43. if(main.isFahrenheit!=null){isFahrenheit = main.isFahrenheit;}
  44. if(main.useRealFeel!=null){useRealFeel = main.useRealFeel;}
  45. if(main.locale!=null){locale = main.locale;}
  46. if(main.useWOEID!=null){useWOEID = main.useWOEID;}
  47. if(main.wsource!=null){wsource = main.wsource;}
  48. if(main.nlBack!=null){nlBack = main.nlBack;}
  49. if(main.mcBottom!=null){mcBottom = main.mcBottom;}
  50. }
  51. }catch(err){
  52. alert(err);
  53. }[/CODE]
  54.  
  55. The issue is that it's throwing a "ReferenceError: Can't find variable: objc_msgSend" error on my "var main = ..." line.
  56.  
  57. I thought it was not generating the file in /private/var/mobile/Library/Preferences, but it is. It is also populated...
  58.  
  59. I should also note that it was working before I edited the foreground file. If you need any other information, please feel free to ask. I'm stumped.
  60.  
  61. Also, thank you for taking the time to look into this. I know it's annoying to have people just randomly ask you for help. After I released SimplisticLS, I've been getting around 5-10 questions a day about the most random things. So I really appreciate it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement