Hello, I am trying to run a yolo26n-pose model on my iphone and I am using xcode to do this. I have read the yolo on ios documentation on github, and have followed the instructions regarding converting the model to coreML and having that in the correct directory in xcode. I added packages from the github in order for my code to run.
Thanks — from that screenshot, this looks like a Swift/Xcode concurrency compatibility issue, not a problem with your Ultralytics YOLO26 CoreML export. The yolo-ios-app example was written before Swift 6’s stricter concurrency checks, so newer Xcode versions can throw Reference to captured var 'self' in concurrently-executing code in YOLOView.swift.
So the short answer is: it happens because newer Swift treats capturing mutable self inside async/concurrent closures as a possible data race.
The quickest workaround is usually to use Xcode 15 / Swift 5.x, or make the package local/forked and patch those closures in YOLOView.swift so they don’t capture mutable self directly. Common fixes are patterns like [weak self] or copying values to let constants before entering the async block.
Your CoreML export flow is still the right one per the CoreML export docs. If you paste the exact few lines around the failing code in YOLOView.swift, I can point you to the precise Swift fix.