xcode6

How can I programmatically find Swift's version?

本秂侑毒 提交于 2019-12-28 02:49:09
问题 I know I can find the version of Swift I'm running right now reverting to a Terminal and typing: xcrun swift --version Swift version 1.1 (swift-600.0.57.4) Target: x86_64-apple-darwin13.4.0 Also, I've been reading about the Preprocessor Macros in Swift, but no luck finding a Swift version constant. As Swift 1.2 approaches it will be nice to flag old code that only runs on Swift 1.1 (Xcode up to 6.2) or new code that needs Xcode 6.3 (Swift 1.2) Note: I can also use system() to do something

why do i get “Must translate autoresizing mask into constraints to have _setHostsLayoutEngine:YES” in xcode 6 beta

眉间皱痕 提交于 2019-12-28 02:49:09
问题 I have the following code in a swift UITableViewController, but i get a "Must translate autoresizing mask into constraints to have _setHostsLayoutEngine:YES exception at the 2nd line. I didnt change any settings in the interface builder (so Autolayout and size classes are both checked). override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell? { let cell:TodoItemCell = tableView.dequeueReusableCellWithIdentifier("TodoItemCell",

Unable to boot the iOS Simulator

别来无恙 提交于 2019-12-25 18:35:16
问题 I have just installed xCode 6 from the AppStore and every time I open the iOS simulator it shows me this error: Unable to boot the iOS Simulator What can cause this problem and how do I fix it? (I am using a mid 2011 iMac with OS X Yosemite) 回答1: You likely have DYLD_INSERT_LIBRARIES set. Open up Terminal.app and run 'echo $DYLD_INSERT_LIBRARIES' If it is set to something, I suggest you unset it (or uninstall whatever set it) when needing to use the iOS Simulator on Mavericks. I suggest you

Generating a vector with int and string arguments

让人想犯罪 __ 提交于 2019-12-25 18:29:36
问题 I would like to use the boost library (boost::variant) in C++ to define a vector if integers and strings. I am struggling to fill a such a vector - can someone either post an example code with fills a vector with ints and strings using the Boost library and reads elements of the vector or otherwise direct me to an example. I searched for articles with the tage boost::variants on the SO, but could not find what I wanted. 回答1: Here are some examples (written from memory): typedef boost::variant

Generating a vector with int and string arguments

无人久伴 提交于 2019-12-25 18:29:09
问题 I would like to use the boost library (boost::variant) in C++ to define a vector if integers and strings. I am struggling to fill a such a vector - can someone either post an example code with fills a vector with ints and strings using the Boost library and reads elements of the vector or otherwise direct me to an example. I searched for articles with the tage boost::variants on the SO, but could not find what I wanted. 回答1: Here are some examples (written from memory): typedef boost::variant

iOS 8 Autolayout with Size Classes

 ̄綄美尐妖づ 提交于 2019-12-25 14:58:10
问题 This is driving me crazy. All I need is to align the subview to superview & fill its bounds. To do this, all I used to do is create 4 Autolayout constraints for subview in storyboard and set top, left, bottom, right margins to 0 relative to subview. But in Xcode 6, with Size classes enabled, the left and right margins default to -16 and setting them to 0 has no effect. No matter what I do, the subview never fills superview bounds and there are few pixel gaps on the left and right. How do I

tableView is not updating until i tap another tab and get back - swift

自闭症网瘾萝莉.ら 提交于 2019-12-25 08:54:01
问题 I'm new in iOS , i'm populating tableView data dynamically from a web source by parsing JSON data . But the problem is when i visit that tab first time its showing nothing . After i visit another tab and get back , its showing the data properly on tableView . Here is my code import UIKit class BranchViewController: UITableViewController , UISearchBarDelegate, UISearchDisplayDelegate { var branches = [Branch]() var filteredBranch = [Branch]() var BranchArray = [BranchTable]() var

Error “library not found for -lPods-MyProjectTests-KIF” when installing KIF in existing workspace

时间秒杀一切 提交于 2019-12-25 08:52:47
问题 I run into this error when adding KIF to an existing Xcode 6 workspace: ld: library not found for -lPods-MyProjectTests-KIF What may be special about my situation that MyProject.xcworkspace/ resides in the parent directory of MyProject.xcproject/ (and depends on several other sibling projects as well): ./MyProject.xcworkspace/ ./MyProject/ ./MyProject/MyProject.xcworkspace/ ./MyProject/Podfile My Podfile is as follows: target 'MyProjectTests', :exclusive => true do pod 'KIF', '~> 3.0',

NSWorkspace's 'frontmostApplication' doesn't change after initial use

拜拜、爱过 提交于 2019-12-25 06:33:06
问题 I'm trying to get an update of the current active (foreground) application. Even across computer screens. I'm using this code to try to do it: print(NSWorkspace.sharedWorkspace().frontmostApplication?.localizedName) This loops in a command line application every 3 seconds, and prints to console. It works with any application open as active when it first starts up. However, it does not change from the first app afterwards. 1. Why is it doing this? 2. What is the proper code to make it work? 3.

IBOutlet nil after instantiateViewControllerWithIdentifier

旧时模样 提交于 2019-12-25 05:31:39
问题 Not sure exactly what I'm doing wrong here. I've listed out what my problem is and my code. Would love to get some help. Thanks! Problem: VC1 presents VC2. IBOutlets from VC1 are now nil. VC2 dismisses back into VC1. IBOutlets in VC1 are still nil. VC1 loads a grid of pictures from flickR. VC2 has a searchBar controller, when VC2 is dismissed it does runs flickR query. Right before my self.collectionView.reload() fails because self.collectionView is nil :( VC1 import UIKit class