ios - Apple Watch coreLocation error *** Assertion failure in -[CLLocationManager requestLocation] -
i tried user current location on apple watch corelocation. whenever run -[cllocationmanager requestlocation]
, app quits , give following error.
2016-02-07 16:38:39.392 placescope apple watch extension[6255:1471552] *** assertion failure in -[cllocationmanager requestlocation], /buildroot/library/caches/com.apple.xbs/sources/corelocationframework_sim/corelocation-1861.3.25.31/framework/corelocation/cllocationmanager.m:816 2016-02-07 16:38:39.395 placescope apple watch extension[6255:1471552] *** terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'delegate must respond locationmanager:didupdatelocations:' *** first throw call stack: ( 0 corefoundation 0x00bb9fc4 __exceptionpreprocess + 180 1 libobjc.a.dylib 0x00671df4 objc_exception_throw + 50 2 corefoundation 0x00bb9e5a +[nsexception raise:format:arguments:] + 138 3 foundation 0x0029a008 -[nsassertionhandler handlefailureinmethod:object:file:linenumber:description:] + 118 4 corelocation 0x0013a4f9 clclientgetcapabilities + 12683 5 placescope apple watch extension 0x0002edbf -[recommendations awakewithcontext:] + 447 6 watchkit 0x000c2930 _wkinterfacecontrollercreateclass + 482 7 watchkit 0x000af002 __48-[spremoteinterface handleplist:fromidentifier:]_block_invoke_2 + 470 8 watchkit 0x000aebb9 __48-[spremoteinterface handleplist:fromidentifier:]_block_invoke + 1245 9 libdispatch.dylib 0x0415a71b _dispatch_call_block_and_release + 15 10 libdispatch.dylib 0x041783fd _dispatch_client_callout + 14 11 libdispatch.dylib 0x04160fbe _dispatch_main_queue_callback_4cf + 689 12 corefoundation 0x00b066fe __cfrunloop_is_servicing_the_main_dispatch_queue__ + 14 13 corefoundation 0x00ac49a4 __cfrunlooprun + 2356 14 corefoundation 0x00ac3db6 cfrunlooprunspecific + 470 15 corefoundation 0x00ac3bcb cfrunloopruninmode + 123 16 foundation 0x0022dac1 -[nsrunloop(nsrunloop) runmode:beforedate:] + 308 17 foundation 0x002d499d -[nsrunloop(nsrunloop) run] + 82 18 libxpc.dylib 0x0448206f _xpc_objc_main + 486 19 libxpc.dylib 0x04484dce xpc_main + 215 20 foundation 0x003fe3cd service_connection_handler + 0 21 pluginkit 0x035f1232 -[pkservice run] + 582 22 watchkit 0x000d1549 main + 146 23 libdyld.dylib 0x0419dad5 start + 1 ) libc++abi.dylib: terminating uncaught exception of type nsexception
this code:
locationmanager = [[cllocationmanager alloc] init]; locationmanager.delegate = self; [locationmanager requestwheninuseauthorization]; [locationmanager requestlocation];
if have better way user's location please let me know well.
based on error message, 'delegate must respond locationmanager:didupdatelocations:'
have implement locationmanager:didupdatelocations:
, locationmanager:didfailwitherror:
in delegate in order use requestlocation.
Comments
Post a Comment