Search results for

“DTiPhoneSimulatorErrorDomain Code 2”

164,070 results found

Post

Replies

Boosts

Views

Activity

How to configure 2 buttons to play 2 different sounds at the same time
This code has 4 buttons; 2 buttons play different sounds and 2 buttons stop the sound. Only one button can play its sound at a time. Once another button is pressed the sound from the button that was pressed is stopped for the new button to play its song. How make my code play 2 buttons at the same time? Code is below thanks?mport UIKitimport AVFoundationclass ViewController: UIViewController {var audioPlayer = AVAudioPlayer()override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() }@IBAction func hatingschool(sender: AnyObject) { let alertSound = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource(s, ofType: mp3)!) do { / try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback) } catch _ { } do { try AVAudioSession.sharedInstance().setActive(true) } catch _ { } / do { audioPlayer = try AVAudioPlayer(contentsOfURL: alertSound) audioPlayer.numberOfLoops = -1
1
0
394
Aug ’16
Some questions about Rosetta 2
Yesterday, WWDC announced the exciting news of MAC on arm. In order to complete the transition from x86 architecture to arm architecture, apple developed Universal 2 and Rosetta 2. Universal 2 is a binary code that can run on both x86 and arm architectures. Rosetta 2 can translate the original application based on x86 architecture into application based on ARM architecture during installation, or even translate the running code, and publicize that no matter how complex the professional application and its plug-in, it can handle it. At present, the software installed with brew is based on x86 architecture. If I use the command “brew cask install” on a DTK (developer transition kit, based on ARM Architecture) to install the software, can the software run normally on DTK? Will Rosetta 2 automatically translate this software? Or wait for the software author to recompile based on ARM architecture?
0
0
995
Jun ’20
Maintain 2 Versions for same APP
Hello all, I have two versions of the same app (SwiftUI) , one of which is free (ad-supported) and the other is not. My two current XCode projects has identical code, but the free one has AdMob code inside. The code in my current two projects in XCode is same, however the free one includes AdMob. I don't like this method because I have to copy and paste changes I make to one into the other. Is it possible to generate a version for the Apple Store with only one project and omit some code? Or I'll have to proceed as I am currently, using the same code for two projects. Thanks a lot!
0
0
268
May ’23
poll(2) slower than select(2)
I have a program that creates a TCP server socket and listens on it. When the program accepts a connection from a client, it calls poll(2) repeatedly to see if there is any input available, like this: for (int i = 0; i < 1000000; i++) { struct pollfd fds[] = {{ .fd = clientfd, .events = POLLIN, .revents = 0 }}; int r = poll(fds, 1, 0); if (r < 0) { perror(poll); exit(1); } } On my Intel iMac, this takes about 15 seconds. If I use select(2) instead, as follows, it takes about 550ms. for (int i = 0; i < 1000000; i++) { struct timeval timeout = { .tv_sec = 0, .tv_usec = 0 }; fd_set infds; FD_ZERO(&infds); FD_SET(clientfd, &infds); int r = select(1, &infds, 0, 0, &timeout); if (r < 0) { perror(select); exit(1); } } https://gist.github.com/xrme/cd42d3d753ac00861e439e012366f2cf is a C source file that contains a complete example. If you're inclined to take a look, please download the file from the gist and do cc poll-test.c and then ./a.out. Connect to it with nc 127.0.
2
0
344
Sep ’24
Xcode 10 beta 2 not working on two items
Hi All,I have been experiencing the following issue on XCode 10.0 beta 1) VoIP Push Registration is not working, same code working on XCode 9.3, but does not work Xcode 10.0 beta, it will not trigger VoiP token.2) Notification Extension not working properly, With Customized Notifiction UI, it can launch extension notification UI, but all the action does not work, press action button does not call delegate.Is there anyone has the same issue?Thanks,
0
0
1.9k
Jun ’18
Is StoreKit 2 for Swift only?
My app is a hybrid of ObjC and Swift as I have been converting it from ObjC to Swift a bit at a time. I need to integrate In-App Purchases now and I'd like to use StoreKit 2. However, when I have one of my Swift classes return a Product object, my ObjC classes don't seem to have access to the Product type and referring to it as an SKProduct type doesn't work either. Is it possible to interact with the Store Kit 2 APIs from ObjC code? Or am I going to need to isolate all of the StoreKit2 stuff in my Swift code and communicate differently when it's time to communicate with my old ObjC code? Thanks, Kenny
1
0
2.2k
Nov ’22
How to debug watchOS 2 complication
I'm experimenting with creating a watchOS 2 complication. Although I have some simple working code, I can't seem to debug the code of the ComplicationController class. When I set a breakpoint it never hit while if I set a breakpoint in the ExtensionDelegate it does get hit when I launch the app.Any help is appreciated.
2
0
1.3k
Jun ’15
XCode Help 2
Whenever I create a segue between two view controllers, the second view controller gets gray frame around it that ruins my layout. I trying to get rid of it, but I don't know how. Please someone help me? It only happen in IB, and it's when a I make a segue through IB not code. I have a picture, but there is no image attachment or can't find it.
3
0
489
Aug ’20
How to configure 2 buttons to play 2 different sounds at the same time
This code has 4 buttons; 2 buttons play different sounds and 2 buttons stop the sound. Only one button can play its sound at a time. Once another button is pressed the sound from the button that was pressed is stopped for the new button to play its song. How make my code play 2 buttons at the same time? Code is below thanks?mport UIKitimport AVFoundationclass ViewController: UIViewController {var audioPlayer = AVAudioPlayer()override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() }@IBAction func hatingschool(sender: AnyObject) { let alertSound = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource(s, ofType: mp3)!) do { / try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback) } catch _ { } do { try AVAudioSession.sharedInstance().setActive(true) } catch _ { } / do { audioPlayer = try AVAudioPlayer(contentsOfURL: alertSound) audioPlayer.numberOfLoops = -1
Replies
1
Boosts
0
Views
394
Activity
Aug ’16
Some questions about Rosetta 2
Yesterday, WWDC announced the exciting news of MAC on arm. In order to complete the transition from x86 architecture to arm architecture, apple developed Universal 2 and Rosetta 2. Universal 2 is a binary code that can run on both x86 and arm architectures. Rosetta 2 can translate the original application based on x86 architecture into application based on ARM architecture during installation, or even translate the running code, and publicize that no matter how complex the professional application and its plug-in, it can handle it. At present, the software installed with brew is based on x86 architecture. If I use the command “brew cask install” on a DTK (developer transition kit, based on ARM Architecture) to install the software, can the software run normally on DTK? Will Rosetta 2 automatically translate this software? Or wait for the software author to recompile based on ARM architecture?
Replies
0
Boosts
0
Views
995
Activity
Jun ’20
Maintain 2 Versions for same APP
Hello all, I have two versions of the same app (SwiftUI) , one of which is free (ad-supported) and the other is not. My two current XCode projects has identical code, but the free one has AdMob code inside. The code in my current two projects in XCode is same, however the free one includes AdMob. I don't like this method because I have to copy and paste changes I make to one into the other. Is it possible to generate a version for the Apple Store with only one project and omit some code? Or I'll have to proceed as I am currently, using the same code for two projects. Thanks a lot!
Replies
0
Boosts
0
Views
268
Activity
May ’23
watchOS 2 and Sprite Kit
Does watchOS 2 support SprireKit? If not, what are the best ways to do games on Apple Watch? Any sample code links will also help.Thank you!
Replies
1
Boosts
0
Views
888
Activity
Jun ’15
How to join two projects together
I wanna join two projects together as one project. Please help me on how to link it together and all. Developing with Swift Code.
Replies
1
Boosts
0
Views
274
Activity
Jan ’17
2 LightNodes
My problem is that I have 2 LightNodes and both of them cast a shadow. But the Light effect doesn't work if one is in the Shadow of the other. How can I fix that issue?
Replies
3
Boosts
0
Views
928
Activity
Mar ’18
How to fix this warning in swift 2 ?
Hi, after i installed swift 2 a waring appeared : Variable 'self' was written to, but never readin my code : [weak self] url in
Replies
1
Boosts
0
Views
2.7k
Activity
Oct ’15
Installed Watch OS 2 beta 2!
So it appears it worked now.When it was first released, I managed to download a configuration file that was dated June 23 and not June 7 like the ones after they pulled it.I just ran everything and my watch is now updating to Beta 2.
Replies
4
Boosts
0
Views
651
Activity
Jun ’15
WatchOS 2 Developer Preview 2 now available OTA
WatchOS 2 Developer Preview 2 now available OTA
Replies
5
Boosts
0
Views
1.2k
Activity
Jun ’15
poll(2) slower than select(2)
I have a program that creates a TCP server socket and listens on it. When the program accepts a connection from a client, it calls poll(2) repeatedly to see if there is any input available, like this: for (int i = 0; i < 1000000; i++) { struct pollfd fds[] = {{ .fd = clientfd, .events = POLLIN, .revents = 0 }}; int r = poll(fds, 1, 0); if (r < 0) { perror(poll); exit(1); } } On my Intel iMac, this takes about 15 seconds. If I use select(2) instead, as follows, it takes about 550ms. for (int i = 0; i < 1000000; i++) { struct timeval timeout = { .tv_sec = 0, .tv_usec = 0 }; fd_set infds; FD_ZERO(&infds); FD_SET(clientfd, &infds); int r = select(1, &infds, 0, 0, &timeout); if (r < 0) { perror(select); exit(1); } } https://gist.github.com/xrme/cd42d3d753ac00861e439e012366f2cf is a C source file that contains a complete example. If you're inclined to take a look, please download the file from the gist and do cc poll-test.c and then ./a.out. Connect to it with nc 127.0.
Replies
2
Boosts
0
Views
344
Activity
Sep ’24
Xcode 10 beta 2 not working on two items
Hi All,I have been experiencing the following issue on XCode 10.0 beta 1) VoIP Push Registration is not working, same code working on XCode 9.3, but does not work Xcode 10.0 beta, it will not trigger VoiP token.2) Notification Extension not working properly, With Customized Notifiction UI, it can launch extension notification UI, but all the action does not work, press action button does not call delegate.Is there anyone has the same issue?Thanks,
Replies
0
Boosts
0
Views
1.9k
Activity
Jun ’18
Is StoreKit 2 for Swift only?
My app is a hybrid of ObjC and Swift as I have been converting it from ObjC to Swift a bit at a time. I need to integrate In-App Purchases now and I'd like to use StoreKit 2. However, when I have one of my Swift classes return a Product object, my ObjC classes don't seem to have access to the Product type and referring to it as an SKProduct type doesn't work either. Is it possible to interact with the Store Kit 2 APIs from ObjC code? Or am I going to need to isolate all of the StoreKit2 stuff in my Swift code and communicate differently when it's time to communicate with my old ObjC code? Thanks, Kenny
Replies
1
Boosts
0
Views
2.2k
Activity
Nov ’22
How to debug watchOS 2 complication
I'm experimenting with creating a watchOS 2 complication. Although I have some simple working code, I can't seem to debug the code of the ComplicationController class. When I set a breakpoint it never hit while if I set a breakpoint in the ExtensionDelegate it does get hit when I launch the app.Any help is appreciated.
Replies
2
Boosts
0
Views
1.3k
Activity
Jun ’15
XCode Help 2
Whenever I create a segue between two view controllers, the second view controller gets gray frame around it that ruins my layout. I trying to get rid of it, but I don't know how. Please someone help me? It only happen in IB, and it's when a I make a segue through IB not code. I have a picture, but there is no image attachment or can't find it.
Replies
3
Boosts
0
Views
489
Activity
Aug ’20
Reply to AppDelegate Error
Where does the error happens exactly ?What do you mean by / 2 in the code for the AppDelegate.swift / 2 ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’16