@pierredrks
Hi pierredrks,
Got an error in Swift running at this code: " getRanAnnotations ", stuck here for some days, please help, thanks !:
" extension MapViewController: MKMapViewDelegate {
func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) { self.userLocation = userLocation.location
let lat = self.userLocation?.coordinate.latitude
let lon = self.userLocation?.coordinate.longitude
let ranAnnotations = getRanAnnotations(centerLatitude: lat!, centerLongitude: lon!)
"
fatal error: unexpectedly found nil while unwrapping an Optional value
libswiftCore.dylib`function signature specialization <preserving fragile attribute, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt, flags : Swift.UInt32) â Swift.Never:
0x100611184 <+0>: stp x26, x25, [sp, #-80]!
0x100611188 <+4>: stp x24, x23, [sp, #16]
0x10061118c <+8>: stp x22, x21, [sp, #32]
0x100611190 <+12>: stp x20, x19, [sp, #48]
0x100611194 <+16>: stp x29, x30, [sp, #64]
0x100611198 <+20>: add x29, sp, #64 ; =64
0x10061119c <+24>: mov x19, x6
0x1006111a0 <+28>: mov x20, x5
0x1006111a4 <+32>: mov x21, x4k
0x1006111a8 <+36>: mov x22, x3
0x1006111ac <+40>: mov x23, x2
0x1006111b0 <+44>: mov x24, x1
0x1006111b4 <+48>: mov x25, x0
0x1006111b8 <+52>: adr x8, #936936 ; protocol descriptor for Swift.CVarArg + 88
0x1006111bc <+56>: nop
0x1006111c0 <+60>: add x0, x8, #16 ; =16
0x1006111c4 <+64>: movz w1, #0x28
0x1006111c8 <+68>: orr w2, wzr, #0x7
0x1006111cc <+72>: bl 0x1006114b0 ; rt_swift_allocObject
0x1006111d0 <+76>: mov x8, x0
0x1006111d4 <+80>: stp x22, x21, [x8, #16]
0x1006111d8 <+84>: strb w20, [x8, #32]
0x1006111dc <+88>: str w19, [x8, #36]
0x1006111e0 <+92>: adr x3, #241008 ; partial apply forwarder for Swift.(_fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt, flags : Swift.UInt32) â Swift.Never).(closure #2)
0x1006111e4 <+96>: nop
0x1006111e8 <+100>: mov x0, x25
0x1006111ec <+104>: mov x1, x24
0x1006111f0 <+108>: mov x2, x23
0x1006111f4 <+112>: mov x4, x8
0x1006111f8 <+116>: bl 0x100504b80 ; function signature specialization <preserving fragile attribute, Arg[1] = [Closure Propagated : reabstraction thunk helper from @callee_owned (@unowned Swift.UnsafeBufferPointer<Swift.UInt8>) â () to @callee_owned (@unowned Swift.UnsafeBufferPointer<Swift.UInt8>) â (@out ()), Argument Types : [@callee_owned (@unowned Swift.UnsafeBufferPointer<Swift.UInt8>) â ()]> of generic specialization <preserving fragile attribute, ()> of Swift.StaticString.withUTF8Buffer ((Swift.UnsafeBufferPointer<Swift.UInt8>) â A) â A
â 0x1006111fc <+120>: brk #0x1"