Re: NSUserDefaults not sticking

2014-09-10 Thread Graham Cox
On 10 Sep 2014, at 3:43 pm, Rick C. rickcort...@gmail.com wrote: Thanks for the help. So I have double-checked and the info in question that is not sticking is NSString/NSData being written: [[NSUserDefaults standardUserDefaults] setObject:stringObject forKey:@“MyStringKey”];

Re: NSUserDefaults not sticking

2014-09-10 Thread Jens Alfke
I've run into issues of app preferences/defaults not persisting (across lots of apps, not necessarily just my own), and in the past few years when it's happened it's been an early symptom of filesystem corruption. Sometimes there have been a bunch of leftover temporary lock(?) files in the

Re: How to set UILabel height to even multiple of line height with auto-layout?

2014-09-10 Thread Steve Christensen
That's not the issue I'm having. Let's say, for example, that label3 contains abcdefghijklmnopqrstuvwxyz; the line height for the font 10; and when the label is laid out the label height is 25. This results in a label that looks like this: +——+ |abcdefghij| |klmnopqrst| |(blank) |

Re: NSUserDefaults not sticking

2014-09-10 Thread Todd Heberlein
in the past few years when it's happened it's been an early symptom of filesystem corruption. Sometimes there have been a bunch of leftover temporary lock(?) files in the Preferences directory. If you're getting reports of this from users of your app, it might be worth asking them to run

Re: NSUserDefaults not sticking

2014-09-10 Thread Kyle Sluder
On Wed, Sep 10, 2014, at 11:15 AM, Todd Heberlein wrote: in the past few years when it's happened it's been an early symptom of filesystem corruption. Sometimes there have been a bunch of leftover temporary lock(?) files in the Preferences directory. If you're getting reports of this

Re: How to copy Color Panel behaviour?

2014-09-10 Thread Luc Van Bogaert
On 10 Sep 2014, at 01:56, Kyle Sluder k...@ksluder.com wrote: On Tue, Sep 9, 2014, at 06:42 PM, Graham Cox wrote: On 10 Sep 2014, at 7:13 am, Luc Van Bogaert luc.van.boga...@me.com wrote: This opens the panel without making it key, which is OK, but it still makes the panel key when I

Re: How to copy Color Panel behaviour?

2014-09-10 Thread Ken Thomases
On Sep 10, 2014, at 4:07 PM, Luc Van Bogaert luc.van.boga...@me.com wrote: No succes so far with this. I subclassed NSPanel and overridden: - (BOOL) becomesKeyOnlyIfNeeded { return YES; } - (BOOL) canBecomeKeyWindow { return YES; } I also subclassed the collection view in

Re: How to copy Color Panel behaviour?

2014-09-10 Thread Luc Van Bogaert
On 10 Sep 2014, at 23:32, Ken Thomases k...@codeweavers.com wrote: On Sep 10, 2014, at 4:07 PM, Luc Van Bogaert luc.van.boga...@me.com wrote: No succes so far with this. I subclassed NSPanel and overridden: - (BOOL) becomesKeyOnlyIfNeeded { return YES; } - (BOOL)

FYI, SQLite-based geo-queries are broken in Yosemite DP7

2014-09-10 Thread Jens Alfke
(I know this technically isn't about Cocoa APIs, but cocoa-dev still seems like the most appropriate list. I suspect a lot of app developers don't read darwin-userlevel.) Those of you with Mac apps that do geo-querying using SQLite may be interested to know that your queries probably broke in

Re: NSUserDefaults not sticking

2014-09-10 Thread Rick C.
Thanks to everyone for the help. I’m pretty sure about this Graham but I will take one last look. Problem is I’m never able to reproduce this issue and as I mentioned this is happening to a very small percentage of users which would seem to mean it’s not my code (???). It’s just trying to

Re: NSUserDefaults not sticking

2014-09-10 Thread Kyle Sluder
On Wed, Sep 10, 2014, at 07:32 PM, Rick C. wrote: And about not relying on the .plist if we don’t rely upon it how do we write our prefs? I understand I should not manipulate it directly, but I am calling everything via NSUserDefaults… Continue using NSUserDefaults for all interaction with

Re: NSUserDefaults not sticking

2014-09-10 Thread Graham Cox
On 11 Sep 2014, at 10:32 am, Rick C. rickcort...@gmail.com wrote: And about not relying on the .plist if we don’t rely upon it how do we write our prefs? I understand I should not manipulate it directly, but I am calling everything via NSUserDefaults… Then you should be fine. The point

Re: NSUserDefaults not sticking

2014-09-10 Thread Scott Ribe
On Sep 10, 2014, at 6:42 PM, Graham Cox graham@bigpond.com wrote: Then you should be fine. The point is that the .plist does not necessarily represent the current state of the defaults for your app. Trashing it for example no longer resets the defaults like it used to, you have to go

Re: NSUserDefaults not sticking

2014-09-10 Thread Charles Srstka
On Sep 10, 2014, at 7:41 PM, Kyle Sluder k...@ksluder.com wrote: On Wed, Sep 10, 2014, at 07:32 PM, Rick C. wrote: And about not relying on the .plist if we don’t rely upon it how do we write our prefs? I understand I should not manipulate it directly, but I am calling everything via

Re: NSUserDefaults not sticking

2014-09-10 Thread Kyle Sluder
On Sep 10, 2014, at 7:04 PM, Scott Ribe scott_r...@elevated-dev.com wrote: The real point: plenty of sites on the web state that the .plist no longer represents the current state, but that the defaults command will read the current state so you can use it for debugging. They are wrong.

Re: NSUserDefaults not sticking

2014-09-10 Thread Graham Cox
On 11 Sep 2014, at 12:14 pm, Charles Srstka cocoa...@charlessoft.com wrote: If that's true, then why does the 'defaults' program work for sandboxed apps, while NSUserDefaults does not? Where did you get the idea that NSUserDefaults doesn't work for sandboxed apps? It certainly does.

Re: NSUserDefaults not sticking

2014-09-10 Thread Charles Srstka
On Sep 10, 2014, at 9:39 PM, Graham Cox graham@bigpond.com wrote: On 11 Sep 2014, at 12:14 pm, Charles Srstka cocoa...@charlessoft.com wrote: If that's true, then why does the 'defaults' program work for sandboxed apps, while NSUserDefaults does not? Where did you get the idea that

Re: NSOutlineView

2014-09-10 Thread Shane Stanley
On 10 Sep 2014, at 12:49 pm, Shane Stanley sstan...@myriad-com.com.au wrote: FWIW, and this is unrelated to your problem, I'm not sure you should delete the empty custom views, but rather drag the outline view and text view/scroll view into them. At least, I did what you outlined on a

Re: NSUserDefaults not sticking

2014-09-10 Thread Marco S Hyman
On Sep 10, 2014, at 8:19 PM, Charles Srstka cocoa...@charlessoft.com wrote: Where did you get the idea that NSUserDefaults doesn't work for sandboxed apps? It certainly does. #import Foundation/Foundation.h int main(int argc, const char * argv[]) { @autoreleasepool {

Re: NSUserDefaults not sticking

2014-09-10 Thread Graham Cox
On 11 Sep 2014, at 1:19 pm, Charles Srstka cocoa...@charlessoft.com wrote: NSDictionary *domain = [def persistentDomainForName:@com.apple.TextEdit]; The documentation states that this is not supported under sandboxing. When you say does not ... work, you really need to make clear what you

Re: NSUserDefaults not sticking

2014-09-10 Thread Charles Srstka
On Sep 10, 2014, at 10:34 PM, Marco S Hyman m...@snafu.org wrote: On Sep 10, 2014, at 8:19 PM, Charles Srstka cocoa...@charlessoft.com wrote: Where did you get the idea that NSUserDefaults doesn't work for sandboxed apps? It certainly does. #import Foundation/Foundation.h int

Re: NSUserDefaults not sticking

2014-09-10 Thread Charles Srstka
On Sep 10, 2014, at 10:50 PM, Graham Cox graham@bigpond.com wrote: On 11 Sep 2014, at 1:19 pm, Charles Srstka cocoa...@charlessoft.com wrote: NSDictionary *domain = [def persistentDomainForName:@com.apple.TextEdit]; The documentation states that this is not supported under

Re: NSUserDefaults not sticking

2014-09-10 Thread Rick C.
This is all very interesting and shows that there are issues out there, but back to my original issue if I’m writing and reading via NSUserDefaults and its not returning the expected values what else could be the trouble? rc On Sep 11, 2014, at 11:59 AM, Charles Srstka