I'm developing an application in Swift using Xcode on an iPad Pro. The app communicates over BLE with a custom hardware board.
The board runs a scan algorithm in response to commands from the iPad application. When testing the scan algorithm on the board independently, it completes in approximately 35 ms. However, when triggered via BLE communication from the iPad, the same algorithm takes around 150 ms to complete (roughly equivalent to 3 BLE messages).
Is this level of latency expected when using BLE on iOS, or is there a way to reduce it? I’d appreciate any guidance on improving the performance.
Thank you!
How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here
Code Diagnostics
RSS for tagEnable runtime checks to detect and avoid bugs in your code using Code Diagnostics.
Posts under Code Diagnostics tag
8 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I observed the following problem:
A scientific code to perform Reverse Monte Carlo simulations (‘rmcxas’) compiled with the most up to date version of gcc/gfortran and Xcode including command line tools on Mac OS Sequoia 15.4 on a Macbook air with M4 processor generates the following problem upon starting it in a terminal:
dyld[10154]: dyld cache '(null)' not loaded: syscall to map cache into shared region failed
dyld[10154]: Library not loaded: /usr/lib/libSystem.B.dylib
Referenced from: <0144F82E-003C-37A9-A544-9AE6336E549B> /Users/markuswinterer/bin/rmcxas
Reason: tried: '/usr/lib/libSystem.B.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/libSystem.B.dylib' (no such file), '/usr/lib/libSystem.B.dylib' (no such file, no dyld cache), '/usr/local/lib/libSystem.B.dylib' (no such file)
zsh: abort rmcxas
This occurs only about every 5th time the code is started.
Help would be highly appreciated.
Where is my redeem code
Hi guys,
I've been this app for quite a while and I wanted to add audio to it but I've encountered a strange bug. Whenever I try to play the audio from the testing device, it prints out that the audio file cannot be found. I've checked multiple times the names and the code and I get no errors there whatsoever. I have no idea what might be causing this. Here's a part of the code:
`import SwiftUI
import AVFoundation
struct Card: Identifiable {
let id = UUID()
let heading: String
let description: String
let imageName: String
let detailDescription: String
let sonification: String
}
struct ExplorepageUI: View {
@State private var selectedCard: Card?
@State private var showMore = false
@State private var currentIndex = 0
@State private var currentCards: [Card] = []
let galaxies = [
Card(heading: "The Mice Galaxies",
description: "They’re located about 300 million light-years away in the constellation Coma Berenices.",
imageName: "TheMiceGalaxiesHubble",
detailDescription:"""
Their name refers to the long tails produced by tidal action, the relative difference between gravitational pulls on the near and far parts of each galaxy, known here as a galactic tide. It is a possibility that both galaxies, which are members of the Coma Cluster, have experienced collision, and will continue colliding until they coalesce. The colors of the galaxies are peculiar. In NGC 4676A a core with some dark markings is surrounded by a bluish white remnant of spiral arms. The tail is unusual, starting out blue and terminating in a more yellowish color, despite the fact that the beginning of each arm in virtually every spiral galaxy starts yellow and terminates in a bluish color. NGC 4676B has a yellowish core and two arcs; arm remnants underneath are bluish as well.
The galaxies were photographed in 2002 by the Hubble Space Telescope. In the background of the Mice Galaxies, there are over 3000 galaxies, at distances up to 13 billion light-years.
""",
sonification: "SonificationoftheMiceGalaxies"),
`class MusicPlayer: ObservableObject {
private var audioPlayer: AVPlayer?
func playSound(named sonificationFileName: String){
if let url = Bundle.main.url(forResource: sonificationFileName, withExtension: "mp3"){
print("✅ Found audio file at: \(url)")
audioPlayer = try? AVPlayer(url: url)
audioPlayer?.play()
print("🎵 Audio should now be playing!")
} else {
print("❌ Audio file not found: \(sonificationFileName).mp3")
}
}
func pause(){
audioPlayer?.pause()
}
}
I have some questions about the ADK6.3 Diagnostic function:
If HAP_DIAGNOSTICS_MANUFACTURER is not enabled when compiling ADK, after adding the device through Home, the collecting log function cannot be found in the device settings. What is the reason? How to solve it?
If HAP_DIAGNOSTICS_MANUFACTURER is enabled during compilation, the vendor URL needs to be added when transmitting the diagnostic log. How is this vendor URL defined? How to add it to diagnosticsURLParameters?
How can I use the Home App in iOS device to test diagnostic functions before obtaining certification for HomeKit accessories?
I have the same issue when I added IOS 18 to my code and the Code completion AI. The IOS went through but cant down load the AI got this error: The operation couldn’t be completed. (ModelCatalog.CatalogErrors.AssetErrors error 1.)
Domain: ModelCatalog.CatalogErrors.AssetErrors
Code: 1
User Info: {
DVTErrorCreationDateKey = "2024-10-20 16:04:19 +0000";
}
Failed to find asset: com.apple.fm.code.generate_small_v1.base - no asset
Domain: ModelCatalog.CatalogErrors.AssetErrors
Code: 1
System Information
macOS Version 15.0.1 (Build 24A348)
Xcode 16.0 (23051) (Build 16A242d)
Timestamp: 2024-10-20T09:04:19-07:00
Dear Senior Developer,
I come to you at a time where I am lost.
Over the last 2-3 months, I have noticed a series of crashes occuring on my app. This all started randomly and has now been a regular occurence. Usually, I would receive some detail as it relates to some class or view that is causing this error but now the only details I have is it relates to a UiViewController dealloc even though I am using SwiftUI.
Below I have attached the stack trace from firebase crash analytics. I have spent months on this and I am asking for the help of someone much more senior and knowledable to assist me in this regard.
Thanks again for your help and I await your response. I am also willing to share my screen LIVE to help you help me identify this issue.
manny.GoblinTools_issue_bfd18ee65a92b459d4ecef3475a9ec34_crash_session_032166c28b8c4764b13a6fdca636d2d6_DNE_0_v2_stacktrace.txt
In my React Native mobile application, we are experiencing app termination issues on a few devices (iPhone 13 & 14). We are not getting any logs on Xcode organizer after app termination due to memory leak or terminates by OS.
Could you please suggest a way to log app terminations or recommend any other platform where we can log such events? Alternatively, do you have any suggestions on how to resolve app termination issues?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Xcode
Performance
Organizer Window
Code Diagnostics