ARC problems

2019-09-02 Thread Turtle Creek Software via Cocoa-dev
Thanks for all the suggestions for the problems we had with a controller
being
deallocated unexpectedly under ARC.  Unfortunately, none of them fixed it.

We do need to get back to regular app programming, so it will just stay a
mystery.
I was hoping we were doing something obviously dumb, but I guess the bug is
more subtle.

The app runs OK with the old code with multiple strong references to it
They are circular references, but that controller sticks around for the
full app lifetime.  Presumably any leakage
won't happen until late in the game, anyhow.

Thanks,

Casey McDermott
TurtleSoft.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSLog displays inconsistent format for NSDate

2019-09-02 Thread Jean-Daniel via Cocoa-dev


> Le 1 sept. 2019 à 01:10, Carl Hoefs via Cocoa-dev  
> a écrit :
> 
> 
>> On Aug 31, 2019, at 2:51 AM, Allan Odgaard via Cocoa-dev 
>>  wrote:
>> 
>> On 31 Aug 2019, at 2:49, Carl Hoefs via Cocoa-dev wrote:
>> 
>>> Same result if I run it as a system daemon. So as you suggest it seems 
>>> there could be some sort of environment sensitivity going on. If only I 
>>> knew what env var to set in the shell... UTC really isn't what I'm looking 
>>> for.
>> 
>> The issue appears to be that `NSLog` sends your format string and arguments 
>> to the unified logging system, this is what Xcode and Console displays, and 
>> here you get dates formatted using the local time zone.
>> 
>> But it *also* does a simple `stringWithFormat:` and sends the result to 
>> standard error, at least when running in a terminal. This is where you are 
>> seeing a more crude formatting of the date which is not adjusted to the 
>> local time zone.
>> 
>> Open a new tab in your terminal, in that tab run this command:
>> 
>>  log stream|grep 'Configured date'
>> 
>> Now run your executable, and in the tab where it is running, you should see 
>> the UTC date, but in the tab where you are watching the log stream, you get 
>> the local date.
>> ___
>> 
> 
> Thanks for the input! 
> 
> I realized this is occurring because I'm allowing macOS to generate the date 
> string according to its whims. If I do the string generation, then I can get 
> consistent results. So I added the following line to my code:
> 
>NSString *dateString = [NSDateFormatter 
> localizedStringFromDate:configuredDate dateStyle:NSDateFormatterFullStyle 
> timeStyle:NSDateFormatterLongStyle];
> 
> and now I get a standardized string I can at least can live with, valid for 
> all situations:
> 
> Configured date: Saturday, August 31, 2019 at 3:55:02 PM PDT
> 

Note that your output is still Local dependent and can change from on system to 
an other.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com