Hello Team,
I try to delete photo from Photos for that i used this method,
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
[PHAssetChangeRequest deleteAssets:@[assetToDelete]];
completionHandler:^(BOOL success, NSError *error) {
}];
This method pops up a dialog with Don't Allow or Delete. But some time in some iPhones not respond PHAssetChangeRequest deleteAssets method that's why that completionHandler not called because of that i can't perform any operation of PHPhotoLibrary then after.
If I restart my iPhone then it works. Many users of my app complained about this issue. I have an iPhone 11 with iOS 15.3. But some iOS 12,14,16 users also face the same issue.
So what exact issue is there? Is it related to iOS or a method?
Thanks,
Ankur
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Posts under Xcode tag
200 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi there! I'm making an app that stores data for the user's profile in SwiftData. I was originally going to use UserDefaults but I thought SwiftData could save Images natively but this is not true so I really could switch back to UserDefaults and save images as Data but I'd like to try to get this to work first. So essentially I have textfields and I save the values of them through a class allProfileData. Here's the code for that:
import SwiftData
import SwiftUI
@Model
class allProfileData {
var profileImageData: Data?
var email: String
var bio: String
var username: String
var profileImage: Image {
if let data = profileImageData,
let uiImage = UIImage(data: data) {
return Image(uiImage: uiImage)
} else {
return Image("DefaultProfile")
}
}
init(email:String, profileImageData: Data?, bio: String, username:String) {
self.profileImageData = profileImageData
self.email = email
self.bio = bio
self.username = username
}
}
To save this I create a new class (I think, I'm new) and save it through ModelContext
import SwiftUI
import SwiftData
struct CreateAccountView: View {
@Query var profiledata: [allProfileData]
@Environment(\.modelContext) private var modelContext
let newData = allProfileData(email: "", profileImageData: nil, bio: "", username: "")
var body: some View {
Button("Button") {
newData.email = email
modelContext.insert(newData)
try? modelContext.save()
print(newData.email)
}
}
}
To fetch the data, I originally thought that @Query would fetch that data but I saw that it fetches it asynchronously so I attempted to manually fetch it, but they both fetched nothing
import SwiftData
import SwiftUI
@Query var profiledata: [allProfileData]
@Environment(\.modelContext) private var modelContext
let fetchRequest = FetchDescriptor<allProfileData>()
let fetchedData = try? modelContext.fetch(fetchRequest)
print("Fetched count: \(fetchedData?.count ?? 0)")
if let imageData = profiledata.first?.profileImageData,
let uiImage = UIImage(data: imageData) {
profileImage = Image(uiImage: uiImage)
} else {
profileImage = Image("DefaultProfile")
}
No errors. Thanks in advance
Hello everyone,
I'm encountering a persistent issue with my newly created widget project, even though it’s a clean, minimal setup. Every time I try to run the widget on the simulator or a device, I get the following error message:
[S:1] Error received: Connection invalidated.
I get this error even in a new project (I just created a new one) when I add a widget extension to it. The app itself works fine—no errors—but when I try to install the widget extension, it always shows me this error.
Initially, I thought the issue was caused by an incorrect URLSession, but even after creating a clean (default) widget extension, the issue persists. I don’t know what to think anymore.
Has anyone encountered this before? It’s completely blocking my progress.
Conditions -
new project from iOS App template
WidgetExtension from template with no changes
Iphone 14 pro
IOS - 18.3.2
ChatGPT in Xcode 26.1 is super slow for me. What used to complete in a batter f seconds is now taking tens of minutes.
Context: M2 Pro MBP, Xcode 26.1, macOS 26.1. CPU stays under 50% while ChatGPT returns. Using the minimal setting. Tried restarting, have verified I have nothing running Electron, no other apps are running.
ChatGPT returns fast for the displayed content but the preview window where it renders code per line takes a few seconds per line.
I have a test target in my app MacPacker (download via github.com/sarensw/MacPacker as this is open source). I want to remove the test target in Xcode. However, Xcode crashes when I try to delete it.
I have submitted an issue in the Feedback app (FB20976404). I'm posting here to see if anyone else has the same issue and has a workaround. Or, maybe there is an alternative way to get rid of a target?
Steps to reproduce:
Open project file
Select test target in TARGETS on the left side of the project file editor
Click the “-“ button to remove that target
Found in:
Xcode 26.1 (and also before in Xcode 26.0)
Hello,
I am facing a recurring issue with Xcode iOS simulator (preview). I want to preview a SwiftUI for iOS in Xcode, but the Simulator app fails to boot up.
I receive the follow error in Xcode:
Cannot Preview in this file. Simulator was shutdown during an update.
I have tried the following:
Uninstall Xcode and reinstall it again
Deleting all developer data
Deleting Xcode cache
Reinstalling iOS Simulator runtimes and reconfiguration of simulators.
Tested using different simulator and runtime versions.
"xcrun simctl --set previews delete al"
I reported the issue:
FB20485454
FB20987522
Thank you.
Best regards,
Jens
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Xcode Previews
Xcode
Simulator
Business and Enterprise
We have the following step before running any tests on CI machine:
xcrun simctl shutdown all && xcrun simctl erase all
It was working perfectly before Xcode 26.1.
On Beta 3 it was doing it for 15 min every time.
When updated to RC1, the tests with cached build are fast (clean goes up to 10 sec), but the package tests clean is still going up to 15 min every time.
We did
xcrun simctl runtime dyld_shared_cache update --all
as advised but it's helping only temporarily. Is this going to be fixed in the official release?
This is probably a silly question, but I couldn't find the answer to it in the forums or in the documentation, though I may be missing something.
I currently have an app with a deployment target of iOS 16 and a watchOS app (not independent) with a deployment target of watchOS 7. I understand what happens when I change the deployment target on the iOS app (e.g., users with iOS/iPadOS versions less than 16 will just never see the updates in the App Store).
But what happens if I change the deployment target of the watchOS dependent app to something like watchOS 8? Will users who have iOS 16 and watchOS 7 (iOS meets deployment target/watchOS does not) get the app update, and it'll just uninstall the watchOS app automatically? Will they just not see the update? Does the old version of the Watch app somehow stay on their watch while the iOS app gets updated?
I’ve developed an Apple Watch extension for an existing iOS app. When I run the app on the watch via Xcode using the simulator, everything works fine. However, when I try to install it on my iPhone, the Watch app doesn’t show it in the "Available Apps" list, so I can't install it on the watch.
The Apple Watch is connected to my iPhone, and I can see other apps available for installation without any issues.
I also created a brand new project with watchOS support to troubleshoot, but the same problem occurred.
Any ideas on how to resolve this?
I am developing an app that allows the user to ask it to process the clipboard contents and do something with it.
In developing a XC UI Test, I find the app stops while it waits for the user to give permission. That breaks the automation.
I tried:
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
let allowButton = springboard.buttons["Allow Paste"]
But that does not work. Is there a way to tell the framework to automatically give the test permission to access the Paste clipboard (or to allow me to write tests to grant this)?
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
Xcode
XCTest
Testing
Swift Testing
Hello everyone,
We are currently facing an issue when testing our hybrid mobile application (built with Ionic and Angular) on the iOS Simulator.
The app works perfectly on physical iOS devices — all HTTP requests complete successfully.
However, when running the same build on the iOS Simulator, every HTTP request fails with the following error:
{
"headers": { "normalizedNames": {}, "lazyUpdate": null, "headers": {} },
"status": 0,
"statusText": "Unknown Error",
"url": "https://api.bizify.com.br/demo/api/ping",
"ok": false,
"name": "HttpErrorResponse",
"message": "Http failure response for https://api.bizify.com.br/demo/api/ping: 0 Unknown Error",
"error": { "isTrusted": true }
}
We have confirmed that the API endpoint https://api.bizify.com.br/demo/api/ping is reachable and secured with a valid SSL certificate.
This issue occurs only in the iOS Simulator — not on Android devices or physical iOS devices.
Has anyone encountered this issue before?
Any insights on why the iOS Simulator might be blocking or failing these HTTPS requests — and how we could resolve it — would be greatly appreciated.
I am using XCode (Version 26.0.1 (17A400)) -> Archive -> Distribute App (or Validate App) to upload my iOS app into App Store Connect.
However I am always getting this error:
Uploading SPI errors: Validation failed (409) The app contains one or more corrupted binaries. Rebuild the app and resubmit.
NSUnderlyingError : Validation failed (-19241) The app contains one or more corrupted binaries. Rebuild the app and resubmit.
code : STATE_ERROR.VALIDATION_ERROR
I tried exporting the app as an IPA and uploading with Transporter, but I see the same error.
I couldn't find any other useful logs or error messages.
More info:
I have created the app in App Store Connect and this is my first time uploading.
The app can build and run on my physical phone and emulator without any problem.
Would be great to get some help!
Thanks!
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store Connect
Xcode
App Submission
When I use Xcode 26 (0.1, 1) for debugging and hit a breakpoint, using "step over" causes the debugger to freeze at a random line of code. Clicking "Pause program execution" indicates that the line is being executed, but the breakpoint never exits, seemingly causing a freeze. The application on the simulator also becomes unresponsive. However, when I do not use breakpoints, my program runs smoothly, and debugging on a physical device does not cause any freezes. This issue only occurs with the simulator. I am using Xcode on Apple Silicon, and due to some third-party SDKs that depend on Rosetta, our app can only run on the Rosetta simulator. We did not encounter this issue when using Xcode 16.x for simulator debugging. The current situation with Xcode 26.x significantly reduces our development efficiency. What could be causing this, and is there a solution?
I'm implementing the 'new' QLThumbnailProvider for our macOS app...
So I just created the skeleton from Xcode, added our QLSupportedContentTypes in Info.plist, and have the skeleton code like below:
import QuickLookThumbnailing
class ThumbnailProvider: QLThumbnailProvider {
override func provideThumbnail(for request: QLFileThumbnailRequest, _ handler: @escaping (QLThumbnailReply?, Error?) -> Void) {
// cannot trigger break point here!
}
I understand I should test the Thumbnail Extension by using:
$ qlmanage -t my_file.ext
Testing Quick Look thumbnails with files:
my_file.ext
But I don't know what process to attach to in the Xcode debugger... a bit clueless...
I've skimmed relevant parts of https://developer.apple.com/videos/play/wwdc2019/719, but there is no real debug tips...
Does anyone know if it is possible to debug with Xcode or not? And if possible, then how? 😅
So I just managed to build one app for personal use that I want to use daily in my iphone. However, once installed in my device through XCode, after one week the application is no longer available.
I'm aware about the one week trial for free users and one year for a paid account, but... for real? Isn't there an alternative? And if not... does it means that in order to use my app for let's say 5 years I will have to pay 500$? Is just a bit crazy to think about it but I did look on the internet and did not found a clear information about how this works.
Thank you in advance :)
Hello Apples,
Noticed that after iOS 26.1 update the Xcode simulator seems to be prompting to login with Apple ID arbitrarily while working on some UI tests.
This does not happen with previous iOS 26.0 or 26.0.1 but is now causing trouble when launching the app or uninstalling at teardown. The current other issue with the uninstallation being sticky and taking a long time (waiting for springboard to become idle) is not helping either.
The dialog seems to appear a bit unreliably to be able to handle it correctly. Have tried both manual springboard dialog mapping and handling as well as an interruption monitor. The latter only seems to work for the first dialog which appears but then ceases to function so not much help…
Anyone else seeing this and are there any knowledge or good workarounds? Or should we just roll back to testing with previous OS versions and cross fingers for iOS 26.2?
Bottom line we cannot login with an Apple ID while running tests on a simulator…
As bonus noticed the simulator background images are not working?
Thanks!
BR,
ARu_ (Senior QE)
ChatGPT in Xcode 26.1 is super slow for me, anyone else?
The response returns quickly but the preview window takes a few seconds per line. What it used to do in a few seconds on 26.0 now takes tens of minutes.
Anyone else running into this and have suggestions? I'm using the minimal setting on a fast internet connection. M2 Pro MBP, macOS 26.1.
Below is the error when I tried to make build file for my application , so that I can add this build file in store connect for Review
Xcode version 26.0.1
System version 26.0.1
.NET Version 9.0 (for application)
application based on MAUI Hybrid Application
Showing Recent Errors Only
Prepare build
error: Multiple commands produce '/Users/mayankjain/Library/Developer/Xcode/DerivedData/PCS_EmpApp-chsylqbxjptobeawzzckymqzagvr/Build/Products/Debug-iphonesimulator/PCS_EmpApp.app/Info.plist'
note: Target 'PCS_EmpApp' (project 'PCS_EmpApp') has copy command from '/Users/mayankjain/Documents/05-NOV-2025-SWETA_IOS/PCS_EmpApp/PCS_EmpApp/xcode-out/Platforms/iOS/Info.plist' to '/Users/mayankjain/Library/Developer/Xcode/DerivedData/PCS_EmpApp-chsylqbxjptobeawzzckymqzagvr/Build/Products/Debug-iphonesimulator/PCS_EmpApp.app/Info.plist'
note: Target 'PCS_EmpApp' (project 'PCS_EmpApp') has process command with output '/Users/mayankjain/Library/Developer/Xcode/DerivedData/PCS_EmpApp-chsylqbxjptobeawzzckymqzagvr/Build/Products/Debug-iphonesimulator/PCS_EmpApp.app/Info.plist'
Multiple commands produce '/Users/mayankjain/Library/Developer/Xcode/DerivedData/PCS_EmpApp-chsylqbxjptobeawzzckymqzagvr/Build/Products/Debug-iphonesimulator/PCS_EmpApp.app/Info.plist'
I was wondering wether you have to create your full app as an Xcode app and then translate it into playgrounds? Because some of the submissions I have seen on YouTube are running on Xcode iPad emulators.
Hey guys, I updated to macOS Tahoe and after that I tried installing Xcode 26, but I always get an error message saying it can’t complete the installation, both through the App Store and via direct download from Apple’s website. Is anyone else having this same issue?