xcode6

Set button type

寵の児 提交于 2019-12-07 15:34:34
问题 I am creating a button programatically and I would like to know how to set that button's UIButtonType. This is how I am creating my button: let headerPlusButon:UIButton = UIButton(frame: CGRectMake(5, tableView.frame.width - 30, 20, 20)) headerPlusButon.addTarget(self, action: "paymentAddButtonTapped", forControlEvents:.TouchUpInside) There is no "setButtonTypeFor..." method like how you would change the title's text and obviously this doesn't work: headerPlusButon.buttonType = UIButtonType

How to build iOS framework with XCode 6

匆匆过客 提交于 2019-12-07 12:49:42
问题 I know of familiar tutorials on this, but introduction of framework XCode 6 template has changed the game. I already watched WWDC 2014 video about building modern frameworks but it talks more about building extensions, framework & app all inside single project. It does not specify if the framework I make with it is truly reusable across any project. I am building framework the XCode 6 way (File->New Project->Framework and Library->Cocoa Touch Framework), but when I import it inside my test

getting a warning setting up delegate for a custom protocol

蓝咒 提交于 2019-12-07 12:41:33
问题 i added a custom protocol to one of my classes and i am getting a compiler warning when i attempt to set the delegate during a prepareForSegue: method. the warning i get is... Sending 'MyCustomViewControllerClass *const __strong' to parameter of incompatible type 'id<NSFileManagerDelegate>' the project builds and runs and everything works fine minus the warning. if i add <NSFileManagerDelegate> to my custom class the warning goes away. am i missing something or is this a bug in Xcode (6 beta)

Strange “Crash” with Font added to Info.plist

二次信任 提交于 2019-12-07 12:33:39
问题 I've added a custom font TTF file to an app I'm making. I've also added the UIAppFonts key to the plist, as required. Now, when I launch the app, it hits the "app is crashing in AppDelegate" breakpoint we all know so well. I can't figure out a way to inspect the exception, but what's stranger is that if I play it through, the app continues just fine -- even allows me to debug. On top of that, the font in question is actually loaded, so there doesn't seem to be any issue there either. Not sure

Removing provisional profile with ios 8 and Xcode 6.0.1

假如想象 提交于 2019-12-07 12:17:55
问题 I cannot seem to remove the provisional profiles on my device using iOS 8 General settings since the profile selection is gone. Xcode 6.0.1 also does not allow for removing provisional profiles. Anyone know how to remove provisional profiles on a device running iOS 8 and Xcode 6.0.1? 回答1: It´s a little bit hidden in Xcode 6: Open Xcode and go to Window --> Devices via the menu bar On the left pane right click on your device Choose option "Show Provisioning Profiles ..." Delete the installed

Could not inspect the application package

左心房为你撑大大i 提交于 2019-12-07 11:44:52
问题 I have final version of XCode 6 (version 6.0.1). In my project, I have problem when running it. I got "App installation failed - Could not inspect the application package." If I run project again, it runs ok. Another run, problem again... etc. So every second run ends in this error, right after that application run just fine. I have no problem in XCode 5. 回答1: If you have moved or copied a folder named resources or resource into your project, try renaming it. Then perform a clean . 回答2: I had

iOS 8 Code working on iPhone 5s but not iPhone 5

穿精又带淫゛_ 提交于 2019-12-07 11:26:22
问题 After testing my spritekit game on the iPhone 5s simulator all the time I finally tried to run it on the iPhone 5 simulator. Unfortunately I get an error as soon as I do the first touch that I don't understand. My touchesBegan function calls my addCoin function (see below) The error is somewhere in this code-block. If I comment out this part of the code everything else works fine: func addCoin() { var coin:SKSpriteNode = SKSpriteNode(texture: coinFrames[0]) coin.size.width = 50 coin.size

Xcode 6 iOS 8 UIImage imageNamed from bundle issue

橙三吉。 提交于 2019-12-07 11:17:23
问题 I build my project using iOS 7.1 and try to load UIImage view with image that is stored in the /images/cars/car_1.png All images are located in the folder images as on picture below in project tree: So it works perfect for iOS 7.1 and Xcode 5, but when I try to use Xcode 6 and iOS 8 the UIImage instance is equal nil when I try crate image. UIImage *image = [UIImage imageNamed:@"/images/cars/car_1.png"]; po image nil (for iOS 8) it can be also UIImage *image = [UIImage imageNamed:@"/images

Where did the Homekit Accessory Simulator go in Xcode 6 beta 6?

折月煮酒 提交于 2019-12-07 10:56:53
问题 In Xcode 6 Beta 5 and previous betas, I could open a HomeKit Accessory Simulator by right-clicking on the icon in the dock and choosing Open Developer Tool > HomeKit Accessory Simulator. In Xcode 6 beta 6, this seems to be no longer the case: How can I launch the accessory simulator now? 回答1: if you read release notes HomeKit Accessory Simulator • HomeKit Accessory Simulator is now included in a separate product called Hardware IO Tools for Xcode, available on developer.apple.com/downloads.

How to close window OSX?

流过昼夜 提交于 2019-12-07 10:26:42
问题 I wanted to create an application that mainly only involves the status bar. So far I have created the status bar item using NSMenu and NSStatusBar and I have also removed the dock icon with this bit of code on load: [NSApp setActivationPolicy: NSApplicationActivationPolicyAccessory]; But what I still have is the NSWindow appearing when opening the app. How can I prevent this? I also would like to be able to re-open it. I have come up with a horrible way to close it: [_mainView setFrame