xcode6

Error (“'()' is not identical to 'UInt8'”) writing NSData bytes to NSOutputStream using the write function in Swift

走远了吗. 提交于 2019-12-29 08:03:07
问题 I'm trying to build an asynchronous file download in Swift based on the Erica Sadun's method. But I need it to handle bigger files, so I found this answer about using a NSOutputStream instead of NSData, makes sense. However, I can't get it to work. I get this error when I try adding the NSData bytes (in my NSURLConnection didReceiveData function) to the NSOutputStream write function: '()' is not identical to 'UInt8' on this row: bytesWritten = self.downloadStream.write(data.bytes, maxLength:

what would be a proper storyboard example of combining nav bars and tab bars in one app?

六月ゝ 毕业季﹏ 提交于 2019-12-29 07:49:08
问题 Hi I'm new to ios app dev. I've only done tutorials so far that have covered apps with either nav bars or tab bars. Now I want to make an app combining both. So, say I have an app with a tab bar at the bottom with two tabs: friends and enemies. In each tab i plan to have a running list of who my friends and enemies are, so it will need an addPerson button on the nav bar of each tab. given that scenario, what would be the proper way to organize my controllers and views and stuff? would both my

Reference to ' ' is ambigous error in Xcode

风格不统一 提交于 2019-12-29 07:34:09
问题 I was working with a custom iOS framework project in Xcode.There I am getting a lot of errors mentioning "Reference to ' ' is ambigous".I am attaching the screenshot of errors.Please help me correcting this. 回答1: The error message makes me think you have two declarations of the same library functions. All of those references are from UIKit . Check to make sure only one version of UIKit is referenced in your project (check the frameworks), and make sure any libraries you have included are

Difference between frame.size.width and frame.width

梦想的初衷 提交于 2019-12-29 06:45:07
问题 I was writing a program in swift and just now I noticed that I can directly access a CGRect frame's width and height properties directly without using the CGSize width and height. That is I am now able to write a code like this. @IBOutlet var myView: UIView! override func viewDidLoad() { super.viewDidLoad() var height = myView.frame.height var height1 = myView.frame.size.height } In Objective C, when I tried to write the same code, the line height = view.frame.height is throwing an error. Can

How to convert NSNull to nil in Swift?

ⅰ亾dé卋堺 提交于 2019-12-29 06:41:09
问题 I want to fetch JSON data from my server and manipulate it upon launch. In Objective-C, I have used this #define code to convert NSNull to nil , since the fetched data might include null at times. #define NULL_TO_NIL(obj) ({ __typeof__ (obj) __obj = (obj); __obj == [NSNull null] ? nil : obj; }) However, in Swift, is it possible to convert the NSNull to nil ? I want to use the following operation (the code is Objective-C's): people.age = NULL_TO_NIL(peopleDict["age"]); In the above code, when

Swift Enumerations .toRaw and .fromRaw with Xcode 6.1

為{幸葍}努か 提交于 2019-12-29 06:34:19
问题 In Xcode 6.1, the enumerations toRaw and fromRaw functions don't work anymore: enum TestEnum : String { case A = "a" case B = "b" } if let a = TestEnum.fromRaw("a") { prinln(a.toRaw()) } Errors: 'TestEnum' does not have a member named 'toRaw' 'TestEnum.Type' does not have a member named 'fromRaw' 回答1: Create an enum from a raw using the failable initializer with rawValue and get the raw value using the attribute rawValue . if let a = TestEnum(rawValue: "a") { println(a.rawValue) } Read the

xCode 6 how to fix “Use of undeclared identifier” for automatic property synthesis?

丶灬走出姿态 提交于 2019-12-29 04:27:12
问题 I'm using xCode6 Beta 3, and am running into an issue where a code which previously compiled fine (xCode 5.1.1 or xCode6 beta 2) suddenly started to give me "Use of undeclared identifier" errors when accessing an automatically synthesized instance variable: - (void)setFinished:(BOOL)finished { [self willChangeValueForKey:@"isFinished"]; _finished = finished; [self didChangeValueForKey:@"isFinished"]; } //ERROR: Use of undeclared identifier '_finished'; did you mean 'finished'? Adding

how to change the height of a single cell when clicked?

孤街浪徒 提交于 2019-12-29 03:33:09
问题 I have to resize a single row of my tableView when clicked. How I can do this? Anybody could help me? My view controller class: class DayViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet var daysWorkPointTable: UITableView override func viewDidLoad() { super.viewDidLoad() var nipName = UINib(nibName: "daysWorkPointsCell", bundle: nil) self.daysWorkPointTable.registerNib(nipName, forCellReuseIdentifier: "daysWorkCell") } func tableView(tableView:

Xcode 6 iOS 8 iCloud core data setup

旧街凉风 提交于 2019-12-29 02:33:33
问题 Has anyone got iCloud core data syncing setup on Xcode 6 and iOS 8? (hopefully this isn't a duplicate post) Where did iCloud Core Data storage option go? I remember Core Data had an extra storage option called Core Data storage, but now in Xcode 6 it only seems to show key-value and document storage when I enable the iCloud toggle in Xcode 6. Background Info New iPad app Xcode 6 Targeting minimum version iOS 7 but hoping it works for iOS 8 too? (We can set iOS 8 as minimum) Want to use iCloud

Xcode attempted to locate or generate matching signing assets and failed to do so

冷暖自知 提交于 2019-12-29 02:32:26
问题 So I'm trying to create an ad-hoc build using existing provisioning profile (that worked before) with Xcode 6.0.1 on Mavericks, but after trying to export this archive, I keep getting the following error: Do I need to re-create my certificates and provisioning profiles, or is there a better solution? Thanks! 回答1: I'm also facing this issue as a 'Team Member' role. The 'You are not allowed to perform this operation' warning leads me to believe that XCode is more strictly enforcing the roles