xcode6

Why I can not use SetValue for Dictionary?

廉价感情. 提交于 2019-12-23 09:04:23
问题 Hello Everyone I am new in swift and In my app I declare a dictionary like this : var imageDict : Dictionary<String, String> = [:] and I want to set values for that dictionary like this : imageDict.setValue(NSStringFromCGPoint(frame), forKey: NSString.stringWithString("/(tagValue)")); But I got error like this : Dictonary <String, String> does not have a member named 'setValue' This question is from my previous question and can enybody explain my why I can not set value for that dictionar and

How do I remove a specific size class preview in Xcode 6?

邮差的信 提交于 2019-12-23 07:49:50
问题 In Xcode 6, I opened up the Preview so I could see how my storyboard would look on different devices. I can add devices to the preview. In fact, I can add the same device to the preview over and over. But how do I remove a device from the preview? I tried closing out of Xcode and re-opening it, but they are still there. 回答1: I don't know if I tried this in XCode 6.0 or not, but I'm on 6.1 now and I was able to remove the previewed device. Select the device (you can see a blue outline around

6.0.1 and Table changes “UILabel? does not have a member named 'text”

谁都会走 提交于 2019-12-23 07:39:37
问题 I'm working my way through the Swift table demos, and all of them seem have this same error message under 6.0.1. Not sure how to tackle this: 回答1: try this: cell.textLabel!.text = self.tableData[indexPath.row] And read this article about optionals here: Optionals in Swift Update: A better approach is now to use: cell.textLabel?.text = self.tableData[indexPath.row] 回答2: In Xcode 6.1.1 you have to unwrap both the cell and textLabel: cell!.textLabel!.text = "your text" 回答3: If you look up the

failed to find PDF header: `%PDF' not found

*爱你&永不变心* 提交于 2019-12-23 07:00:23
问题 I get this log when i try to load a pdf and don't know why. failed to find PDF header: `%PDF' not found. hers my code: - (void)viewDidLoad { [webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://webdesign-schoenefeld.de/es-app/heute.pdf"]]]; NSLog(@"---------------pdfloading....,------------------------"); [webview addSubview:activityind]; timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0) target:self selector:@selector(loading) userInfo:nil repeats:YES];

how to develop for iPhone and iPad in separated storyboards Xcode6

大城市里の小女人 提交于 2019-12-23 04:35:32
问题 in Xcode5 I had two storyboards, one for iPad and one for iPhone that sounds easier to watch the flow of the viewControllers, and because on iPhone you can't do the same thing you do in iPad (UIPopoverControllers, and other cool stuff) now in Xcode6 implemented universal storyboards which is good for some people, but what if you want to keep using separated storyboards, I can't see the option to set one StoryBoard for iPhone and other for iPad, all I see is this: just a main interface... how

Can't unwrap Optional.None when setting window background color

点点圈 提交于 2019-12-23 03:41:25
问题 I think I'm missing something very simple here... override func viewDidLoad() { self.view.window.backgroundColor = NSColor.grayColor(); } This returns fatal error: Can't unwrap Optional.None which isn't a very descriptive error. Can someone tell me what I'm missing? 回答1: Something in the self.view.window.backgroundColor chain (probably self.view.window ) is nil. Many view- and view controller-related properties are implemented as implicitly unwrapped, which means that they are Optionals that

Is it possible to make a UIView to splash screen

别来无恙 提交于 2019-12-23 03:36:10
问题 Is it possible to make a UIViewController or UIView type class as a splash screen ? Basically I want an animated splash screen for my app. 回答1: You can do it. 1. First create any UIViewController or UIView 2. Click project Targets(Click your project-Left side->It shows Project and Targets options) 3. Click General 4. Select App Icons and Launch Images 5. Choose Launch Screen File 6. Click Drop Down of Launch Screen File 7. Then Choose your required view controller which sets as splash screen

How to set “NSBackgroundColorAttributeName” on TTTAttributedLabel, OHAttributedLabel or SETextView in Swift

心不动则不痛 提交于 2019-12-23 03:07:25
问题 I'm trying to set NSBackgroundColorAttributeName attribute on TTTAttributedLabel , OHAttributedLabel or SETextView , but it's not work. Anyone have any idea? Sample code is followed. class ViewController: UIViewController { @IBOutlet weak var textLabel: UILabel! @IBOutlet weak var ttLabel: TTTAttributedLabel! @IBOutlet weak var ohLabel: OHAttributedLabel! @IBOutlet weak var seTextView: SETextView! override func viewDidLoad() { super.viewDidLoad() var content: String = "This is Test." var text

Set local notification for everyday at midnight

删除回忆录丶 提交于 2019-12-23 02:32:55
问题 I'm trying to create a simple notification that will appear every day at midnight. This is the code I use: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: UIUserNotificationType.Sound | UIUserNotificationType.Alert | UIUserNotificationType.Badge, categories: nil)) var thisDate

iOS8 issue when trying to push multiple UIViewControllers in NavigationController

血红的双手。 提交于 2019-12-23 02:21:32
问题 I have 6 UIViewControllers connected with push segues with identifiers and a functionality in my app to 'jump' to the desired UIViewController using this method for stacking ViewControllers: - (void) JumpTo6 { UINavigationController *nav = self.navigationController; UIViewController *a =[self.storyboard instantiateViewControllerWithIdentifier:@"2"]; [nav pushViewController:a animated:NO]; UIViewController *b =[self.storyboard instantiateViewControllerWithIdentifier:@"3"]; [nav