Search results for

Xcode

92,302 results found

Post

Replies

Boosts

Views

Activity

Reply to How to create singleton in swift?
I should have written it clearly, but `recently` meant Swift 1.2 (comes with Xcode 6.3) and after.Till Swift 1.1, I used something like this:class UserInfo { class var sharedInfo: UserInfo { struct My { static var instance = UserInfo() } return My.instance } var userFirstName: String? var userLastName: String? }(Sorry, I removed all Xcode 6.1.x installations, and I cannot check if the above code actually works in Xcode 6.1.1 .)If you don't have some specific reasons, you'd better upgrade your Xcode.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’15
Xcode Extensions in Xcode 14?
I noticed an Xcode Extension I wrote a couple of years ago isn't showing up in the Editor menu of Xcode. So I opened up the project, ran the Extension and the grayed out version of Xcode shows up but my extension no longer appears in the Editor menu. So I just tried to create a brand new Xcode project, with an Xcode extension. Right out of the box, no code changes from the template, and I can't get the new project's Xcode extension to appear in the Editor menu. In System Preferences the app is checked off under Xcode Extensions but still nowhere to be found?
1
0
3.1k
Oct ’22
Reply to Battery drains in iOS 9
It's been my experience with betas and battery drain that a 3rd party app or a running process is usually the culprit.I would recommend wiping the phone and set it up as a new iPhone. If the battery drain still persists after that, file a bug report and capture what you can from x-code. Anything beyond that may require you to install 8.4.1 until the next beta release.Best of Luck!
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’15
Reply to Storyboards changing the frames of my views
I have this problem all the time. I'll be laying out a complex view with auto layout, I'll close the window or close X code. When I reopen it, all of the items that I've added to the view have no frames and are in the upper left of the parent view.I suspect it could be tied to using the Duplicate command, but I'm not sure. It is a huge problem for me and I can't find a solution.
Nov ’15
Code injection on Mac OS X 10.11
With System integrity protection on Mac OS X 10.11, the code injection is prevented on Apple signed processes. If the security vendor wants to reverse engineer, inject the code for legitimate purpose, what are alternatives? - Is there possibily of security vendor can work with Apple, in a way to ceritify their apps so that only they would be allowed to do certain tasks?
1
0
1.4k
Sep ’15
Reply to X Code 9.3 multiple problems
Hi QuincyThanks for the answer.Today, when I first launced x code the project came up and same problem, select storyboard and spinning wheel starts. On activity monitor nothing special was happening. I was, however, able to quit the application normally, usually it locks up when I select quit.I then tried a new playground - usual problem, just says 'launching simulator'. The difference now is that in x code 9.2 it would take about 5 minutes before it was ready, now it never came out of 'launching simulator'. Activity monitor showed xcode as using 0.0 to 0.1% cpu during this time and nothing else special happening.I then tried various tips from a 1 year old stack overflow thread, https://stackoverflow.com/questions/39978092/xcode-playground-gets-stuck-on-running-playground-or-launching-simulator-and, requiring much restarting but none of this did anything till I deleted all the lines above 'import UIKit'. Then an error appeared, saying there was no such thing as UIKit. Very
Apr ’18
Reply to Problem with Calculator example toInt()
Maybe you are watching a tutorial intended for Swift 1.2 (or older) and using Swift 2.An old code something like:someString.toInt()should be rewritten as:Int(someString)So, one line of your code:firstnumber = Screen.text!.toInt()!should be:firstnumber = Int(Screen.text!)!You will see how you can rewrite another line.But, if you continue the old outdated tutorial, you will face at many other problems. Swift 2 was such a big change, that many Swift 1.x code got outdated.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’15
How to check xcode version in code
I have a piece of code which can be build successfully in xcode 10.x version, but today the code build failed after I grade the xcode to 11.1 version, so I want to see if there's xcode version macro can be used in build phase, like this:#if XCODE_SDK_MAJ_VERSION <11 code line 1 code line 2#else code line 2#endifAny comments?
5
0
12k
Oct ’19
Reply to No Results Sidebar or Red Error Symbol
Create a new playground (menu New in Xcode) and give the name you want.you should see Hello world in the code part as well as on the right.now type below a statement, likelet x = 10print(I entered , x)you should see 10 on the right, in front of the lineand I entered 10 in the log part at bottom.Now, you’re up and running.good luck
May ’18
Reply to CODING PROBLEM
I recommend you'd give a better title for your post. Including the error message is one way, if it's not too long.And you also show what version of Xcode you are using, just adding something like Xcode 6.4 on OS X 10.10.4 would be useful in many cases.I assume this sort of lines: /may be modified by the article editor's copying feature and your original code would be something like this: // Do any additional setup after loading the view, typically from a nib.as in the code template generated by Xcode. You'd better post-edit your code after pasting it.So, if I try to get the message Expected declaration, I need to write some other codes, other than your code shown above.Are you sure your source file does not contain any other codes?
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’15
Reply to Can you use apple developer programs like swift or X code on a pc?
Swift is open source and availible at: https://swift.org/It doesn't look that there is a offical Windows download on the site but it should be possibile to get it to run, especially considering the recent support for Unix command line tools on Windows. I would recomend a bit of googling.Xcode requiers a mac running OS X. I would highly recommend a mac that can run the latest version of OS X so that you can run the latest version of Xcode. Note that some of the tools used by Xcode e.g. clang (the C/C++/Objective-C compiler) are open source and can be run on other OSes. What Xcode gives you is access to the OS X frameworks (code libariaries) to e.g. build the app GUI (Graphical User Interface). Also note that it may be eaiser to get tools like clang and swift running on Linux, rather than Windows, as Linux and OS X are more closely related - they are both Unix like OSes.
Topic: Programming Languages SubTopic: Swift Tags:
May ’16