我收到了错误......
由于信号命令失败:分段错误:11
...在尝试编译我的Swift应用程序时.我正在使用Xcode 6.1,尝试在iOS 8.1上构建iPhone 5.
我的守则
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var username: UITextField!
@IBAction func signIn(sender: AnyObject) {
PFUser.logInWithUsernameInBackground(username.text, password:"mypass") {
(user: PFUser!, error: NSError!) -> Void in
if user != nil {
println("Logged In")
} else {
func myMethod() {
var user = PFUser()
user.username = username.text
user.password = " "
user.signUpInBackgroundWithBlock {
(succeeded: Bool!, error: NSError!) -> Void in
if error == nil {
// Hooray! Let them use the app now.
} …Run Code Online (Sandbox Code Playgroud) 我刚刚更新到最新的Xcode 6.3测试版,我收到一个错误,我无法找到解决方案.
当我运行我的应用程序时,我收到错误:Command failed due to signal: Segmentation Fault 11.我查看了完整的错误消息,并且我已经完成了我认为相关的部分:
(unresolved_dot_expr type='@lvalue String!' location=/Filename/FifthViewController.swift:423:19 range=[/Filename/FifthViewController.swift:423:9 - line:423:19] field 'text'
(declref_expr type='UITextField' location=/Filename/FifthViewController.swift:423:9 range=[/Filename/FifthViewController.swift:423:9 - line:423:9] decl=AffordIt.(file).FifthViewController.func decl.textField@/Filename/FifthViewController.swift:418:34 specialized=yes))
Run Code Online (Sandbox Code Playgroud)
和
While emitting SIL for 'textFieldDidChangeValue' at /Filename/FifthViewController.swift:418:5
Run Code Online (Sandbox Code Playgroud)
有人有主意吗?显然我已经用'Filename'替换了完整路径.这是与错误相关的代码:
textField.addTarget(self, action: "textFieldDidChangeValue:", forControlEvents: UIControlEvents.EditingChanged)
func textFieldDidChangeValue(textField: UITextField) {
//Automatic formatting for transaction value text field. Target is added above.
var text = textField.text.stringByReplacingOccurrencesOfString(currencyFormatter.currencySymbol!, withString: "").stringByReplacingOccurrencesOfString(currencyFormatter.groupingSeparator, withString: "").stringByReplacingOccurrencesOfString(currencyFormatter.decimalSeparator!, withString: "").stringByReplacingOccurrencesOfString(" ", withString: "") // There is a special character here. This …Run Code Online (Sandbox Code Playgroud)