xcode6

TableViewController using SDWebImage with UIImage

元气小坏坏 提交于 2019-12-11 20:43:00
问题 Good afternoon, Im trying to use SDWebImage in my TableViewController for the first time and I have some problems using the "setImageWithURL" property because it only admits a UIImageView but I have a UIImage in order to parse the data from my JSON. How I have to change my code in order to use a UIImageView instead of a UIImage? Because UIImageView doesn't have the same functions as UIImage and I have to create my Image from a URL. Here is my code, I hope you can help me with some tips: -

Achieving this layout for a viewcontroller using autolayout

血红的双手。 提交于 2019-12-11 20:06:38
问题 I am working on a viewcontroller and I would like to try to achieve something like the picture below. I'd like to do this so it looks great on any device with regards to aspect ratio. The top is a container, the middle is a collectionview, and the bottom is a uitableview. What i'm trying to preserve is the aspect ratios. My thought to do this was the following: For the first box, set the leading, trailing, and top margins to be to the container (guideline). Set the bottom one to be the box

UIToolbar not displaying on iPhone 4 and iPhone 4s

南笙酒味 提交于 2019-12-11 19:53:45
问题 I have a UIToolbar on the bottom of my app. On any device iPhone 5 and up it shows up correctly. On iPhone 4s and down it does not show on the screen at all. I have tried to add constraints but it is not helping. I am at a lose as to why this is happening. My app worked fine up until today. Any suggestions would be much appreciated. 来源: https://stackoverflow.com/questions/26004349/uitoolbar-not-displaying-on-iphone-4-and-iphone-4s

Why is my popup view is empty?

烈酒焚心 提交于 2019-12-11 18:41:32
问题 I am trying to make a popup view similar to this one. What I have done so far is: Open a new single view project. Added a button to the main view. Added a new xib file named "popup.xib" Added a new swift file named "PopupViewController.swift" At the identity tab I made the first responders class to be "PopupViewController" I put in the popup.xib a label, a button and a view with different background colour. Of course everything has constraints about where it should appear. My code:

Custom UICollectionViewCell Subview Layout Issue

坚强是说给别人听的谎言 提交于 2019-12-11 18:03:57
问题 I have a custom UICollectionViewCell class that sets the background view of the cell to a downloaded image and also a UILabel added to it that sits neatly at the bottom of the cell and is slightly transparent (this label is the title of the image). It looks great in portrait but when I rotate my device to landscape the UILabel stays in its position while the custom cell resizes itself to better fit the screen. I have my UILabel fully constrained to the cell so I don't know why it isn't

Get Battery Charge Information Programmatically

ぐ巨炮叔叔 提交于 2019-12-11 15:06:36
问题 (Xcode 6, OSX 10.10.3) How do I get the battery charge information of a Mac (Charge Status, Battery level, Cycle count, Maximum charge in mAH) programmatically? 回答1: Hope this'll help you: It uses non-approved calls, so don’t post your application with this code or you may be rejected! http://blog.coriolis.ch/2009/02/14/reading-the-battery-level-programmatically/ From Apple; so don't worry about this code: https://developer.apple.com/library/ios/samplecode/BatteryStatus/Introduction/Intro

Bridging-header.h causes Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

≡放荡痞女 提交于 2019-12-11 13:35:54
问题 If i add this line to my PROJECT-Bridging-Header.h file #import "Typhoon.h" Xcode 6.1 throws this error /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1 Typhoon framework is added by CocoaPods exactly like in the tutorial I tried several thinks, but nothing helped Delete XCODE deriver data create new Project delete and create new bridging-header.h file 回答1: Ran across a similar kind of issue, needed to clean up the project

IBOutlet not connecting in SWIFT

我是研究僧i 提交于 2019-12-11 13:16:49
问题 All, I have this in swift class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet var tableView: UITableView! So if i go in the storyboard, I should be able to see that, and I should be able to connect it like this : So I should be able to go to 'New Referencing Outlet' and drag it on the view controller (yellow tab at the top) and I should see 'tableView' and connect it. This doesn't happen , I am confused why ! 回答1: Do no type following line in advance

Swift… how can I make an image change when a button its pressed and return it back to normal?

不打扰是莪最后的温柔 提交于 2019-12-11 13:11:22
问题 Swift... how can I make an image change when a button its pressed and return it back to normal as soon as the finger is not longer touching the button? Im trying to learn swift by making a simple app but Im stuck in making a simple button that changes properties just when it is being pressed. For now I can just make it change when it is clicked and get back to normal when its touched again. 回答1: You can change button images by setting image for specified state. In your case you have to set it

Unresolvable error with Parse “Get Data In Background With Block”

不羁岁月 提交于 2019-12-11 13:07:18
问题 I don't know if this is user error or due to the Xcode and Swift updates. I'm pulling image files off of Parse and no matter how I tweak the syntax I get a persistent error of: swift:64:23: Cannot invoke 'getDataInBackgroundWithBlock' with an argument list of type '((NSData!, NSError?) -> Void) My code is: func callData() { var imageQuery = PFObject(className: "QuestionMaster") let iconImageFile = imageQuery["questionImage"] as! PFFile! iconImageFile.getDataInBackgroundWithBlock { (imageData: