xcode6

fatal error: unexpectedly found nil while unwrapping an Optional value - Stanford Calculator

二次信任 提交于 2019-12-10 10:13:58
问题 I'm watching the Stanford Swift lecturers on ItunesU and have some trouble in understanding. The lecturer is typecasting a String to a Double at one point. He did it as follows: return NSNumberFormatter().numberFromString(display.text!)!.doubleValue display.text is a UILabel Anyhow, when I'm doing it like this my app crashes and I get the following error: fatal error: unexpectedly found nil while unwrapping an Optional value When I typecast the String like this: (display.text! as NSString)

Fade Animation for UIImages in Swift

北慕城南 提交于 2019-12-10 10:05:21
问题 I have a set of images that i would like to have fade in the background of my login screen. I cant find anything in swift that can do this. Is there a way that i would be able to? Heres my current code: override func viewDidLoad() { super.viewDidLoad() startAnimating() // Do any additional setup after loading the view, typically from a nib. } func startAnimating(){ backgroundImage.animationImages = [ UIImage(named: "background1.jpg"), UIImage(named: "background2.jpg") ] backgroundImage

Today View Extension (Widget) not working

末鹿安然 提交于 2019-12-10 09:32:47
问题 I found several other threads with similar problems, but no one has exactly the same problems. Besides it DID work some time! the errors now keep occurring while it was working some time before.. When Running my app, that has a build Target "Today View Extension", I get no actual result. The Extension is shown in Notification Center, but has no body (Simulator AND device). Also when I try to run the App (not the target extension) and attach the process manually by PID I get this error: I also

UIScrollView scrolls on all the simulators but not on my iPhone

流过昼夜 提交于 2019-12-10 09:16:01
问题 So after figuring out how scrollView works, I've implemented it with the following code: self.scrollView.delegate = self; self.scrollView.userInteractionEnabled = YES; CGRect view = CGRectMake(0, 0, 320, 750); self.scrollView.contentSize = view.size; The above code works as intended on ALL simulators in Xcode 6. However, when I run it my phone (iphone4s on ios7), the scroll does not function at all. Are people experiencing the same problems since the new release? Or am I missing something I

Documentation about compiler options for Swift

你离开我真会死。 提交于 2019-12-10 04:37:05
问题 Hello, i want to start running some microbenchmarks on Apples Swift-language. However i feel it is hard to find proper documentation for the different options in regards of compiler optimization. I have read a lot of questions and articles about other peoples microbenchmarks of the language, however it would be nice to have some firm documentation on the subject. In the latest beta, the ones to use seems to be: -Onone No optimizations -O Safe optimizations? -Ounchecked (Replaced -Ofast)

Function can only be called in the main thread, why?

隐身守侯 提交于 2019-12-10 03:36:50
问题 In this code below I am calling the function displayMyAlertMessage() twice. the first I am calling works perfect, but the second one gives me an error saying that the function may only be called from the main thread. How can I do this in my situation? I am using this code: @IBAction func loginButtonTapped(sender: AnyObject) { result2Value = "" let userEmail = userEmailTextField.text let userPassword = userPasswordTextField.text if userPassword.isEmpty || userPassword.isEmpty {

Error compiling storyboard files using Xcode 6 beta 5

て烟熏妆下的殇ゞ 提交于 2019-12-10 03:32:04
问题 My app was building fine in Xcode 6 Beta 4. I updated to Beta 5 today and ran into 2 errors: The file “Storyboard_iPad-SBPartialInfo.plist” couldn’t be opened because there is no such file. Command /Applications/Xcode6-Beta5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool failed with exit code 255 What is that SBPartialInfo.plist? I could not search for it via spotlight. My Storyboard files are storyboard_iphone and storyboard_ipad 回答1: I was also

Xcode 6/iOS 8 Location Simulation doesn't work

筅森魡賤 提交于 2019-12-10 03:32:00
问题 I've just updated to Xcode 6/iOS 8 SDK and my location service simulation in simulator started not working. It was fine before I updated (I'm currently unable to test on real device). Now, when I select a location for simulation, nothing happens. Delegate's -(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations method is not called. I've restarted Xcode, cleaned the build folder, nothing changed. Why can this happen? 回答1: Since IOS 8 you need to ask for

When I close the application I got Message from debugger: Terminated due to signal 15

偶尔善良 提交于 2019-12-10 03:04:17
问题 How can I solve this problem, I don't know that did it affect to my problem in this link My previous problem about Core data ? This message will occur when I cmd+Q of the application. Message from debugger: Terminated due to signal 15 and if who know the solution of my previous problem please tell me. 回答1: Message from debugger: Terminated due to signal 15 occurs whenever the user manually terminates the application (whether simulated in iOS simulator or on a provisioned iOS device) through

Build error with Xcode 6 and (possibly) cocoapods

北城以北 提交于 2019-12-10 02:58:58
问题 I'm getting the following static analyzer error when building my iOS project that is using cocoapods with the latest Xcode 6 GM release. error: error reading 'pic' error: no analyzer checkers are associated with '-mrelocation-model' 2 errors generated. Command /Applications/Xcode6-Beta6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1 I can disable the static analyzer, but obviously I don't want to do that. Does anyone know how to fix this ( or