xcode6

Swift: no output for println in deinit method (not using playground)

一笑奈何 提交于 2019-12-23 23:13:00
问题 This is my test code (run in the terminal): #!/usr/bin/xcrun swift var count = 0; // for reference counting class A { init() { count++; } deinit { println("A deinit") count--; } } var a: A? = A() println(count) a = nil // no output if I comment out this statement println(count) Output: 1 A deinit 0 There is no output "A deinit" if the line mentioned above is commented out. And the output will be: 1 1 I've used swiftc to compile the code but the result is still the same. ( xcrun swiftc -o test

Xcode 6 Launch Image for iPhone 6 plus

雨燕双飞 提交于 2019-12-23 22:23:12
问题 Where should I need to put my @3x image in Launch screen section. There is no placeholder for @3x in Launch Image Section. Even if I put @3x image in my resource. Its not automatically picking it up. Can anybody tell how can we use @3x image in Xcode 6 for slash. 回答1: Look I prepeared image for you, because it is easier to understand, than words 回答2: In your xcassets file you need to check the attribute inspector of the LaunchScreen section. You should be able to check a checkbox saying "iOS8

How to import FacebookSDK in Header file of Swift iOS application

那年仲夏 提交于 2019-12-23 15:50:29
问题 I am converting my application from Objective- C to swift . In my swift application I have created a header file as explained in following tutorial , but i am getting error 'FacebookSDK/FacebookSDK.h' file not found rather than I imported facebookSDK successfully in my application . Please guid me how to import facebookSDK in swift. 回答1: Facebook supports swift natively as of SDK v4.1, so bridging headers are not required now. (by the way, they also deprecated FacebookSDK in favor of

After duplicating a target in xcode 6 and building with iOS8 sdk unable to install / open it

本小妞迷上赌 提交于 2019-12-23 15:28:40
问题 All I get when trying to build that target is : "The file “appname.app” couldn’t be opened because you don’t have permission to view it." Any idea on how to fix that? 来源: https://stackoverflow.com/questions/26219300/after-duplicating-a-target-in-xcode-6-and-building-with-ios8-sdk-unable-to-insta

Xcode 6 doesn´t find cocoapods libraries

你离开我真会死。 提交于 2019-12-23 13:20:48
问题 I am trying to build a Xcode 5 project that uses CocoaPods. The POD file is following: target "MyProjectName" do pod 'AFNetworking', '2.2.1' pod 'SVProgressHUD', '0.9' pod 'MDHTMLLabel', :head pod 'CCBottomRefreshControl' pod 'EXPhotoViewer', '~> 1.1.2' pod 'NHBalancedFlowLayout', '~> 0.2' pod 'SevenSwitch', '~> 1.3.0' pod 'REFormattedNumberField', '~> 1.1.5' end The cocoapods is installing and updating correctly. The error is: Did not find the libraries, like the one highlighted in my .pch:

Dismiss keyboard through return key with swift

北城以北 提交于 2019-12-23 13:08:23
问题 I am a beginner programmer working with Swift. I have been working on a to-do list application. I am trying to dismiss a keyboard through the return key. I have tried the 'self.view.endEditing(true)' and the 'resignFirstResponder()' methods, but neither of them are working. Here is my code: (I am using a tab-application) class SecondViewController: UIViewController, UITextFieldDelegate { @IBOutlet var text: UITextField! @IBAction func addItem(sender: AnyObject) { toDoList.append(text.text)

Cocoapods Completely Broke

a 夏天 提交于 2019-12-23 12:14:09
问题 To start: I'm using Cocoapods 0.37.2, XCode 6.3.1 compiling for iOS 8.3 My project worked just fine before I ran a basic "pod update" now it's completely refusing to compile. I'm quite positive this has nothing to do with the pods themselves. Specifically the error I'm getting is this: ld: warning: directory not found for option '-F/Users/user_name/Library/Developer/Xcode/DerivedData/AppName-bjozswzeepmhacfkeimeepxzcxgb/Build/Products/Debug-iphoneos/include' ld: library not found for -lPods

UIWindow layout issue on ios7.1 with xcode 6.0

北慕城南 提交于 2019-12-23 12:13:18
问题 I created a project on xcode 6.0 and I've been running the project on ios8 simulator however when I tried run it on iphone5s ios7.1 simulator the UIWindow frame became to 320x480... self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; self.window.rootViewController = self.navigationController; [self.window makeKeyAndVisible]; above is how I create UIwindow What shall I do? 回答1: You must add correct size iphone/ipad

How to debug CUICatalog: Invalid asset name supplied: (null)

白昼怎懂夜的黑 提交于 2019-12-23 10:42:08
问题 I am using xib to make UI of one of my apps. I am getting several warnings in console related to "CUICatalog: Invalid asset name supplied: (null)". From research I got to know that if we supply wrong image name in xib this error occurs. But here I want to know if there is any way to point the place from where its throwing that error, xib name or wrong image name etc. 回答1: I have just fixed this error. Just Check the usage of function [UIImage imageNamed:(NSString*) imageName]. If the

implicit conversion of 'unsigned long 'UIUserNotificationSettings *' is disallowed with arc

亡梦爱人 提交于 2019-12-23 09:27:22
问题 Push notification in iOS 8 Doesn't work. Error display: implicit conversion of 'unsigned long 'UIUserNotificationSettings *' is disallowed with arc Code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [application registerUserNotificationSettings:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)]; return YES; } I'm using ios 8.0 and xcode 6 beta. 回答1: I am getting from below from official