我在運行時出現「命令因信號失敗:分段錯誤: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