Post

Replies

Boosts

Views

Activity

Reply to concurrent downloading of files with URLSession downloadTask with background configuration.
Ah, this makes sense. I appreciate the counter usage example. let q = OperationQueue() q.maxConcurrentOperationCount = 1 Isn’t that essentially the same as using nil for the delegateQueue here: urlSession = URLSession(configuration: config, delegate: self, delegateQueue: nil) Both are background serial queues, correct? I need to use a URLSession with background config, creating many downloadTasks at a time, taking a while to run. So I believe I need to stick to a background queue instead of main. Please go ahead and explain my options here. Thanks! bvsdev
May ’26
Reply to concurrent downloading of files with URLSession downloadTask with background configuration.
Hello Apple Engineer, Thank you for all this detailed information! I’ve seen the first resource, but will be sure to dig into the other two. I will need to use a few background sessions in the app. Are session delegate methods thread safe when running multiple downloadTasks on it? My attempt to make the session delegate writes thread safe has prevented it from moving the downloaded files. The same error is seen on the Sim and the Device. I’ve searched the forum posts and haven’t found anything related to this error. I cannot post the full sample code here since it contains sensitive backend server information we don’t want to expose, but if you could take a look at DTS Case-ID: 19714751 containing the attached sample code I just updated, I would appreciate that very much. I’ve also added the error message I’m seeing as a comment in the sample code. It is a very small test project, I think it will take you at most 2 minutes to read through it all :) Thanks, bvsdev
May ’26
Reply to RealityKit / visionOS – Memory not released after dismissing ImmersiveSpace with USDZ models
Filed ticket number FB21327973 with sample test app demonstrating memory pressure with UnlitMaterial usage. Also seeing an Error on some images, although they are still being rendered on the device: IOSurface creation failed: e00002c2 parentID: 00000000 properties: { IOSurfaceAddress = 4380393472; IOSurfaceAllocSize = 20027995; IOSurfaceCacheMode = 0; IOSurfaceMapCacheAttribute = 1; IOSurfaceName = CMPhoto; IOSurfacePixelFormat = 1246774599; } IOSurface creation failed: e00002c2 parentID: 00000000 property: IOSurfaceCacheMode
Topic: Spatial Computing SubTopic: General Tags:
Dec ’25
Reply to RealityKit / visionOS – Memory not released after dismissing ImmersiveSpace with USDZ models
The OS is shutting down our app due to high memory usage. In our app, each “room” is an immersive space with a skybox. Within the room we navigate through a variety of spaces, each with its own texture to be used in the skybox material. Each time we swap out the skybox material the memory usage grows significantly. When we exit each room (immersive space), we remove the skybox (removeFromParent), assign it to nil, and have even tried to set the Texture to nil. Exiting a room doesn’t appear to release any of the allocated memory. Each time we enter a new room the memory usage climbs until we reach about 5G, by which time the app is closed by the system. Should we remove the UnlitMaterial reference in each room object as well upon exiting immersive space? We also observed that when we navigated through spaces that we’ve previously visited, the Persistent Bytes don’t grow even though we are releasing the Texture resource upon exiting a space, then re-creating the TextureResource when we enter it again. Could these Textures or Materials be cached by the system? Our images are high resolution 16K images. VisionOS 26, Xcode 26.1.1 Meanwhile we are going through the code base line by line to make sure we haven’t maintained a strong reference to the skybox or texture resource elsewhere. Attaching memory allocations at shutdown: Thanks, bvsdev
Topic: Spatial Computing SubTopic: General Tags:
Dec ’25
Reply to visionOS: Unable to programmatically close child WindowGroup when parent window closes
Hello, You could try making use of scene phases to alert the app when the parent window is being closed. See https://developer.apple.com/documentation/swiftui/scenephase Unfortunately, this approach doesn't work for us consistently in Immersive Space. In Vision 26, we have some additional tools available. Check out .restorationBehavior and .defaultLaunchBehavior described in this document. https://developer.apple.com/documentation/visionos/adopting-best-practices-for-scene-restoration/ Good luck!
Topic: Spatial Computing SubTopic: General Tags:
Aug ’25
Reply to How to configure Spatial Audio on a Video Material?, Compile error.
Hello, We have SpatialAudioComponent set on the sphere to play audio when certain Entities within the sphere are tapped. That part works great. However, when we switch out the image material on the sphere with a VideoMaterial, the spatial sound doesn't appear to be enabled. The volume actually decreases. Is there some meta data we are missing somewhere to spatially play the audio in the video? Thank you! bvsdev
Topic: Spatial Computing SubTopic: General Tags:
Jul ’25
Reply to Agree not working for Xcode 27 license agreement
After extracting, drag the Xcode 27 beta app into the Applications folder. It will then accept the agreement and continue from there.
Replies
Boosts
Views
Activity
1w
Reply to concurrent downloading of files with URLSession downloadTask with background configuration.
Ah, this makes sense. I appreciate the counter usage example. let q = OperationQueue() q.maxConcurrentOperationCount = 1 Isn’t that essentially the same as using nil for the delegateQueue here: urlSession = URLSession(configuration: config, delegate: self, delegateQueue: nil) Both are background serial queues, correct? I need to use a URLSession with background config, creating many downloadTasks at a time, taking a while to run. So I believe I need to stick to a background queue instead of main. Please go ahead and explain my options here. Thanks! bvsdev
Replies
Boosts
Views
Activity
May ’26
Reply to concurrent downloading of files with URLSession downloadTask with background configuration.
Hello Apple Engineer, Thank you for all this detailed information! I’ve seen the first resource, but will be sure to dig into the other two. I will need to use a few background sessions in the app. Are session delegate methods thread safe when running multiple downloadTasks on it? My attempt to make the session delegate writes thread safe has prevented it from moving the downloaded files. The same error is seen on the Sim and the Device. I’ve searched the forum posts and haven’t found anything related to this error. I cannot post the full sample code here since it contains sensitive backend server information we don’t want to expose, but if you could take a look at DTS Case-ID: 19714751 containing the attached sample code I just updated, I would appreciate that very much. I’ve also added the error message I’m seeing as a comment in the sample code. It is a very small test project, I think it will take you at most 2 minutes to read through it all :) Thanks, bvsdev
Replies
Boosts
Views
Activity
May ’26
Reply to NSURLSession background downloadTasks sometimes calling urlSession(_:downloadTask:didFinishDownloadingTo:) *twice*
I've seen the double urlSession(_:downloadTask:didFinishDownloadingTo happen intermittently in visionOS26.3 / Xcode 26.3. Not a big deal since we can work around it, but I just thought I'd mention it if it's a bug in the framework.
Replies
Boosts
Views
Activity
Apr ’26
Reply to RealityKit / visionOS – Memory not released after dismissing ImmersiveSpace with USDZ models
Filed ticket number FB21327973 with sample test app demonstrating memory pressure with UnlitMaterial usage. Also seeing an Error on some images, although they are still being rendered on the device: IOSurface creation failed: e00002c2 parentID: 00000000 properties: { IOSurfaceAddress = 4380393472; IOSurfaceAllocSize = 20027995; IOSurfaceCacheMode = 0; IOSurfaceMapCacheAttribute = 1; IOSurfaceName = CMPhoto; IOSurfacePixelFormat = 1246774599; } IOSurface creation failed: e00002c2 parentID: 00000000 property: IOSurfaceCacheMode
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’25
Reply to RealityKit / visionOS – Memory not released after dismissing ImmersiveSpace with USDZ models
The OS is shutting down our app due to high memory usage. In our app, each “room” is an immersive space with a skybox. Within the room we navigate through a variety of spaces, each with its own texture to be used in the skybox material. Each time we swap out the skybox material the memory usage grows significantly. When we exit each room (immersive space), we remove the skybox (removeFromParent), assign it to nil, and have even tried to set the Texture to nil. Exiting a room doesn’t appear to release any of the allocated memory. Each time we enter a new room the memory usage climbs until we reach about 5G, by which time the app is closed by the system. Should we remove the UnlitMaterial reference in each room object as well upon exiting immersive space? We also observed that when we navigated through spaces that we’ve previously visited, the Persistent Bytes don’t grow even though we are releasing the Texture resource upon exiting a space, then re-creating the TextureResource when we enter it again. Could these Textures or Materials be cached by the system? Our images are high resolution 16K images. VisionOS 26, Xcode 26.1.1 Meanwhile we are going through the code base line by line to make sure we haven’t maintained a strong reference to the skybox or texture resource elsewhere. Attaching memory allocations at shutdown: Thanks, bvsdev
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’25
Reply to visionOS: Unable to programmatically close child WindowGroup when parent window closes
Hello, You could try making use of scene phases to alert the app when the parent window is being closed. See https://developer.apple.com/documentation/swiftui/scenephase Unfortunately, this approach doesn't work for us consistently in Immersive Space. In Vision 26, we have some additional tools available. Check out .restorationBehavior and .defaultLaunchBehavior described in this document. https://developer.apple.com/documentation/visionos/adopting-best-practices-for-scene-restoration/ Good luck!
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to How to configure Spatial Audio on a Video Material?, Compile error.
Hello, We have SpatialAudioComponent set on the sphere to play audio when certain Entities within the sphere are tapped. That part works great. However, when we switch out the image material on the sphere with a VideoMaterial, the spatial sound doesn't appear to be enabled. The volume actually decreases. Is there some meta data we are missing somewhere to spatially play the audio in the video? Thank you! bvsdev
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to Reality Composer - compound objects
Sorry, I meant the y values. Is there a designer who could help with this basic issue? TIA.
Replies
Boosts
Views
Activity
Jun ’23