Sometime I've got an issue in this function :
func getCurrentEvent(events: RealmSwift.List) -> Event? {
let curDate = Date()
let filtered = events.filter { event in
return (curDate >= event.start) && (curDate <= event.end)
}
if let firstEvent = filtered.first {
return firstEvent
}
return nil
}
Log:
#0 (null) in __exceptionPreprocess ()
#1 (null) in objc_exception_throw ()
#2 (null) in -[NSException raise] ()
#3 0x10238cf80 in throwRealmException(_:userInfo:) at realm-swift/RealmSwift/Util.swift:53
#4 0x10238cf80 in staticBridgeCast(fromObjectiveC:) at realm-swift/RealmSwift/Util.swift:132
#5 0x10231fdb8 in List.subscript.getter at realm-swift/RealmSwift/List.swift:73
#6 (null) in specialized List.subscript.read ()
#7 (null) in specialized protocol witness for Collection.subscript.read in conformance List ()
#8 (null) in specialized LazyFilterSequence<>.startIndex.getter ()
#9 (null) in specialized protocol witness for Collection.startIndex.getter in conformance <> LazyFilterSequence ()
#10 (null) in specialized Collection.first.getter ()
#11 (null) in mainView.getCurrentEvent(events:) ()
How can I secure this function to avoid this ?
thanks for your help
Post
Replies
Boosts
Views
Activity
Hello,
After added 'Watch app for iOS app' template in my project app (it is working fine on iPhone Xcode simulator), I would like to test my original app using "My Mac (Designed for iPad)" simulator but I've got the following error:
The WKRunsIndependentlyOfCompanionApp key must be present in your WatchKit extension's Info.plist, not the WatchKit app's.
It was working before adding the iWatch extension.
So how to fix it ?
I have tried to toggle: 'App can run independently of Companion iPhone' without success
thanks for your help
Hello
I want to know how to send a PDU (set) in SNMP format on port 161.
I know the OID, the community string "public", the version (1) etc
Is there an API or package that can do that easily in swiftui ?
(I've got last version of xcode and swiftui)
thanks