Closed tejaskumark closed 10 months ago
Why are you calling LocationManagerDidUpdateLocations
on your delegate?
@progrium Thanks for the reply.
If I don't call that method then it panics with different signature mentioning LocationManagerDidUpdateLocations
must have to be called.
You wanna share that?
Sorry, I should have shared that earlier. Here are the traces
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Delegate must respond to locationManager:didUpdateLocations:'
*** First throw call stack:
(
0 CoreFoundation 0x00000001893d0570 __exceptionPreprocess + 176
1 libobjc.A.dylib 0x0000000188ec1eb4 objc_exception_throw + 60
2 Foundation 0x000000018a51843c -[NSCalendarDate initWithCoder:] + 0
3 CoreLocation 0x0000000193295380 CLClientStopVehicleHeadingUpdates + 61184
4 libffi.dylib 0x0000000199df2050 ffi_call_SYSV + 80
5 libffi.dylib 0x0000000199dfaadc ffi_call_int + 1208
6 macd 0x0000000104ed993c runtime.asmcgocall.abi0 + 124
)
libc++abi: terminating due to uncaught exception of type NSException
SIGABRT: abort
PC=0x1892460dc m=0 sigcode=0
signal arrived during cgo execution
goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x1053e4930, 0x1400014dce8)
/usr/local/go/src/runtime/cgocall.go:157 +0x54 fp=0x1400014dcb0 sp=0x1400014dc70 pc=0x104e7b674
github.com/progrium/macdriver/objc/ffi._Cfunc_ffi_call0(0x14000114ff0, 0x19329509c, 0x105d41400, 0x14000156620)
_cgo_gotypes.go:149 +0x34 fp=0x1400014dce0 sp=0x1400014dcb0 pc=0x104f432a4
github.com/progrium/macdriver/objc/ffi.Call.func1(0x14000114ff0?, 0x200000001?, 0x199dfb2e8?, {0x14000156620?, 0x100000000?, 0x14000114ff0?})
/Users/test/go/pkg/mod/github.com/progrium/macdriver@v0.5.0-preview.0.20231114193140-e468a641af06/objc/ffi/ffi.go:75 +0x6c fp=0x1400014dd30 sp=0x1400014dce0 pc=0x104f4379c
github.com/progrium/macdriver/objc/ffi.Call(0x14000114ff0, 0x14000156630?, 0x105d41400, {0x14000156620, 0x2, 0x2})
/Users/test/go/pkg/mod/github.com/progrium/macdriver@v0.5.0-preview.0.20231114193140-e468a641af06/objc/ffi/ffi.go:75 +0x30 fp=0x1400014dd90 sp=0x1400014dd30 pc=0x104f436d0
github.com/progrium/macdriver/objc.Call[...]({0x1055f32e0, 0x60000303cb60}, {0x1d87d6e23}, {0x0, 0x0, 0x1054decc0})
/Users/test/go/pkg/mod/github.com/progrium/macdriver@v0.5.0-preview.0.20231114193140-e468a641af06/objc/call.go:61 +0x518 fp=0x1400014de80 sp=0x1400014dd90 pc=0x104f5a648
github.com/progrium/macdriver/macos/corelocation.LocationManager.RequestLocation({{0x140000021a0?}})
/Users/test/go/pkg/mod/github.com/progrium/macdriver@v0.5.0-preview.0.20231114193140-e468a641af06/macos/corelocation/location_manager.gen.go:257 +0x54 fp=0x1400014ded0 sp=0x1400014de80 pc=0x1053d2544
main.main()
/Users/test/example_macos/main.go:25 +0x98 fp=0x1400014df70 sp=0x1400014ded0 pc=0x1053e1848
runtime.main()
/usr/local/go/src/runtime/proc.go:250 +0x248 fp=0x1400014dfd0 sp=0x1400014df70 pc=0x104eacbf8
runtime.goexit()
/usr/local/go/src/runtime/asm_arm64.s:1172 +0x4 fp=0x1400014dfd0 sp=0x1400014dfd0 pc=0x104ed9b14
goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/usr/local/go/src/runtime/proc.go:381 +0xe4 fp=0x14000046fa0 sp=0x14000046f80 pc=0x104ead024
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:387
runtime.forcegchelper()
/usr/local/go/src/runtime/proc.go:305 +0xb8 fp=0x14000046fd0 sp=0x14000046fa0 pc=0x104eace68
runtime.goexit()
/usr/local/go/src/runtime/asm_arm64.s:1172 +0x4 fp=0x14000046fd0 sp=0x14000046fd0 pc=0x104ed9b14
created by runtime.init.6
/usr/local/go/src/runtime/proc.go:293 +0x24
goroutine 3 [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/usr/local/go/src/runtime/proc.go:381 +0xe4 fp=0x14000047760 sp=0x14000047740 pc=0x104ead024
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:387
runtime.bgsweep(0x0?)
/usr/local/go/src/runtime/mgcsweep.go:278 +0xa4 fp=0x140000477b0 sp=0x14000047760 pc=0x104e9a204
runtime.gcenable.func1()
/usr/local/go/src/runtime/mgc.go:178 +0x28 fp=0x140000477d0 sp=0x140000477b0 pc=0x104e8ed28
runtime.goexit()
/usr/local/go/src/runtime/asm_arm64.s:1172 +0x4 fp=0x140000477d0 sp=0x140000477d0 pc=0x104ed9b14
created by runtime.gcenable
/usr/local/go/src/runtime/mgc.go:178 +0x74
goroutine 4 [GC scavenge wait]:
runtime.gopark(0x1400006e000?, 0x105449580?, 0x1?, 0x0?, 0x0?)
/usr/local/go/src/runtime/proc.go:381 +0xe4 fp=0x14000047f50 sp=0x14000047f30 pc=0x104ead024
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:387
runtime.(*scavengerState).park(0x105d0d8a0)
/usr/local/go/src/runtime/mgcscavenge.go:400 +0x5c fp=0x14000047f80 sp=0x14000047f50 pc=0x104e9808c
runtime.bgscavenge(0x0?)
/usr/local/go/src/runtime/mgcscavenge.go:628 +0x44 fp=0x14000047fb0 sp=0x14000047f80 pc=0x104e98604
runtime.gcenable.func2()
/usr/local/go/src/runtime/mgc.go:179 +0x28 fp=0x14000047fd0 sp=0x14000047fb0 pc=0x104e8ecc8
runtime.goexit()
/usr/local/go/src/runtime/asm_arm64.s:1172 +0x4 fp=0x14000047fd0 sp=0x14000047fd0 pc=0x104ed9b14
created by runtime.gcenable
/usr/local/go/src/runtime/mgc.go:179 +0xb8
goroutine 18 [finalizer wait]:
runtime.gopark(0x140000465a8?, 0x104e845f0?, 0xa0?, 0x1b?, 0x10615ca90?)
/usr/local/go/src/runtime/proc.go:381 +0xe4 fp=0x14000046580 sp=0x14000046560 pc=0x104ead024
runtime.runfinq()
/usr/local/go/src/runtime/mfinal.go:193 +0x10c fp=0x140000467d0 sp=0x14000046580 pc=0x104e8ddbc
runtime.goexit()
/usr/local/go/src/runtime/asm_arm64.s:1172 +0x4 fp=0x140000467d0 sp=0x140000467d0 pc=0x104ed9b14
created by runtime.createfing
/usr/local/go/src/runtime/mfinal.go:163 +0x84
r0 0x0
r1 0x0
r2 0x0
r3 0x0
r4 0x189239377
r5 0x16af89d60
r6 0x6e
r7 0x880
r8 0xb51a6e7232b2cde
r9 0xb51a6e6fc8efcde
r10 0x200
r11 0xb
r12 0x0
r13 0x1ff800
r14 0x7fb
r15 0x8363900e
r16 0x148
r17 0x1e8acf340
r18 0x0
r19 0x6
r20 0x1dfa5d000
r21 0x103
r22 0x1dfa5d0e0
r23 0x1e3c5a808
r24 0x1dea3b000
r25 0x0
r26 0x2
r27 0x2
r28 0x140001283d8
r29 0x16af89cd0
lr 0x18927dcc0
sp 0x16af89cb0
pc 0x1892460dc
fault 0x1892460dc
But it's saying you need to implement it. locationdelegate.SetLocationManagerDidUpdateLocations(...)
Thanks a lot, was able to make it work.
Hello Experts,
I was trying to build one small program with example provided and wanted to show location details of device in opened window.
Since I am yet learning new things about Mac OS, I am not able to figure out why things are giving me panic on line 22. If someone can help here that would be great help.
Panic signature
Below is my example code,