xcode6

Adding View controllers as subview in Swift

Deadly 提交于 2020-01-04 19:49:50
问题 Am trying to build a simple calculator app using swift. I have created two view controller with the basic and advanced options. Earlier in Obj-C used to do this [[AViewController alloc] initWithNibName:@"nibName" bundle:nil] In swift I cannot even import my new view controllers. But still I can declare as var aViewController:AViewController? and use it. But I am stuck at loading nib I tried with AViewController(nibName: "nibname", bundle: nil) , but everything results in compiler error Could

Adding View controllers as subview in Swift

你。 提交于 2020-01-04 19:49:40
问题 Am trying to build a simple calculator app using swift. I have created two view controller with the basic and advanced options. Earlier in Obj-C used to do this [[AViewController alloc] initWithNibName:@"nibName" bundle:nil] In swift I cannot even import my new view controllers. But still I can declare as var aViewController:AViewController? and use it. But I am stuck at loading nib I tried with AViewController(nibName: "nibname", bundle: nil) , but everything results in compiler error Could

AutoLayout Xcode6: Need autolayout constraints for this:

混江龙づ霸主 提交于 2020-01-04 04:40:07
问题 I am new in autolayout (I am good in autoresizing). My requirement is:- I have 2 view (say blue and green, width and height of both view is 300 pixel in iPhone5). height and width of both view can change according to screen resolution. X and Y origin can also change. What constraints should I use for this autoresizing masks. 回答1: It is unclear if the blue and green are siblings or if one contains the other. If the effect you want to achieve can be produced through an autoresizing mask, then

Swift, Equatable protocol bug?

岁酱吖の 提交于 2020-01-04 04:39:06
问题 I am building a very simple structure in Swift that contains an array of optional values. This struct must conform to the Equatable protocol. This is the code: struct MyTable: Equatable { var values: [Int?] = Array(count: 64, repeatedValue: nil) } func == (lhs: MyTable, rhs: MyTable) -> Bool { return lhs.values == rhs.values } Quite simple. I see no mistakes, but the compiler gives error: "'[Int?]' is not convertible to 'MyTable'". Am I doing something stupid? or is this a compiler's bug?

Images not displaying on iPad AIR, but display on other iPads

我们两清 提交于 2020-01-04 04:05:27
问题 My images are not displaying on iPad AIRs, but are displaying on other iPads. They are not displaying in Image views or on buttons. Besides my images, the Segmented Control image is also not displaying, although I can still tap on the buttons and segmented control where I know they exist on the UI. I found that background images on my buttons do display, but an image on my buttons do not. Maybe this will help - I think this started after I got the message about required 64 bit support as of 2

No items in Object Library Xcode 6

醉酒当歌 提交于 2020-01-04 02:53:28
问题 I keep having problems with XCode6 , I also tried to uninstall it and reinstall it. Whenever I try to open it it keeps saying "No matches" and I cannot use any object. I'm trying to start an iOS project! 回答1: I found that they appear if you open the xib file in the centre pane of the main window. If the xib is open in a separate floating window nothing appears and you get 'No matches' 来源: https://stackoverflow.com/questions/26354956/no-items-in-object-library-xcode-6

Xcode 6 autocomplete failure (<<error type>>)

六月ゝ 毕业季﹏ 提交于 2020-01-03 19:04:13
问题 I am developing an app with Swift and I started to experience a strange Xcode behaviour at some point. I do not exactly remember how it happened, but the autocomplete is refusing to work and for all of my variables the type is << error type >> . I tried some of the solutions available here, but all of them did not work. What could be the issue for this frustrating behaviour, please share your thoughts if you have already experienced this problem and solved it. I already deleted the derived

In Xcode 6 beta 4 (iOS 8), why does Core Data not persist UIImage fields to the backend like it did in iOS 7 when I declare it Transformable?

﹥>﹥吖頭↗ 提交于 2020-01-03 18:42:27
问题 In my iOS project's data model, I have an entity called Foo that has a field image . I've always stored this field by using the Transformable setting such that iOS would automatically use NSCoding to store image. However, I found that when I try to retrieve it, the UIImage * that comes out is corrupt. It has CGSizeZero size most of the time and does not contain valid data. Has anyone also experienced this under Xcode 6 beta 4? NB: I'm using MagicalRecord to set up the Core Data stack. I have

SpriteKit & Swift: Creating nodes via didBeginContact messes up the positioning

萝らか妹 提交于 2020-01-03 17:10:30
问题 I don't know if this is a weird bug in Xcode or there's something about the SpriteKit's coordinate system I don't understand. The premise is that the position of a node is always relative to its parent. However, whenever I call a block that creates and positions a node with a physics body from "didBeginContact" of SKPhysicsContactDelegate, the node is always positioned relative to the scene (instead of its parent). Note that calling this same block works as intended when triggered anywhere

SpriteKit & Swift: Creating nodes via didBeginContact messes up the positioning

╄→尐↘猪︶ㄣ 提交于 2020-01-03 17:10:09
问题 I don't know if this is a weird bug in Xcode or there's something about the SpriteKit's coordinate system I don't understand. The premise is that the position of a node is always relative to its parent. However, whenever I call a block that creates and positions a node with a physics body from "didBeginContact" of SKPhysicsContactDelegate, the node is always positioned relative to the scene (instead of its parent). Note that calling this same block works as intended when triggered anywhere