|
Re: How to Display a Time Interval
Sorry, forgot the last part. After you get the components using the calendar you wish to use with your two dates, then call NSDateComponentsFormatter. For a simple case, you could get by with:
+
Sorry, forgot the last part. After you get the components using the calendar you wish to use with your two dates, then call NSDateComponentsFormatter. For a simple case, you could get by with:
+
|
By
Gary L. Wade
·
#947
·
|
|
Re: How to Display a Time Interval
Ooops, I’m wrong...
Leap year complications should be part of the time interval and be ignored.
My programming history got the better of my knowledge... the first ever COBOL program I wrote
Ooops, I’m wrong...
Leap year complications should be part of the time interval and be ignored.
My programming history got the better of my knowledge... the first ever COBOL program I wrote
|
By
Marco S Hyman
·
#946
·
|
|
Re: How to Display a Time Interval
Use NSCalendar’s method:
- (NSDateComponents *)components:(NSCalendarUnit)unitFlags fromDate:(NSDate *)startingDate toDate:(NSDate *)resultDate options:(NSCalendarOptions)opts;
--
Gary L.
Use NSCalendar’s method:
- (NSDateComponents *)components:(NSCalendarUnit)unitFlags fromDate:(NSDate *)startingDate toDate:(NSDate *)resultDate options:(NSCalendarOptions)opts;
--
Gary L.
|
By
Gary L. Wade
·
#945
·
|
|
Re: How to Display a Time Interval
Can not be done accurately using only a Time Interval in seconds. You also need either the start or end date to figure out leap year complications.
Don’t know of any. I’d probably roll my
Can not be done accurately using only a Time Interval in seconds. You also need either the start or end date to figure out leap year complications.
Don’t know of any. I’d probably roll my
|
By
Marco S Hyman
·
#944
·
|
|
Re: How to Display a Time Interval
There's NSDateComponentsFormatter, although it's fairly limited.
--
Shane Stanley <sstanley@...>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
There's NSDateComponentsFormatter, although it's fairly limited.
--
Shane Stanley <sstanley@...>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
|
By
Shane Stanley
·
#943
·
|
|
Re: How to Display a Time Interval
Look at the NSDate and NSDateFormatter classes.
-Owen
Look at the NSDate and NSDateFormatter classes.
-Owen
|
By
Owen Hartnett
·
#942
·
|
|
How to Display a Time Interval
Objective-C, Mac.
Hi,
I’m trying to display a countdown to a date in the future e.g. the number of years, weeks and days to 1/1/2021.
I have the Time Interval between now and the future date in
Objective-C, Mac.
Hi,
I’m trying to display a countdown to a date in the future e.g. the number of years, weeks and days to 1/1/2021.
I have the Time Interval between now and the future date in
|
By
Dave
·
#941
·
|
|
flagsChanged: not being called on NSControl subclass
What do you have to do these days to make this work? I tried returning YES from acceptsFirstResponder, as was suggested somewhere.
There is 1 NSTrackingArea added to the view, using options
What do you have to do these days to make this work? I tried returning YES from acceptsFirstResponder, as was suggested somewhere.
There is 1 NSTrackingArea added to the view, using options
|
By
Steve Mills
·
#940
·
|
|
Re: Creating objects via AppleScript and setting readonly properties
Yes, I did mean if there was currently a way to do it, but then I meandered over to "wouldn't it be great" territory. I've submitted radar://50687965 for this feature suggestion.
I was also thinking
Yes, I did mean if there was currently a way to do it, but then I meandered over to "wouldn't it be great" territory. I've submitted radar://50687965 for this feature suggestion.
I was also thinking
|
By
Steve Mills
·
#939
·
|
|
Re: Creating objects via AppleScript and setting readonly properties
If you're logging a feature request, I'd be delighted to back it. But when you said "is", I presumed you meant present tense.
--
Shane Stanley
If you're logging a feature request, I'd be delighted to back it. But when you said "is", I presumed you meant present tense.
--
Shane Stanley
|
By
Shane Stanley
·
#938
·
|
|
Re: Creating objects via AppleScript and setting readonly properties
Well, one could say the Info.plist is just a an xml file that gets added to the bundle, but it can be preprocessed. I use that feature a lot, like so the version number only has to be defined in one
Well, one could say the Info.plist is just a an xml file that gets added to the bundle, but it can be preprocessed. I use that feature a lot, like so the version number only has to be defined in one
|
By
Steve Mills
·
#937
·
|
|
Re: Creating objects via AppleScript and setting readonly properties
If there's another way, I don't know it.
It's just an XML file that gets added straight to the bundle, so I don't see how that would work.
--
Shane Stanley
If there's another way, I don't know it.
It's just an XML file that gets added straight to the bundle, so I don't see how that would work.
--
Shane Stanley
|
By
Shane Stanley
·
#936
·
|
|
Re: Creating objects via AppleScript and setting readonly properties
I did just find makeScriptingObjectOfClass or whatever it is (not at my desk now), so that’s a good way to ignore readonly properties. Still, seems like something should be doing that when letting
I did just find makeScriptingObjectOfClass or whatever it is (not at my desk now), so that’s a good way to ignore readonly properties. Still, seems like something should be doing that when letting
|
By
Steve Mills
·
#935
·
|
|
Creating objects via AppleScript and setting readonly properties
This seems like bug, or I need to override something. I have a class:
@interface Blah : NSObject
@property (readonly) NSUInteger id;
@end
The id property is exposed to AppleScript in the Blah
This seems like bug, or I need to override something. I have a class:
@interface Blah : NSObject
@property (readonly) NSUInteger id;
@end
The id property is exposed to AppleScript in the Blah
|
By
Steve Mills
·
#934
·
|
|
Re: Adding scripting support for custom records
What? I think you misunderstood. This is purely AppleScript communication. Bill and Shane already confirmed I'm doing the right thing.
--
Steve Mills
Drummer, Mac geek
What? I think you misunderstood. This is purely AppleScript communication. Bill and Shane already confirmed I'm doing the right thing.
--
Steve Mills
Drummer, Mac geek
|
By
Steve Mills
·
#933
·
|
|
Re: Adding scripting support for custom records
How do you plan to consume it? As an array, dictionary? You can even save it out as a pList and read it off media if you wish. You can even serialize it to JSON or XML. There even is serializing
How do you plan to consume it? As an array, dictionary? You can even save it out as a pList and read it off media if you wish. You can even serialize it to JSON or XML. There even is serializing
|
By
Alex Zavatone
·
#932
·
|
|
Re: Adding scripting support for custom records
OK, thanks for the confirmation. I was hoping there was something analogous to -objectSpecifier that I wasn't finding, such as -valueDdescriptor that would be called on the key-value object found at
OK, thanks for the confirmation. I was hoping there was something analogous to -objectSpecifier that I wasn't finding, such as -valueDdescriptor that would be called on the key-value object found at
|
By
Steve Mills
·
#931
·
|
|
Re: Selectable text in NSTableView?
Oops, yes. This was on the crash in dragImageForSelection.
Jens Alfke wrote on 6/5/19 20:02:
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland
Oops, yes. This was on the crash in dragImageForSelection.
Jens Alfke wrote on 6/5/19 20:02:
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland
|
By
John Brownie
·
#930
·
|
|
Re: Adding scripting support for custom records
if I follow you correctly, that sounds about right. Cocoa scripting doesn't like simple records -- it wants custom record types.
--
Shane Stanley
if I follow you correctly, that sounds about right. Cocoa scripting doesn't like simple records -- it wants custom record types.
--
Shane Stanley
|
By
Shane Stanley
·
#929
·
|
|
Re: Adding scripting support for custom records
I can’t add much other than I recall yours was the solution I used too.
Off-Topic
WWDC is very close and I’d be surprised if there aren’t significant changes to the whole Scripting shambles (I
I can’t add much other than I recall yours was the solution I used too.
Off-Topic
WWDC is very close and I’d be surprised if there aren’t significant changes to the whole Scripting shambles (I
|
By
Bill Pitcher
·
#928
·
|