我在运行时出现“命令因信号失败:分段错误:11”错误。我相信这是一个编译错误,因为当我清理我的代码时,它没有任何错误,只有当我运行&构建。我正在使用新的Xcode beta 7.1。我也通过我的Xcode 7.0构建它,但收到相同的错误。Xcode错误:命令因信号失败:分段错误:11
Swift代码以前没有错误构建。此代码正在处理一个Parse后端并查询一些信息以显示给用户;这里是下面的日志:我搜索为什么错误
1. While type-checking 'viewDidLoad' at /Users/User/Documents/Documents/ProjectName/UserProfile.swift:27:14
2. While type-checking expression at [/Users/User/Documents/Documents/ProjectName/UserProfile.swift:34:9 - line:55:9] RangeText="query.findObjectsInBackgroundWithBlock {
(objects: [AnyObject]?, error: NSError?) -> Void in
if error == nil {
if let objects = objects as? [PFObject] {
for object in objects {
let userImageFile: PFFile = object.objectForKey("ProfPhoto") as! PFFile
userImageFile.getDataInBackgroundWithBlock {
(imageData: NSData?, error: NSError?) -> Void in
if error == nil {
if let imageData = imageData {
self.ProfileImage.image = UIImage(data:imageData)
}
}
}
}
}
} else {
// Log details of the failure
print("Error: \(error!) \(error!.userInfo)")
}
}"
3. While type-checking expression at [/Users/User/Documents/Documents/ProjectName/UserProfile.swift:34:9 - line:55:9] RangeText="query.findObjectsInBackgroundWithBlock {
(objects: [AnyObject]?, error: NSError?) -> Void in
if error == nil {
if let objects = objects as? [PFObject] {
for object in objects {
let userImageFile: PFFile = object.objectForKey("ProfPhoto") as! PFFile
userImageFile.getDataInBackgroundWithBlock {
(imageData: NSData?, error: NSError?) -> Void in
if error == nil {
if let imageData = imageData {
self.ProfileImage.image = UIImage(data:imageData)
}
}
}
}
}
} else {
// Log details of the failure
print("Error: \(error!) \(error!.userInfo)")
}
}"
4. While type-checking expression at [/Users/User/Documents/Documents/ProjectName/UserProfile.swift:34:48 - line:55:9] RangeText="{
(objects: [AnyObject]?, error: NSError?) -> Void in
if error == nil {
if let objects = objects as? [PFObject] {
for object in objects {
let userImageFile: PFFile = object.objectForKey("ProfPhoto") as! PFFile
userImageFile.getDataInBackgroundWithBlock {
(imageData: NSData?, error: NSError?) -> Void in
if error == nil {
if let imageData = imageData {
self.ProfileImage.image = UIImage(data:imageData)
}
}
}
}
}
} else {
// Log details of the failure
print("Error: \(error!) \(error!.userInfo)")
}
}"
http://stackoverflow.com/questions/32645533/xcode-7-compile-error-command-failed-due-to-signal-segmentation-fault-11 该用户恢复到xcode6并编译它,但它不适合我。 – pmoney13