Search results for

“DTiPhoneSimulatorErrorDomain Code 2”

167,662 results found

Post

Replies

Boosts

Views

Activity

Reading from a file swift 2
I'm trying to read a file which exist with the below code in Swift 2. It seems to be failing. Appreciate any inputs:let someText = NSString(string:some text)let destinationPath = /users/johnt/myFile.txtvar filemgr = NSFileManager.defaultManager()if filemgr.fileExistsAtPath(destinationPath) { print(File exists) do { let readFile = try String(contentsOfFile: destinationPath, encoding: NSUTF8StringEncoding) // Throws this error// How do I read the file contents from here? print((readFile)) } catch let error as NSError { print(Error: (error.domain)) }} else { print(File does not exist) do { try someText.writeToFile(destinationPath, atomically: true, encoding: NSUTF8StringEncoding) } catch let error as NSError { print(Error: (error.domain)) }}
4
0
14k
Aug ’15
TextKit 2 and SwiftUI
Is it possible to use/draw a SwiftUI view in TextKit 2? The NSTextLayoutManagerDelegate seems to be built around returning a NSTextLayoutFragment. Since NSTextLayoutFragment is a class, I can't subclass it and use SwiftUI. I'd love to create my views using SwiftUI, since it's a lot faster than figuring out CGPaths, pixel perfect anti-aliasing, etc. Thanks!
0
0
1.3k
Sep ’21
Error in Swift 2: Overloading a function
Hi there!I am a novice to Swift and Xcode, but know C++.I tried to mimick the code in a Stanford University course for iOS 8 App development (2014-15) using Xcode 7 and swift 2 for the calculator example.In his lecture 2 video on https://www.youtube.com/watch?v=QLJtT7eSykg,the lecturer suggested over loading a function like this (and I think they were using Xcode 6 and an earlier Swift standard):func performOperation(operation: (Double, Double) -> Double) { if operandStack.count >= 2 { displayValue = operation(operandStack.removeLast(), operandStack.removeLast()) enter() } } func performOperation(operation: Double -> Double) { //////////////////////////////// if operandStack.count >= 1 { displayValue = operation(operandStack.removeLast()) enter() } }However, the compiler seems to have problem with this overloading attempt, and the error is:/Users/.../Calculator/ViewController.swift:50:10: Method 'performOperation' with Objective-C selector 'performOperation:' co
1
0
776
Dec ’15
Reply to UIView with draw function override always at wrong place on screen
But when I comment out the draw function and only change its background color, it shows up where I want it to be. I have exactly the same wrong behavior, when I add the view in code, and IB isn't involved at all.For example: colorWheel.center = CGPoint(x: UIScreen.main.bounds.width / 2, y: UIScreen.main.bounds.height / 2)Nothing change when I have my code in the draw function, with out my code the view shows up in the center of the screen.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’17
Configurator 2 disabled Boot
After connecting my M1 to an Intel Mac where I started Configurator 2 the M1 boots in a loop, seeing the Apple Logo and the progressbar until half and then restart and same again in a endless loop. When I connected the M1 to the Intel Mac with Configurator 2 open I set the M1 in DFU mode and Configurator 2 said it need to download and install something ( 1 item ). After that it restarted and I saw the M1 in DFU mode again after Configurator 2 restarted. I didn't do any restore or revive. I closed Configurator 2 and restarted the M1. From thenon it is in a boot loop. I opened the recovery mode on the M1 and First aided the Macintosh HD drive and the DATA drive. Both successful without any errors. When I boot the M1 in option mode to see which drives available I don't see the Macintosh HD anylonger only the Options entry. How can I make the Macintosh HD be able to used as Boot drive again ?
2
0
772
Jun ’21
How to Simulate for iPad Air 2?
I'm learning to develop iOS apps. And I'd like to test it on my iPad Air 2. My Xcode is set up as follows: iOS 13.0 Xcode 12.3 Swift 5.3 My iPad is on iOS Version 14.3. I had my iPad Air 2 set up before, but its simulator disappeared when I upgraded the Xcode version. How do I set up Xcode so I can simulate/run apps on an iPad Air 2? Thank you very much in advance.
0
0
697
Jan ’21
Predictive Code Completion
In Xcode16Beta4, it contains Predictive Code Completion, and Predictive Code Completion is also with other SDKs in the page opened by Xcode for the first time. Waiting for download. However, I want to know: 1. What is Predictive Code Completion? 2. I didn't download Predictive Code Completion on the SDK download page when I first opened Xcode. Where should I download it later?
1
0
1.4k
Jul ’24
Mechanical keyboard on iPad Pro (Gen 2) 12.9 with iPadOS 13 beta 2
I've been using a WASD V3 mechanical keyboard with my iPad Pro 12.9 (Gen 2), iPad mini 5, and iPhone 8 Plus – and they've all worked perfectly until I updated to iOS 13 beta 2 (on all three devices).With iOS/iPadOS 13 beta 1, no problem on all three. But after installing beta 2 to all three, only the iPad mini 5 and iPhone 8 Plus work with the keyboard – the iPad Pro 12.9 (Gen 2) does not. I connect the mechanical to these devices with the same Apple Lightning to USB3 Camera Adapter – just switching the adapter from one to another, as needed – and have the Lightning port on the adapter connected to an Apple 30W power source.I have two of the Apple Lightning to USB3 Camera Adapters and have tried both with the same results – the mechanical keyboard will not work with the 12.9, but works on the iPad mini and the iPhone. I'm now using the Apple Wireless Keyboard with the 12.9 Pro, but would like to return to the mechanical keyboard. There's every chance that the next
0
0
590
Jul ’19
Two Dimensional Village
I have just begun programming Swift, and am a novice, so please bear with me.I would like a basic understanding of how to do the following:Create a two dimensional array where each cell represents an individualRepresent that array graphically so that every pixel represents the person in that cell and the pixel would be pink if the person is female and blue if the person is maleThank you in advance for any and all help!
2
0
314
Dec ’15
eGPU Thunderbolt 2 Support
Hi, all, I recently bought an iMac 5K(Late 2015 model) with thunderbolt 2 ports. I was wondering if the eGPU support in high sierra would work on my Mac through a thunderbolt 3 to thunderbolt 2 adapter.
Replies
0
Boosts
0
Views
694
Activity
Sep ’17
Reading from a file swift 2
I'm trying to read a file which exist with the below code in Swift 2. It seems to be failing. Appreciate any inputs:let someText = NSString(string:some text)let destinationPath = /users/johnt/myFile.txtvar filemgr = NSFileManager.defaultManager()if filemgr.fileExistsAtPath(destinationPath) { print(File exists) do { let readFile = try String(contentsOfFile: destinationPath, encoding: NSUTF8StringEncoding) // Throws this error// How do I read the file contents from here? print((readFile)) } catch let error as NSError { print(Error: (error.domain)) }} else { print(File does not exist) do { try someText.writeToFile(destinationPath, atomically: true, encoding: NSUTF8StringEncoding) } catch let error as NSError { print(Error: (error.domain)) }}
Replies
4
Boosts
0
Views
14k
Activity
Aug ’15
download related two apps
i hope how to download related two apps,we make image two apps A and B, such as.if app A only installed, app A atracts app B from the app store.did you know how to that?
Replies
2
Boosts
0
Views
440
Activity
Jun ’20
Reply to iCloud Query Subscription - Multiple Notification for single Subscription
So there is 2 Users one is AGENT and other is ADMIN......When they use app, app code subscibe, 2 notification fired by icloud to all users.Can you explain what AGENT and ADMIN are?
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Dec ’18
TextKit 2 and SwiftUI
Is it possible to use/draw a SwiftUI view in TextKit 2? The NSTextLayoutManagerDelegate seems to be built around returning a NSTextLayoutFragment. Since NSTextLayoutFragment is a class, I can't subclass it and use SwiftUI. I'd love to create my views using SwiftUI, since it's a lot faster than figuring out CGPaths, pixel perfect anti-aliasing, etc. Thanks!
Replies
0
Boosts
0
Views
1.3k
Activity
Sep ’21
Error in Swift 2: Overloading a function
Hi there!I am a novice to Swift and Xcode, but know C++.I tried to mimick the code in a Stanford University course for iOS 8 App development (2014-15) using Xcode 7 and swift 2 for the calculator example.In his lecture 2 video on https://www.youtube.com/watch?v=QLJtT7eSykg,the lecturer suggested over loading a function like this (and I think they were using Xcode 6 and an earlier Swift standard):func performOperation(operation: (Double, Double) -> Double) { if operandStack.count >= 2 { displayValue = operation(operandStack.removeLast(), operandStack.removeLast()) enter() } } func performOperation(operation: Double -> Double) { //////////////////////////////// if operandStack.count >= 1 { displayValue = operation(operandStack.removeLast()) enter() } }However, the compiler seems to have problem with this overloading attempt, and the error is:/Users/.../Calculator/ViewController.swift:50:10: Method 'performOperation' with Objective-C selector 'performOperation:' co
Replies
1
Boosts
0
Views
776
Activity
Dec ’15
Reply to UIView with draw function override always at wrong place on screen
But when I comment out the draw function and only change its background color, it shows up where I want it to be. I have exactly the same wrong behavior, when I add the view in code, and IB isn't involved at all.For example: colorWheel.center = CGPoint(x: UIScreen.main.bounds.width / 2, y: UIScreen.main.bounds.height / 2)Nothing change when I have my code in the draw function, with out my code the view shows up in the center of the screen.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’17
Configurator 2 disabled Boot
After connecting my M1 to an Intel Mac where I started Configurator 2 the M1 boots in a loop, seeing the Apple Logo and the progressbar until half and then restart and same again in a endless loop. When I connected the M1 to the Intel Mac with Configurator 2 open I set the M1 in DFU mode and Configurator 2 said it need to download and install something ( 1 item ). After that it restarted and I saw the M1 in DFU mode again after Configurator 2 restarted. I didn't do any restore or revive. I closed Configurator 2 and restarted the M1. From thenon it is in a boot loop. I opened the recovery mode on the M1 and First aided the Macintosh HD drive and the DATA drive. Both successful without any errors. When I boot the M1 in option mode to see which drives available I don't see the Macintosh HD anylonger only the Options entry. How can I make the Macintosh HD be able to used as Boot drive again ?
Replies
2
Boosts
0
Views
772
Activity
Jun ’21
Reply to Multiple WatchKit apps within one iPhone app
I don't know. But why not two apps with very similar iPhone code?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’18
How to Simulate for iPad Air 2?
I'm learning to develop iOS apps. And I'd like to test it on my iPad Air 2. My Xcode is set up as follows: iOS 13.0 Xcode 12.3 Swift 5.3 My iPad is on iOS Version 14.3. I had my iPad Air 2 set up before, but its simulator disappeared when I upgraded the Xcode version. How do I set up Xcode so I can simulate/run apps on an iPad Air 2? Thank you very much in advance.
Replies
0
Boosts
0
Views
697
Activity
Jan ’21
Reply to Xcode links a Third Party framework in my Framework and includes it's symbols
Have you tried re-naming your class in your code? That would disambiguate between the two classes.Jonathan
Topic: Programming Languages SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’17
Reply to Cannot generate Promo Code
I haven't been able to generate promo codes for two days. It's very frustrating.
Replies
Boosts
Views
Activity
May ’22
Predictive Code Completion
In Xcode16Beta4, it contains Predictive Code Completion, and Predictive Code Completion is also with other SDKs in the page opened by Xcode for the first time. Waiting for download. However, I want to know: 1. What is Predictive Code Completion? 2. I didn't download Predictive Code Completion on the SDK download page when I first opened Xcode. Where should I download it later?
Replies
1
Boosts
0
Views
1.4k
Activity
Jul ’24
Mechanical keyboard on iPad Pro (Gen 2) 12.9 with iPadOS 13 beta 2
I've been using a WASD V3 mechanical keyboard with my iPad Pro 12.9 (Gen 2), iPad mini 5, and iPhone 8 Plus – and they've all worked perfectly until I updated to iOS 13 beta 2 (on all three devices).With iOS/iPadOS 13 beta 1, no problem on all three. But after installing beta 2 to all three, only the iPad mini 5 and iPhone 8 Plus work with the keyboard – the iPad Pro 12.9 (Gen 2) does not. I connect the mechanical to these devices with the same Apple Lightning to USB3 Camera Adapter – just switching the adapter from one to another, as needed – and have the Lightning port on the adapter connected to an Apple 30W power source.I have two of the Apple Lightning to USB3 Camera Adapters and have tried both with the same results – the mechanical keyboard will not work with the 12.9, but works on the iPad mini and the iPhone. I'm now using the Apple Wireless Keyboard with the 12.9 Pro, but would like to return to the mechanical keyboard. There's every chance that the next
Replies
0
Boosts
0
Views
590
Activity
Jul ’19
Two Dimensional Village
I have just begun programming Swift, and am a novice, so please bear with me.I would like a basic understanding of how to do the following:Create a two dimensional array where each cell represents an individualRepresent that array graphically so that every pixel represents the person in that cell and the pixel would be pink if the person is female and blue if the person is maleThank you in advance for any and all help!
Replies
2
Boosts
0
Views
314
Activity
Dec ’15