Posts

Post marked as solved
7 Replies
20k Views
Hi!I am developing an app (in XCode Version 11.2 and Swift 4.2) in which I fill in a LinkedList and after working with it, removing the elements that compose it produces the Thread 1 error: EXC_BAD_ACCESS (code = 2, address = 0x16d0f3ff0). The error occurs even without working with the items in the list, simply by adding them and trying to eliminate them the error already occurs. The tests I am doing with an iPhone with IOS version 11.4.1The method that eliminates the elements of the LinkedList is removeAll.The error occurs in the first line:public func removeAll() { self.head = nil //Thread 1: EXC_BAD_ACCESS (code=2, address=0x16d0f3ff0) self.tail = nil self.count = 0} // removeAllthe definition of the variables 'head', 'tail', 'count': private var head: Node<T>? private var tail: Node<T>? public private(set) var count: Int = 0And the type Node<T>:public class Node<T> { var value: T var next: Node<T>? weak var previous: Node<T>? init(value: T) { self.value = value } // init} // NodeWith the debugger I see that the error occurs when assigning the value nil to self.head (in removeAll()). Just before self.head has correct values, it becomes nil and the error is skipped before reaching the next instruction.In the Debug Navigator, in the stackTrace the last 2 functions where the error is seen:libobjc.A.dylib`_object_remove_assocations: 0x180d11eec <+0>: sub sp, sp, #0x70 ; =0x70 -> 0x180d11ef0 <+4>: stp x26, x25, [sp, #0x20] //Thread 1 error: EXC_BAD_ACCESS (code = 2, address = 0x16d0f3ff0) 0x180d11ef4 <+8>: stp x24, x23, [sp, #0x30]libswiftCore.dylib`_swift_release_: 0x104e18d1c <+180>: bl 0x104e1a37c ; bool swift::RefCounts<swift::SideTableRefCountBits>::doDecrement<(swift::PerformDeinit)1>(unsigned int)-> 0x104e18d20 <+184>: ldp x29, x30, [sp], #0x10. //Thread 1 error: EXC_BAD_ACCESS (code = 2, address = 0x16d0f3ff0) 0x104e18d24 <+188>: retDoes someone have idea how to resolve it?Thanks!
Posted
by arekusu.
Last updated
.
Post not yet marked as solved
6 Replies
8.2k Views
Hi!The first thing, to say that all this works correctly debugging with XCode (Swift 4.2), the problem comes when uploading it to the AppStore that gives an error in the DispatchQueue, but I don't know how to see at what point it happens, seeing the log I can only see what happens in the DispatchQueue. This is what the log says, but they are all directions that I do not know how to interpret:Thread 2 name: Dispatch queue: firmwareQueue Thread 2 Crashed: ..... 0 myapp 0x00.......... 1 libdispatch.dylib 0x00.......... 2 libdispatch.dylib 0x00.......... 3 libswiftCore.dylib 0x00.......... 4 myapp 0x00.......... 5 myapp 0x00.......... ...In my program:.....let appDelegate = UIApplication.shared.delegate as! AppDelegatelet progress = ProgressDialog(delegate: appDelegate.viewControllerActive!)progress.Show(animate: true, message: "Updating…") // NOT SHOWINGlet firmwareQueue = DispatchQueue(label:"firmwareQueue"); firmwareQueue.async { self.update_firmware(progress: progress) { ..... }}.....In the function 'update_firmware' it connects via BT with a device and once the connection is established a series of messages are exchanged. In this exchange of messages, a counter is kept to see what is missing from the process and is shown to the user through a progress screen. Progress should be displayed in the ProgressDialog, this is the code inside the update_firmware function to show it:..... DispatchQueue.main.async { self.progress!.SetText(message: "Updating device…") self.progress!.SetProgressTotal(progress: Float(totalBlockCount)) self.progress!.SetShowProgressbar(show: true); }....Although the progress dialog is not displayed before starting to communicate with the device, it does communicate with it and exchange some messages (I see it on the device before the program crashes).Does anyone have any idea how I can see the point where it happens? Or if something similar has happened to someone?Thanks
Posted
by arekusu.
Last updated
.
Post not yet marked as solved
0 Replies
370 Views
Hi!In MKMapView it is possible to hide the name of the seas or oceans? Due to international conflicts I am interested in not seeing their name.Thanks
Posted
by arekusu.
Last updated
.
Post not yet marked as solved
1 Replies
626 Views
Hi!I'm developing an app (in Swift 4.2) that communicates via Bluetooth with a peripheral. So far I wrote and read a characteristic to communicate with him without problems.But now I'm in the following situation, from the didUpdateValueFor method, when the characteristic has a specific value, I execute this code:DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(5), execute: { NotificationCenter.default.post(name: Notification.Name(rawValue: "test"), object: nil)})The function that captures the "test" notification starts a process 'process_X' that must continue writing and reading in the same characteristic several times and sequentially.In this 'process_X', the characteristic is written without problem, but the didUpdateValueFor method does not skip again until the closure that started the post has been completed.Is there any way to get the value of that characteristic within the 'process_X'?Thanks!
Posted
by arekusu.
Last updated
.
Post not yet marked as solved
2 Replies
676 Views
Hi,We are developing an app that talks to a BLE peripheral. The BLE peripheral as well it's firmware is in-house.We have diferent versions of the firmware, some with a custom CBAdvDataManufacturerData and others without it.When we update from the firmware issued by the custom manufacturated to the firmware version that does not issue it, we can see that in the advertisementData.CBAdvDataManufacturerData the previous one continues to arrive. In this case, it should come empty. And we have verified that it is a storage that IOS does. How can we clean that CBAdvDataManufacturerData?(void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSIThanks
Posted
by arekusu.
Last updated
.