xcode6

Custom input view as keyboard for textfield in Swift using OSX 10.9 and Xcode 6.1.1 +

烂漫一生 提交于 2019-12-07 10:01:28
问题 I am having trouble with connecting buttons after I load a custom input view keyboard. My main screens are storyboard and my custom view is a xib. The input view is a nib with the file owner pointing to its swift class. I am loading the input view with code in another view controller using: extension UIView { class func loadFromNibNamed(nibNamed: String, bundle : NSBundle? = nil) -> UIView? { return UINib( nibName: nibNamed, bundle: bundle ).instantiateWithOwner(nil, options: nil)[0] as?

How to share iAd banner between views using AppDelegate

我的梦境 提交于 2019-12-07 09:57:45
问题 I am looking to implement iAd in my app. So far I have managed to get them showing/dismissing correctly in each view using the below. App Delegate: import UIKit import iAd @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var adBannerView = ADBannerView() View Controller 1: import UIKit import iAd class HomeScreenViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, ADBannerViewDelegate { let appDelegate = UIApplication

Is it possible to make a UIView to splash screen

怎甘沉沦 提交于 2019-12-07 09:32:29
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. 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 Yes it is possible to make any Viewcontroller as a Splash screen. Take your ViewController as a initial view

Swift Regex matching fails when source contains unicode characters

孤者浪人 提交于 2019-12-07 08:39:08
问题 I'm trying to do a simple regex match using NSRegularExpression, but I'm having some problems matching the string when the source contains multibyte characters: let string = "D 9" // The following matches (any characters)(SPACE)(numbers)(any characters) let pattern = "([\\s\\S]*) ([0-9]*)(.*)" let slen : Int = string.lengthOfBytesUsingEncoding(NSUTF8StringEncoding) var error: NSError? = nil var regex = NSRegularExpression(pattern: pattern, options: NSRegularExpressionOptions

Swift - what is downcasting? why do i need to downcast the cell in tableview?

*爱你&永不变心* 提交于 2019-12-07 08:17:10
问题 The code below is to show the name of the cells in UItableview. override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("Cell") as UITableViewCell cell.textLabel!.text = "Spring \(indexPath.row + 1)" return cell } There is a compiling error and Xcode suggests me to change the line 'as' into 'as!'- let cell = tableView.dequeueReusableCellWithIdentifier("Cell") as! UITableViewCell

How can I fix “fatal error: can't index empty buffer”

放肆的年华 提交于 2019-12-07 07:27:20
问题 I try to develop a custom autocompletion for a textfield. The code works but if I delete all my input, the debugger says: "fatal error: can't index empty buffer" in the line where is written: if createdArrayInDependencyOfInput[indexOfArray] == textFieldText && indexOfArray >= 0 && currentCountOfInput >= 1 Here is the whole code: @IBOutlet weak var MyTextField: UITextField! @IBOutlet weak var MyPlaceholderTextField: UITextField! var arrayOfSubjects: [String] = ["Informatik", "Italienisch",

Use of undeclared type AutoreleasingUnsafePointer Xcode 6 beta 6

萝らか妹 提交于 2019-12-07 07:05:02
问题 The following code gives a compiler error "Use of undeclared type AutoreleasingUnsafePointer" var myString: AutoreleasingUnsafePointer<NSString?> Have I missed a compiler setup step? Thanks 回答1: As stated in the documentation revision history Updated the Pointers section to reflect that UnsafePointer has been replaced with UnsafeMutablePointer , ConstUnsafePointer has been replaced with UnsafePointer , and AutoreleasingUnsafePointer has been replaced with AutoreleasingUnsafeMutablePointer .

Why is XCode flaky about throwing duplicate symbol errors?

强颜欢笑 提交于 2019-12-07 06:39:43
问题 I have an XCode 6 project with two targets - an iOS 8 app and an iOS 8 extension. I share a constants file across both targets. I made the mistake of declaring a const int without an extern or static prefix in the header, which resulted in the duplicate symbols linker error. This erroneous declaration has existed for the past several revisions of the project, and the constants header has been included in MULTIPLE files since day one. Why then, did I start getting the error only recently -

How to manage equal width for UITableViewRowAction in iOS8.0?(More,Delete,etc actions)

廉价感情. 提交于 2019-12-07 06:27:26
问题 I am using following code for swipe UITableViewCell in xcode6 with ios8.0.My code is working fine,but i need to set equal width for UITableViewRowActions (more,Delete,etc).How is that possible?Please help me.. -(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@“More” handler:^(UITableViewRowAction *action, NSIndexPath

Error creating LLDB target at path, Xcode 6 GM seed

陌路散爱 提交于 2019-12-07 06:27:04
问题 I'm getting this error whenever I build in Xcode 6 GM Seed. It seems to be making my app insanely slow. What exactly does this mean and how do I fix it? I had the following error: Warning: Error creating LLDB target at path '.....'- using an empty LLDB target which can cause slow memory reads from remote devices. PS : im not able to run my app, its stuck on the splash screen 回答1: There is a thread in the Apple Developer Forum, https://devforums.apple.com/message/1010068#1010068 that describes