我在属性初始化程序中得到一个“无法使用实例成员'onwardTimeCount';属性初始化程序在'self'可用之前运行”下面是以下代码
class TripStatus {
var startDate: Int = Utility.getTimestampAfter(daysInterval: 1)
var tripType = SelectedTripType.roundTrip
var subscriptionType = SelectedSubscriptionType.monthly
var onwardTimeCount: TimeInterval = TimeInterval(ApplicationSettingsKey.startTimeFirstShift.key ?? "00:00 AM") ?? 3600
var returnTimeCount: TimeInterval = TimeInterval(ApplicationSettingsKey.returnTimeFirstShift.key ?? "00:00 AM") ?? 3600
var oneWayOnwardJourneyTime: String = Utility.timeString(time: onwardTimeCount ?? 100 * 60)
}
但我得到的错误是这样的: