I am trying to access a label in a viewcontroller from a model class so that I can change the UILabel text every time there is an error, however, every time I create the viewcontroller object inside the model class this error always appear. If i delete the object declaration then everything will work just fine. Can anyone tell me how to solve this problem? Your comment will be highly appreciate! Model import Foundation import Firebase class SignUp{ let db = Firestore.firestore() var emailTextFieldCopy:UITextField! var passwordTextFieldCopy:UITextField! var fullnameTextFieldCopy:UITextField! var usernameCopy:UITextField! var errorText:String? var eError:String? let sup = SignUpVC() // here what caused the error //MARK: - SignUp func signUp(email:String, fullname:String, username:String, password:String){ Auth.auth().createUser(withEmail: email, password: password) { (authResult, error) in if let error = error { let errorText = error.localizedDescription if errorText == The email address is badly formatted.{ Di
Search results for
DTiPhoneSimulatorErrorDomain Code 2
158,486 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I encountered an error with the following message while attempting to make an in-app purchase on iOS: Error Domain=SKErrorDomain Code=2 (null) UserInfo={NSUnderlyingError=0x281ec3840 {Error Domain=ASDErrorDomain Code=907 (null) UserInfo={NSUnderlyingError=0x281ec3720 {Error Domain=AMSErrorDomain Code=6 Payment Sheet Failed UserInfo={NSLocalizedDescription=Payment Sheet Failed, AMSURL=https://p41-buy.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy?guid=00008101-001539DC0C8A001E, AMSStatusCode=200, AMSServerPayload={ cancel-purchase-batch = 1; customerMessage = Sign in with Apple ID; dialog = { cancelButtonString = Cancel; defaultButton = Buy; explanation = Enter the password for %%appleId%% to authorise this transaction.; initialCheckboxValue = 1; kind = authorization; m-allowed = 0; message = Sign in with Apple ID; okButtonAction = { buyParams = ; itemName = IAP_id_02_1500_product06; kind = Buy; }; okButtonString = Buy; paymentSheetInfo = { caseControl = true; confirmatio
Since converting a project from Swift 1.2 to Swift 2, I'm getting a crash (EXC_BAD_ACCESS) when dropping files into a drop zone. Here's the code:override func performDragOperation(sender: NSDraggingInfo) -> Bool { let pboard: NSPasteboard = sender.draggingPasteboard() if let urls = pboard.readObjectsForClasses([NSURL.self], options:nil) { let appDelegate = NSApplication.sharedApplication().delegate as! AppDelegate appDelegate.performActionForDropZone(self.identifier!, withDroppedItems: urls as! [NSURL]) } return true }It's crashing in pboard.readObjectsForClasses() when I drop 1 or more files (and/or folders) into the drop zone, which triggers this function. This was running fine in Swift 1.2 (I'd get an array of URLs sent to the app delegate), and I'm at a loss to understand why it's crashing now, other than it might be a Swift 2 runtime problem. Any thoughts or suggestions would be greatly appreciated.
I am trying to make https request in swift, with identity created from certificate and key. My code look like this To create the identity. func loadIdentity(certificate: String, privateKey: String)-> SecIdentity? { guard let certData = Data(base64Encoded: certificate, options:NSData.Base64DecodingOptions.ignoreUnknownCharacters) else { print(Unable to decode certificate PEM) return nil } guard let cert = SecCertificateCreateWithData(kCFAllocatorDefault, certData as CFData) else { return nil } let addCertQuery: [String: Any] = [kSecClass as String: kSecClassCertificate, kSecValueRef as String: cert, kSecAttrLabel as String: certificateLabel] let tag = fedvfdvdf-tag.data(using: .utf8)! _ = deleteCertificateAndKey(certLabel: certificateLabel,keyTag: tag ) let certAddStatus = SecItemAdd(addCertQuery as CFDictionary, nil) guard let pemKeyData = Data(base64Encoded: privateKey, options:NSData.Base64DecodingOptions.ignoreUnknownCharacters) else { return nil } let sizeInBits = pemKeyData.count * 8 let keyD
I am trying to use AVPlayerView Controller But when i try to play the video its crash This is my Code `import UIKit import AVKit import SwiftyJSON import Alamofire import EffyIosFramework class VideoViewController: UIViewController, AVPlayerViewControllerDelegate { var player : AVPlayer! var vc = AVPlayerViewController() var isVideoPlaying = false var instance = VideoViewController() //View Did Load override func viewDidLoad() { super.viewDidLoad() vc.delegate = self } //Play Video func playVideo(url: URL) { player = AVPlayer(url: url) vc.player = player player.automaticallyWaitsToMinimizeStalling = false vc.delegate = self vc.showsPlaybackControls = false vc.videoGravity = AVLayerVideoGravity.resizeAspectFill let playerLayer = AVPlayerLayer(player: player) playerLayer.opacity = 0 self.isVideoPlaying = true self.vc.player?.play() DispatchQueue.main.asyncAfter(wallDeadline: .now()+0.2) { self.vc.view.frame = self.view.window!.bounds self.vc.view.backgroundColor = .clear DispatchQueue.main.async { self
I Am interested in coding, and built my fist app that is an app that has a picture of Niagara Falls with corner radius of 10, But, every time I start the build, it says: Thread 1: EXC_BAD_ACCESS (code=2, address=0x16b123f20) not sure what to do now.
Some of my app users complain about their address not correct.For example someone said he live in London, but I get his address is Belfast by CLGeocoder, hundreds of kilometers away.So I want to find out what's going on.I use his coordinate to create a CLLocation object, then get it's address with the following code: CLLocation *location = [[CLLocation alloc] initWithLatitude:x longitude:y]; CLGeocoder *geocoder = [[CLGeocoder alloc] init]; [geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) { //.... }];But it's alway return an error, no matter what I use the simulator or a real iPhone:Error Domain=kCLErrorDomain Code=2 (null)And it work fine when I use a CLLocation object got from CLLocationManager.The same thing is happened with the official GeocoderDemo download fromhttps://developer.apple.com/library/prerelease/ios/samplecode/GeocoderDemo/Introduction/Intro.htmlHow can I get a address from the location I created?Or is there somethin
But when text is changed to image and i suddenly get the unwanted padding between upper and bottom HStack, Anyone know the reason.Please paste the both code and run, any help is appreciated 🙂 Thank youBoth code samples added below as Example code 1 and example code 2:: EXAMPLE CODE 1 - with only Text(Hello) in the both HStacks, NO space is added between upper Hstack and bottom HStack :::import SwiftUIstruct View2: View { var body: some View { VStack { HStack { Text(Hello) } .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) .foregroundColor(.white) .background(Color.orange) HStack { Text(Hello) } .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) .foregroundColor(.white) .background(Color.gray) } // END: VStack }// END: body} // END: View2struct View2_Previews: PreviewProvider { static var previews: some View { View2() }}:: EXAMPLE CODE 2 - with image insted af text in the bottom Hstack
Running into crash that I can't seem to root cause. Before I dive into the core crash, let me try to explain as best I can the architecture we have as I feel like an aspect or piece of it could be exacerbating the issue. Our app is a modularized, CMS driven app where each module represents a piece of content on a page. We're using MVVM, and each module consists of a struct model, a view model, and a SwiftUI view. Module's can themselves contain other modules and so on, which makes them container modules. When we get a JSON response, it represents the page (itself a container module) and all the modules that make it up, which as per above could include some container or non-container modules depending on how it is configured in the CMS. Example of a page structure could look something like this: Page (Container Module) Module 1 Module 2 Module 3 (Container Module) Module 4 Module 5 (Container Module) Module 7 Module 8 Module 9 Module 6 Module 10 The deserialization process of JSON to model-> view m
I am working on a React Native based hybrid App, and the App's IPA file is working perfectly in the IOS versions less than 14.3 but when I check/test the APP in my iPhone 12, which is having IOS 14.4 version, and I'm getting the below error: Failed to install application at private : Error Domain=MIInstallerErrorDomain Code=4 UserInfo={NSUnderlyingError=0x147f12ae0 {Error Domain=MIInstallerErrorDomain Code=4 UserInfo={NSUnderlyingError=0x147f18950 {Error Domain=NSPOSIXErrorDomain Code=2 UserInfo={SourceFileLine=377, NSLocalizedDescription=private, FunctionName=private}}, FunctionName=private, SourceFileLine=377, NSLocalizedDescription=private}}, FunctionName=private, SourceFileLine=339, NSLocalizedDescription=private} The above error occurs when I try to install the Xcode generated IPA file in my iPhone 12 (IOS 14.4). The same IPA file is working fine in iPhone SE (IOS 14.3).
I'm going through the Swift tutorial, on the Handling Error section: https://developer.apple.com/tutorials/app-dev-training/handling-errors One of the step asks you to input xcrun simctl get_app_container booted com.example.apple-samplecode.Scrumdinger data into the Terminal to get the location of the App Sandbox. When I do this, I get the following error: An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): The operation couldn’t be completed. No such file or directory No such file or directory I've tried 2 things but neither worked: Command-Shift-K in Xcode to clean the build Erase all Content and Settings in Simulator to reset it I'm using the Xcode 14.2, running on M2 Macbook Air.
I'm try to physical device always getting error on Error for Family Controls: Error Domain=FamilyControls.FamilyControlsError Code=2 (null) AuthorizationCenter.shared.requestAuthorization{result in switch result { case .success(): print(Allow to controle App ) break case .failure(let error): print(Error for Family Controls: (error)) } } My question is - how can I authorize my parents using Family Control API in order to use for example Device Activity framework and Managed Settings framework?
Topic:
Graphics & Games
SubTopic:
Metal
Tags:
Metal Performance Shaders
Family Controls
wwdc21-10123
Hi,Following the update to v1.1 of Swift Playground on iOS on Nov. 17, none of the graphics are rendering in the Learn To Code 2 module. The code window shows, but the world screen that normally shows the landscape, programable characters, gems, switches, etc. remains blank.This doesn't happen in Learn To Code 1 or 3, which seem to be unaffected.I've closed all other apps, rebooted my iPad Pro but nothing is showing.Does anyone else have this issue, or have a fix?Thanks
iOS17 NSURLSession errors when downloading Error Domain=NSPOSIXErrorDomain Code=2 No such file or directory
Hello folks, I'd like to report a bug in Swift Playground to Apple official dev team, it's in Learn to Code 2 - Seeking Seven Gems. The puzzle map can't be loaded, please check the following screenshot, My system environment: MacOS 15.3 Swift 6.0.3 (swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)) Swift Playground 4.6.2 Xcode 16.2 Hardware: MacBook Pro/M2 Pro/32G
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
Developer Tools
Swift Student Challenge
Swift