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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

How get URL from image
How get URL from image located in asset catalogbefore use:let path = Bundle.main.path(forResource: "***", ofType: "png")or let path = Bundle.main.path(forResource: "***", ofType: "png", inDirectory: "Assets.xcassets")let urlI = URL(fileURLWithPath: path!)but this cause error URL is nilHelp me please
7
1
17k
Dec ’17
Swift playground File under Source not complete
Hello,I created a playground, in this playground, I created a class, I instantiate it, everything is fine. I create the same class in a source swift file, make my class public but ... I do not have the foundation framework methods! for example, no ... uppercased! While I have these methods in the basic playground (I also use the framework foundation). What am I doing wrong? thanks a lot for your help// Works with the Playground import Foundation import PlaygroundSupport class me { var firstName: String var lastName: String init(firstName: String, lastName: String) { self.firstName = firstName self.lastName = lastName } func mergeUpperCase() -> String { return firstName.uppercased() + " " + lastName.uppercased() } } // Don't work with the Swift File under Sources import Foundation public class Person { public var firstName: String public var lastName: String public init(firName: String, lastName: String) { self.firstName = firName self.lastName = lastName } public func merge() -> String { return firstName + " " + lastName } public func mergeUpperCase() -> String { return firstName.xxxx + " " + lastName.xxxx // xxxx = no method uppercased() } }
7
0
5.1k
Jan ’18
I can't delete app from organizers. It's coming back.
I defined an iTunes account to Xcode, and all applications on that account started to appear in organizer. I removed the account from Xcode and I deleted these path. But It's coming back.~/Library/Developer/Xcode/Products/~/Library/Developer/Xcode/Archives/I tried it with the terminal. it didn't happen again.rm -fr ~/Library/Developer/Xcode/DerivedData/Please help me.
1
0
929
Apr ’18
dyld__abort_with_payload Thread 1: signal SIGABRT
Xcode 9.3, Swift 4.1 I have written an application for IOS (using swift) with an ObjectiveC Framework (called SolarMaxIosFramework), This framework is made with reused classes from a previous project on Mac (Objective C) This new application works fine on simulator, and as soon as I want to execute on my Iphone (real), I get an error message and this app is not launched. These errors can be resumed as follows: dyld`__abort_with_payload: 0x1016162f0 <+0>: mov x16, #0x209 0x1016162f4 <+4>: svc #0x80 -> 0x1016162f8 <+8>: b.lo 0x101616310 ; <+32> Thread 1: signal SIGABRT dyld`abort_with_payload_wrapper_internal: ... 0x101615acc <+96>: bl 0x1016162f0 ; __abort_with_payload -> 0x101615ad0 <+100>: bl 0x1016164c4 ; getpid Thread 1: signal SIGABRT dyld`abort_with_payload: Thread 1: signal SIGABRT 0x101615af0 <+0>: stp x29, x30, [sp, #-0x10]! 0x101615af4 <+4>: mov x29, sp 0x101615af8 <+8>: bl 0x101615a6c ; abort_with_payload_wrapper_internal dyld`dyld::halt: Thread 1: signal SIGABRT dyld`dyld::_main: ... 0x1015ef4c8 <+7148>: bl 0x1015ec1dc ; dyld::halt(char const*) -> 0x1015ef4cc <+7152>: mov x20, x0 Thread 1: signal SIGABRT dyld`_dyld_start: 0x1015e9218 <+64>: bl 0x1015e9260 ; dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) -> 0x1015e921c <+68>: mov x16, x0 Thread 1: signal SIGABRT I have tried to record my framework in the bundle but it did not work Some post speak about declaring this framework as embeded , but I do not know how to do so Thanks for your help
2
1
18k
May ’18
How do you delete a Signing Certificate from Xcode?
I have found multiple forum postings where people have asked for how they can delete or remove a Signing Certificate. Unfortunately none of them are helpful. Some respond with non-helpful questions like "Why do you want to delete your Signing Certificate?" I'll tell you why I want to delete it. It's mine and I don't want it any more. I want it gone! Others have responded to similar questions by saying to just create a new Apple ID. I don't want to do that either. I like my world clean and orderly without junk laying around, so that answer is not acceptable either. I want clear instructions on how to delete or remove a Signing Certificate. Interestingly, the option to delete it is there but it's grayed out. Why have it there if you can't delete it? Can someone please help me with this?
4
1
23k
Jun ’18
Xcode add header search path
Using XCode9, I have created a C-command line project and added an open source framework (gstreamer) in adddition to the corefoundation framework to my project.The C-program uses the header files from gstreamer which are not found by the compiler causing an error. I cannot see where I can add the header path to my project. I have checked the Framework and Xcode lists in the Header directory all header files.The following line causes the compiler error:#include <gst/gst.h>Asking for advice.gMichael
4
0
23k
Aug ’18
Xcode does not recognize iphone
Xcode 9.4.1 on MacOS 10.13.6 does not recognize iphone (iOS 11.4.1), hence "No devices connected to 'My Mac'".Even Window -> Devices and Simulators, there are no devices.But the iphone device is recognized on USB device list.Could you suggest how I can fix this problem or what I did wrong?Also, I have noticed that the system report of MacOS says the version of the iOS on the USB is 7.0.2.But the iOS version is iOS 11.4.1. Is this normal?Thanks.
12
0
41k
Aug ’18
Xcode 10.0 diagnosticd high CPU w/iPhone XR Simulator
Hi All,I've got the new 2018 MacBook Pro 15" (15,1) running High Sierra 10.13.6 and the Xcode 10.0 (10A255) release version and am having the following recurring issue.I've got an iOS project that I'm running in the simulator. In this case I'm actually running XCTests. The total tests run for about 4 seconds.At this point, Xcode looks like it's idle, but my fans spin up to full speed and Activity Monitor shows me: diagnosticd 170% cpu diagnosticd 82% cpu notifyd 78% cpu SpringBoard 78% cpuSometimes it shows diagnosticd higher like 350% CPU, but always diagnosticd is the highest.The computer doesn't seem to be doing anything. Both Xcode and Simulator are responsive.If I close the simulator, these disappear and the fans spin back down.This happens 100% of the time with the iPhone XR simulator, but doesn't seem to happen at all with any of the others, including the XS and XS Max.Anyone else seeing this?
5
0
5.1k
Sep ’18
Can't type in input in Xcode 10.1 using C++
I'm new to Xcode and programming in general, and I'm having an issue with Xcode. After I made my code and built it successfully the first time, I can type in input in the bottom console no problem. But then I made a few tweaks and went ahead to build it again. It did successfully build but this time I can't type in anything in the bottom console. So I have to close Xcode and reopen it again everytime I want to make any tweaks and it's getting annoying. Would love to know how to fix this. Thank you in advance.
10
1
4.9k
Nov ’18
How do I downgrade the simulator in Xcode?
My app is working as expected in the simulator on iOS 12.1, but not on my iOS 11.x device, and it is just a layout issue. I'm not aware of any major changes in layout constraints from 11 to 12, so I'm perplexed... I upgraded an older device from iOS 10 to 12 and my app layout works on it, so it seems something changed between iOS 11 and 12 regarding layout, but I don't know what that is...How can I get a simulator running iOS 11.x to debug? I'll start debugging on my actual 11.x device, but I would also like to know how to get a simulator running older iOS versions? xcodebuild -showsdks says I only have 12.1 iphone/simulator 12.1 -- how do I run 11.x in the simulator, or older iOS versions in general in the simulator?
11
2
38k
Nov ’18
Need to capture user activity like call, text, and app usage without reading the content.
Reading sqlite databases in the OS library can be one option but does it require Jailbreaking?How does spyware like Cocospy work on iOS devices? Note: I'm going to capture data for R&D with user consent, visible running app and not as spyware running in the background.I'm new to iOS development and any leads, references will be much appreciated.
2
0
1.3k
Nov ’18
"a software update is required to connect to iphone" fails to install
Reformatted harddrive on my MBP and installed latest versions of XCode 10.1 and macOS Mohave 10.14.1 and started up XCode, opened my project and connected my iphone and I get a prompt to install software update ... select install and it fails with:"Installation Failed. Can't install the sofwatre becuase it is not currently available from the Sofwatre Update server."Running latest iOS on my iphone X ...What now?Can't seem to find any solutions other than issues with beta software ... is the server down today?cheers-m
2
0
1.6k
Nov ’18