Re: Requesting help with ObjC conversion, please
Re: Requesting help with ObjC conversion, please
- Subject: Re: Requesting help with ObjC conversion, please
- From: Shane Stanley <email@hidden>
- Date: Mon, 18 Aug 2014 10:39:49 +1000
On 18 Aug 2014, at 10:11 am, Brian Christmas <email@hidden> wrote:
I really, really struggle with how to convert ObcC statements to Applescript's.
I cannot work out how to convert
- (NSDate *)earlierDate:(NSDate *)anotherDate
I've tried this (amongst heaps of other things)..
if (earlierDate_(checkStartDateTimeNSDAte, my finishDateTimeNSDAte)) then
It looks like you're after a method that compares two dates. So why are you trying to use a method that clearly says it returns an NSDate? And how can you expect it to accept two arguments when it clearly says it takes one? And how do you expect an instance method to work when you don't call it on an instance?
If you wanted to use the method, it would be something like: checkStartDateTimeNSDAte's earlierDate_(my finishDateTimeNSDAte)
And that would return a date, just like it says. I suppose you could then compare that date to one of the original dates, but that's more work than needed.
Use this:
if ((checkStartDateTimeNSDAte's compare_(my finishDateTimeNSDAte)) > 0) then -- or < 0, depending on what you're after
And please, fix the case in those DAte variable names. I know it doesn't matter functionally, but it grates terribly. |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden