I’m getting a similar compiler error here:
if response.Success {
var jsonObject:Sugar.Json.JsonObject = response.Content.RootObject;
let rndIndex=(Sugar.Random()).NextInt();
let key="USER_"+Sugar.Convert.ToString(rndIndex);
let now = DateTime.Now
var cacheObject:CacheObject = CacheObject(key:key,
value:jsonObject.ToString(),
timestamp: Convert.ToString( now.Ticks ) );
cacheObject.Load( jsonObject.ToString() );
self.logger.debug( "CACHE OBJECT " + cacheObject.timestamp );
success( jsonObject.ToString() );
}
The line now.Ticks
causes a
/Volumes/MacHDD2/Developmemt/ParisiLabs/swift-promise-example/StaticLibrary/SharedProject/APIClient.swift(60,35): error E46: Unknown identifier "Timespan"
and I suppose reading this thread that is due to the underlining Timespan
notation of TimeSpan
in Sugar DateTime.pas
- https://github.com/remobjects/sugar/blob/254aba8a77c3d719a3eec85e9441ac6275ad49fe/Sugar/DateTime.pas here:
property Ticks: Int64 read{$IFDEF COOPER}(mapped.TimeInMillis +mapped.TimeZone.getOffset(mapped.TimeInMillis)) * Timespan.TicksPerMillisecond + TicksSince1970{$ELSEIF ECHOES}mapped.Ticks{$ELSE}Int64((mapped.timeIntervalSince1970 + DateTimeHelpers.LocalTimezone.secondsFromGMTForDate(mapped)) * Timespan.TicksPerSecond) + TicksSince1970{$ENDIF};