xcode6

Swift: How can I open a new window clicking a button?

こ雲淡風輕ζ 提交于 2019-12-30 07:02:15
问题 I'm new with this programming language and I'd like to create an application that opens a window with some information when I click a button but I don't know how to do that. I'm not working with storyboards because I read that for professional programming these doesn't work. I don't want for iOS, I'd like it to be for OS X. Regards to all! 回答1: Thats pretty simple. You can do as follow: import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var

Error when using Generic as property type in Swift

混江龙づ霸主 提交于 2019-12-30 06:44:21
问题 I'm having an issue when using a Generic as the type constraint on a property. Here is a very simple example: import UIKit class TSSignal<MessageType> { var message: MessageType? init() { } } In Xcode 6 Beta (6A215l) this will not compile. It fails with the following error at the bottom: TSSignal.swift:13:9: error: unimplemented IR generation feature non-fixed class layout var message: MessageType? ^ LLVM ERROR: unimplemented IRGen feature! non-fixed class layout Command /Applications/Xcode6

Xcode 6 - Unknown type name 'NSString' / Expected identifier or '('

笑着哭i 提交于 2019-12-30 06:10:30
问题 When I am running my project in Xcode 6, I am having many weird errors. Parse Issue - Unknown type name 'NSString' Format argument not an NSString Could not build module Foundation Could not build module QuartzCore All of these errors occur in Apple's header files such as: CAMediaTiming.h, NSObjCRuntime.h,NSZone.h,NSObject.h, CALayer.h, etc. Unfortunately, the answers in here: ios - Parse Issues in NSObjCRuntime, NSZone, and NSObject did not work for me. How do you recommend I fix these

Example for iPhone portrait landscape adaptive UI which is backwards-compatible with iOS 7

心已入冬 提交于 2019-12-30 05:00:05
问题 I have read this thread How can Xcode 6 adaptive UIs be backwards-compatible with iOS 7 and iOS 6? and especially the answers from Dave and Joey. Still I am having a hard time getting a simple example to work: xcode 6, size classes enabled, iPhone iOS 7, uibutton width 100 on portrait mode, width 400 on landscape mode. And say width 600 on iPad. I just can't get this to work. I tried different combinations of setting width constraint, but either the button width is 100 in both orientation

swift code crash ,log : dyld: Library not loaded: @rpath/libswiftCore.dylib

巧了我就是萌 提交于 2019-12-30 04:42:04
问题 I debug a simple swift app , it can normally running in the simulator, but on a real machine running on the crash immediately . system version , ios 8 xcode version , 6.0.1 crash log dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /private/var/mobile/Containers/Bundle/Application/002E2F03-EE10-433B-B95F-AE3760E777DA/sMdp.app/sMdp Reason: no suitable image found. Did find: /private/var/mobile/Containers/Bundle/Application/002E2F03-EE10-433B-B95F-AE3760E777DA/sMdp.app

The runtime for selected device is not installed error

送分小仙女□ 提交于 2019-12-30 04:02:27
问题 I am trying to run application using xcode 6 on ios8 simulator but I am getting error "The runtime for selected device is not installed ". I have set the command line tool in preferences but no luck. Please help. 回答1: This just happened to me right after a beta update to Yosemite 10.10 and Xcode 6.6. I still have XCode 5 installed, and I thought it may have been from deleting XCode 6.5, but putting it back in Applications did not help. First, make sure you have all devices installed in your

Swift - Error: unexpectedly found nil while unwrapping an optional value

蹲街弑〆低调 提交于 2019-12-30 03:42:06
问题 I have been making an app in Swift but I keep getting an error in my TableViewController class. I could not find any way to fix this and kept getting this error : override func tableView(tableView: UITableView?, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { let cell : TextTableViewCell = tableView!.dequeueReusableCellWithIdentifier("Cell", forIndexPath : indexPath!) as TextTableViewCell let madan : PFObject = self.timeLineData.objectAtIndex(indexPath!.row) as PFObject

UIView background color in Swift

℡╲_俬逩灬. 提交于 2019-12-29 19:05:19
问题 Is there a way to set the UIView background color with Swift? I know that in Objective-C, you would use self.view.backgroundColor = [UIColor redColor]; , but that does not work the same way in Swift. I have looked around and because Swift is only about a week old, I cannot find an answer. Does anyone have any suggestions? 回答1: self.view.backgroundColor = UIColor.redColor() In Swift 3: self.view.backgroundColor = UIColor.red 回答2: Try This, It worked like a charm! for me, The simplest way to

UIView background color in Swift

时光怂恿深爱的人放手 提交于 2019-12-29 19:05:13
问题 Is there a way to set the UIView background color with Swift? I know that in Objective-C, you would use self.view.backgroundColor = [UIColor redColor]; , but that does not work the same way in Swift. I have looked around and because Swift is only about a week old, I cannot find an answer. Does anyone have any suggestions? 回答1: self.view.backgroundColor = UIColor.redColor() In Swift 3: self.view.backgroundColor = UIColor.red 回答2: Try This, It worked like a charm! for me, The simplest way to

Code Sign Error - Command /usr/bin/codesign failed with exit code 1

跟風遠走 提交于 2019-12-29 08:19:17
问题 So I've spent the last week trying to solve the following error to no avail (even following the steps in my own answer to my own question from a little while ago I've so far tried all manner of 'voodoo' solutions listed Here, here, here, here, and here all to no avail. Please, if anyone can help me solve this issue, i would be eternally grateful. I am trying to archive my app so i can submit it to the app store, but its falling down at the code signing. CodeSign /Users/informationservices