Build, test, and submit your app using Xcode, Apple's integrated development environment.

Xcode Documentation

Posts under Xcode tag

3,454 Posts
Sort by:
Post not yet marked as solved
0 Replies
53 Views
Hi, I am developing an app which has a calendar integrated. This calendar comes from a package called CalendarKit (https://github.com/richardtop/CalendarKit ). With this calendar you can access to all the events of you mobile integrated calendar and create new ones, modify them, delete, etc. All the events on you mobile calendar are going to be represented here and the same in the other way, everything that you create here will be represented on you mobile calendar. So the main question is. How can i access to the 'Delete Event' action inside the 'Event Details' view? I know that i can delete an event programmatically, but i need to "modify" the behavior when clicking on the item 'Delete Event'. Is there any possible way to access to this item inside event details and when clicking on it do a custom action?. For example, when clicking i want to: print a text in the console, show an alert, get the EventID of the event deleted, etc. Can somebody help me with this?? Thanks a lot in advance.
Posted
by
Post not yet marked as solved
0 Replies
47 Views
I'm currently trying to save a selected image in core data as a type data, but I'm getting an error in the persistence file marked with a comment. I've included my code and any questions I will gladly answer. Thanks for any help! Content View: import SwiftUI import PhotosUI struct ContentView: View {     @ObservedObject var persistence = PersistenceController.shared     @State var selectedItems: [PhotosPickerItem] = []     @State var data: Data?     var body: some View {         NavigationView{             VStack{                 Spacer()                 VStack{                     Spacer()                     if let data = data, let uiimage = UIImage(data: data) {                         Image(uiImage: uiimage)                             .resizable()                             .scaledToFit()                             .frame(width: 250, height: 500)                     }                     Spacer()                 }                 Spacer()                 PhotosPicker(selection: $selectedItems, maxSelectionCount: 1, matching: .images){                     Text("Pick Photo")                 }                 .onChange(of: selectedItems){ newValue in                     guard let item = selectedItems.first else{                         return                     }                     item.loadTransferable(type: Data.self){ result in                         switch result {                         case .success(let data):                             if let data = data{                                 self.data = data                             } else {                                 print("Data is nil")                             }                         case .failure(let failure):                             fatalError("\(failure)")                         }                     }                 }                 Spacer()             }             .navigationBarItems(trailing: addButton)         }     }     var addButton: some View {         Button(action: {             guard let item = selectedItems.first else{                 return             }             item.loadTransferable(type: Data.self){ result in                 switch result {                 case .success(let data):                     if let data = data{                         persistence.addObject(image: data)                     } else {                         print("Data is nil")                     }                 case .failure(let failure):                     fatalError("\(failure)")                 }             }         }){             Text("Add Image").bold()         }     } } Persistence: import Foundation import CoreData class PersistenceController: ObservableObject {     static let shared = PersistenceController()     let container: NSPersistentContainer     init(inMemory: Bool = false) {         container = NSPersistentContainer(name: "ReciPlanner")         if inMemory {             container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null")         }         container.loadPersistentStores(completionHandler: { (storeDescription, error) in             if let error = error as NSError? {                 fatalError("Unresolved error \(error), \(error.userInfo)")             }         })         container.viewContext.automaticallyMergesChangesFromParent = true     }          func addObject(image: Data){         let context = container.viewContext         let object = Object(context: context) //Error: Thread 7: "An NSManagedObject of class 'Object' must have a valid NSEntityDescription."         object.item = image     }          func contextSave() {         let context = container.viewContext         if context.hasChanges {             do {                 try context.save()             } catch {                 print("**** ERROR: Unable to save context \(error)")             }         }     } } Data Model:
Posted
by
Post not yet marked as solved
2 Replies
104 Views
Hi. I'm using Xcode Version 13.4.1. I have a project that builds an iOS app successfully in Xcode cloud. However, I am getting errors when trying to execute the archiving action. It seems archiving for app-store distribution works but fails archiving for development distribution and ad-hoc distribution. I only need the archive for app-store distribution and so what is the way to disable archiving for the other two ? Also, is there any way to provide a custom export options plist ?
Posted
by
Post not yet marked as solved
1 Replies
67 Views
Started having problems with Xcode 13 after installing Xcode 14 Beta 2 days ago. Xcode would quit every time I click on "main (storyboard)". Also, simulator was missing. So I deleted both Xcode and the Beta, emptied the trash can and reinstalled Xcode. Simulator was still missing. Checked the forum for possible solutions and deleted the 'developer' folder under library, and then reinstalled Xcode 13. This time it asked if I wanted to install additional components. I clicked install and Xcode quit. Now each time I try to open Xcode, it asks if I want to install additional components, but doesn't wait for me to click 'install'. It just quits! Would greatly appreciate any insights into resolving this issue. Thanks!
Posted
by
Post not yet marked as solved
0 Replies
59 Views
Given is an app project with two SPM dependencies: one to a source code repro and one to a repro containing in XCFramework. Using "Build Documentation" in Xcode generates the documentation for the app and source framework but not for the XCFramework. Wonder, why the documentation is not generated from the symbol graph of the binary Tried to create a .doccarchive with the framework using "Build Documentation during 'Build'" build setting, but: .doccarchive is not copied when creating a XCFramework after adding .doccarchive to XCFramework, it will not be resolved and downloaded via SPM Is there any way to distribute the documentation of my binary framework over SPM to be displayed in the Documentsbrowser using the "Build Documentation" command?
Posted
by
Post not yet marked as solved
1 Replies
47 Views
Anyone know how I can delete a URL Type and add URL Type properties? It says click here to add properties but that does nothing.
Posted
by
Post not yet marked as solved
0 Replies
47 Views
Hi Team, I have created single app project with Family controls capabilities and added respected framework. Once it's done I am not able to see App scheme in Active scheme area. When I try to run the project, Choose app to run pop-up getting shown. Any help on this please?
Posted
by
Post not yet marked as solved
0 Replies
54 Views
Using xCode 13.4.1, my assets catalog (assets.xcassets) has gone blank. Which is to say when I click on the icon in the left-hand Navigator, the normal OutlineView and DetailView are replaced by a large white area of screen. If I try, for example, to drag a new image file into this area, it bounces out. The existing assets are still there; when I run the app the images, etc., appear as expected. I just can't see them to manage them (or add new assets). I have restarted xCode several times to no avail. Has this ever happened before? Does anyone have a solution? BTW, in other app projects, the assets catalogs are working normally. It is just in one project where the catalog is "blank"
Posted
by
Post not yet marked as solved
0 Replies
65 Views
We have a project that compiles an app for both x64 and arm64 Mac machines. This build is done via Visual Studio MSBuild with specific RIDs and Mac native code via xcode. Using the 'packages' application we build an distribution package, which contains the two pkgs for the specific architectures. The project contains settings to pick the correct PKG according to the architecture running the installation ('packages' will include a JavaScript script in the Distribution file for this). This all works just fine when running the final PKG manually. But when deploying via Intune as LOB this doesn't work well. It seems Intune will skip the complete Distribution file and will install all the PKGs included in to distribution package. The logfile shows that both x64 and arm64 are installed Install.log This will result in the x64 to be installed, and being overwritten by the arm64 installation. And a non-functional app on a x64 based Mac. We edited the preinstall.sh for both packages and do another architecture check and error-out when running on a wrong platform; but that doesn't work either: Intune will cancel the whole installation transaction when one pkg fails. Resulting in a non-installed package. What would be a good way to create an universal installation/distribution package with both architectures which would be able to be deployed via intune?
Posted
by
Post not yet marked as solved
10 Replies
452 Views
I'm getting the Error Analyzing App Version error when using xcode and transporter. Anyone else having this issue as well? Everything worked fine yesterday.
Posted
by
Post marked as solved
3 Replies
85 Views
I have no idea how to solve this. I am not using many local variables, yet I am hitting the 512 KiB stack size limit for secondary threads. My app has already been close to hitting this, now it's definitely hitting it. How the heck do I trace this down? Instruments has nothing about stack memory usage.
Posted
by
Post not yet marked as solved
0 Replies
51 Views
Hi there, Working on my first game project and I'm really at a loss here. I have Unity Ads installed in my mobile game project and it works perfectly fine in Unity and if I directly upload a build from Xcode to my iPhone. If I try to Archive the build in Xcode and load it for Distribution on the App Store, all of the Ads don't play. I'm not sure how to see if TestFlight is throwing any errors with regards to the Ads, but everything else in the game works perfectly fine including IAPs. I'd greatly appreciate any suggestions, guidance, or just outright instructions. Thanks so much in advance!
Posted
by
Post not yet marked as solved
2 Replies
78 Views
productbuild.crash While doing the final .pkg file calling the tool: productbuild --distribution "$DIS_FILE" --resources "$RES_DIR" --package-path "$PKGS" --version "$VERSION" "$PKG_NAME" And the crash stack is: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libxar.1.dylib 0x00007fff2ae2c00c xar_file_new_from_parent + 190 1 libxar.1.dylib 0x00007fff2ae29d59 xar_add_frombuffer + 63 2 com.apple.PackageKit 0x00007fff3ba79a2f -[PKMutableXARArchive setData:forPath:compressed:] + 246 3 com.apple.PackageKit 0x00007fff3babb38e -[PKArchiveDistributionContainer setResourceData:forKey:forLocalization:] + 284 4 com.apple.PackageKit 0x00007fff3bab9fef -[PKMutableDistributionContainer storeResourcesAtPath:forLocalization:] + 922 5 com.apple.PackageKit 0x00007fff3baa5590 -[PKArchiveProduct(ForMutableSubclassers) addResourceDataAtPath:] + 324 6 productbuild 0x000000010efdc8a8 0x10efd8000 + 18600 7 productbuild 0x000000010efdba6e 0x10efd8000 + 14958 8 libdyld.dylib 0x00007fff204c0f3d start + 1 While using macOS 11.6.7, xcode 12.3, and CLT 11.1
Posted
by
Post not yet marked as solved
0 Replies
51 Views
Recently we get more and more problems due to non bootstraping or starting simulator clones on parallel testing. Unit & UI-Tests were all successful but the status is failed, because of this errors 'The test runner encountered an error (Failed to prepare device 'Clone 1 of iPhone 12' for impending launch.' The test runner encountered an error (Failed to prepare device 'Clone 4 of iPhone 12' for impending launch. CI environments are MacMinis based on intel and apple silicons, with Xcode 13.3.1.
Posted
by
Post not yet marked as solved
0 Replies
46 Views
Hi When I run my tests using the Xcode IDE (i.e. test plans) with parallel execution, I can see that my tests are evenly distributed to multiple iOS simulators but the same is not achieved by using the xcodebuild tool using terminal xcodebuild test-without-building -parallel-testing-enabled YES -parallel-testing-worker-count 3 -maximum-parallel-testing-workers 3 -destination "platform=iOS Simulator,name=iPhone 13,OS=15.2" -xctestrun "/var/folders/x5/ps80s0290qv1j5hn53mvxsf00000gq/T/tmp.QB6StvRC/XCTest-Gherkin-Example_TestPlan1_iphonesimulator15.5-x86_64.xctestrun" -resultBundlePath "/var/folders/x5/ps80s0290qv1j5hn53mvxsf00000gq/T/tmp.QB6StvRC/GherkinLocal.xcresult"
Posted
by
Post marked as solved
3 Replies
132 Views
Hi, I'd greatly appreciate any help with this problem. I have developed an app for both iOS and android. The app is built with Kivy and Python, it functions as expected however in Xcode I cannot find a way to prevent the phone/device from dimming and locking. I'm very new to Xcode and iOS, but I ave tried several variations of. [UIApplication sharedApplication].idleTimerDisabled = YES; in multiple areas of the m Main but I cannot get it to work, no matter what I try the phone still goes to sleep/locks. If that code above is supposed to work, I have no idea where to put it. As far as I can tell, the only places I could enter something like that is in the main.m, bridge.m and bridge.h code; or somewhere in the info.plist I'm currently lost, feels like a simple problem.
Posted
by
Post marked as solved
1 Replies
83 Views
I made a new command-line tool C++ project in Xcode, with the following main.cpp: #include <iostream> int main() {   std::cout << "Hello, World!\n"; } When I try to profile it in Instruments with any template, I get the following error before my program even starts: Failed to execute loader thread for /Applications/Xcode.app/Contents/SharedFrameworks/DVTInstrumentsFoundation.framework/Resources/liboainject.dylib in target; target process <pid> likely exited I get the same error when I try running Instruments with xctrace. How do I get Instruments to properly load my programs? Setup: Xcode version: 13.4.1 (13F100) Hardware: 2020 M1 MacBook Air
Posted
by
Post not yet marked as solved
0 Replies
73 Views
Hi! So, I made a game a while ago on my old apple ID, and I submitted it to Testflight and everything, and I was updating it for a while, and then I stopped. I still have the Xcode project for the app on my mac, but the thing is, I now have a new Apple Id, and I want to submit the same app again, and continue updating it, but on my new Apple ID and not my old one. When I try to submit the app to Testflight, it tells me that there is already an app with that name and that I cannot submit it. I still have access to my other developer account on my old Apple ID, but it will expire in about a month. Is there a way I can transfer ownership of the app to my new Apple ID? Or maybe just delete it from testflight on my old account so I can resubmit it on my new account? If anyone knows how that would be awesome, thanks!
Posted
by
Post not yet marked as solved
0 Replies
48 Views
I am working on a test app utilizing UISplitViewController. I search for ContainerView and drag it onto the Detail View. Then I search for an ImageView and drag it onto the Detail View. The ContainerView disappears and is replaced by the ImageView. I've deleted and recreated several times, and have also rebooted and it doesn't change how it works. Have you experienced this or is there a fix? I am using Xcode 13.4, and Monterey 12.4.
Posted
by
Post not yet marked as solved
1 Replies
99 Views
hello to everyone im new on this fantastic world im creating my firs game and of course i start with gamesalad im do everything perfrct(i mean) when i generate the ipa everything is fine transporter to apple connect is a problem MacOs Monteray 12.4 xcode Version 13.4.1 my error is this...anyone or something help me please Asset validation failed (90725) SDK Version Issue. This app was built with the iOS 14.5 SDK. All iOS apps submitted to the App Store must be built with the iOS 15 SDK or later, included in Xcode 13 or later. (ID: b17f0e2f-0971-4e54-ab30-7a5feed7e88e)
Posted
by