gpt4 book ai didi

ios - 命令因信号 : Segmentation fault:11 而失败

转载 作者:搜寻专家 更新时间:2023-11-01 05:43:51 27 4
gpt4 key购买 nike

在编译我的项目时,我不断收到此错误,有时我的项目运行顺利,但有时 xcode 会显示此错误。我还添加了 AddMembersViewController.swift,我认为这是导致问题的原因

MergeSwiftModule normal x86_64 /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/Rendezvous.swiftmodule
cd /Users/prakhar/Desktop/iOS/Rendezvous
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-module /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/MoreViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/HomePageViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/RegisterViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/LocationSelectorViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/AddMembersViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/SetupViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/ViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/UpdateViewController~partial.swiftmodule -parse-as-library -target x86_64-apple-ios10.1 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -I /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Products/Debug-iphonesimulator -F /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Products/Debug-iphonesimulator -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/FirebaseAnalytics/Frameworks/frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/FirebaseAuth/Frameworks/frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/FirebaseCore/Frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/FirebaseDatabase/Frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/FirebaseInstanceID/Frameworks/frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/GoogleInterchangeUtilities/Frameworks/frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/GoogleMaps/Base/Frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/GoogleMaps/Maps/Frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/GooglePlaces/Frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/GoogleSymbolUtilities/Frameworks/frameworks -enable-testing -g -import-objc-header /Users/prakhar/Desktop/iOS/Rendezvous/Rendezvous/Rendezvous-Bridging-Header.h -module-cache-path /Users/prakhar/Library/Developer/Xcode/DerivedData/ModuleCache -D DEBUG -serialize-debugging-options -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Rendezvous-generated-files.hmap -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Rendezvous-own-target-headers.hmap -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Rendezvous-all-target-headers.hmap -Xcc -iquote -Xcc /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Rendezvous-project-headers.hmap -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Firebase/Core/Sources -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/Firebase -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/FirebaseAnalytics -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/FirebaseAuth -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/FirebaseCore -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/FirebaseDatabase -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/FirebaseInstanceID -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GTMSessionFetcher -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GoogleInterchangeUtilities -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GoogleMaps -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GooglePlaces -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GoogleSymbolUtilities -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GoogleToolboxForMac -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/DerivedSources/x86_64 -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc -working-directory/Users/prakhar/Desktop/iOS/Rendezvous -emit-module-doc-path /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/Rendezvous.swiftdoc -module-name Rendezvous -emit-objc-header-path /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/Rendezvous-Swift.h -o /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/Rendezvous.swiftmodule

0 swift 0x000000010fd283ad PrintStackTraceSignalHandler(void*) + 45
1 swift 0x000000010fd27b56 SignalHandler(int) + 790
2 libsystem_platform.dylib 0x00007fffd1db0bba _sigtramp + 26
3 libsystem_platform.dylib 0x00007fff52f3aba8 _sigtramp + 2165874696
4 swift 0x000000010d334996 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 806
5 swift 0x000000010d32d178 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 18664
6 swift 0x000000010d338b2c swift::ModuleFile::maybeReadPattern() + 332
7 swift 0x000000010d32bd82 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 13554
8 swift 0x000000010d33d4a7 swift::ModuleFile::loadAllMembers(swift::Decl*, unsigned long long) + 647
9 swift 0x000000010d6d006a (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 314
10 swift 0x000000010d6ce01b (anonymous namespace)::Traversal::doIt(swift::Decl*) + 219
11 swift 0x000000010d085c2f swift::SILPassManager::SILPassManager(swift::SILModule*, llvm::StringRef) + 1423
12 swift 0x000000010d08acef swift::runSILDiagnosticPasses(swift::SILModule&) + 159
13 swift 0x000000010cd34f7e performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 19758
14 swift 0x000000010cd2e2b3 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 17859
15 swift 0x000000010ccea5cf main + 8239
16 libdyld.dylib 0x00007fffd1ba3255 start + 1
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-module /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/MoreViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/HomePageViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/RegisterViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/LocationSelectorViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/AddMembersViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/SetupViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/ViewController~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/UpdateViewController~partial.swiftmodule -parse-as-library -target x86_64-apple-ios10.1 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -I /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Products/Debug-iphonesimulator -F /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Products/Debug-iphonesimulator -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/FirebaseAnalytics/Frameworks/frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/FirebaseAuth/Frameworks/frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/FirebaseCore/Frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/FirebaseDatabase/Frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/FirebaseInstanceID/Frameworks/frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/GoogleInterchangeUtilities/Frameworks/frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/GoogleMaps/Base/Frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/GoogleMaps/Maps/Frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/GooglePlaces/Frameworks -F /Users/prakhar/Desktop/iOS/Rendezvous/Pods/GoogleSymbolUtilities/Frameworks/frameworks -enable-testing -g -import-objc-header /Users/prakhar/Desktop/iOS/Rendezvous/Rendezvous/Rendezvous-Bridging-Header.h -module-cache-path /Users/prakhar/Library/Developer/Xcode/DerivedData/ModuleCache -D DEBUG -serialize-debugging-options -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Rendezvous-generated-files.hmap -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Rendezvous-own-target-headers.hmap -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Rendezvous-all-target-headers.hmap -Xcc -iquote -Xcc /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Rendezvous-project-headers.hmap -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Firebase/Core/Sources -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/Firebase -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/FirebaseAnalytics -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/FirebaseAuth -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/FirebaseCore -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/FirebaseDatabase -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/FirebaseInstanceID -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GTMSessionFetcher -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GoogleInterchangeUtilities -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GoogleMaps -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GooglePlaces -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GoogleSymbolUtilities -Xcc -I/Users/prakhar/Desktop/iOS/Rendezvous/Pods/Headers/Public/GoogleToolboxForMac -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/DerivedSources/x86_64 -Xcc -I/Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc -working-directory/Users/prakhar/Desktop/iOS/Rendezvous -emit-module-doc-path /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/Rendezvous.swiftdoc -module-name Rendezvous -emit-objc-header-path /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/Rendezvous-Swift.h -o /Users/prakhar/Library/Developer/Xcode/DerivedData/Rendezvous-ardcsmuqhgsylxapkcrnrtdcwvnu/Build/Intermediates/Rendezvous.build/Debug-iphonesimulator/Rendezvous.build/Objects-normal/x86_64/Rendezvous.swiftmodule
1. While loading members for 'AddMembersViewController' at <invalid loc>
2. While deserializing decl #143 (PATTERN_BINDING_DECL)
3. While deserializing decl #13 (VAR_DECL)

添加成员 View Controller

@IBOutlet weak var eventName: UITextField!
@IBOutlet weak var memberName: UITextField!
@IBOutlet weak var addButton: UIButton!
@IBOutlet weak var finishButton: UIButton!
@IBOutlet weak var createButton: UIButton!
@IBOutlet weak var timeAndDate: UIDatePicker!
@IBOutlet weak var errorLabel: UILabel!
@IBOutlet weak var tableView: UITableView!
var rCoordinate:CLLocationCoordinate2D!
var members:[String]=[]
var ref = FIRDatabase.database().reference(withPath: "event-data")
var refUser = FIRDatabase.database().reference(withPath: "user-data")
var event:String = ""
override func viewDidLoad() {
super.viewDidLoad()
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "members")
memberName.isEnabled=false
addButton.isHidden=true
finishButton.isHidden=true
let user = FIRAuth.auth()?.currentUser
members.append((user?.displayName!)!)
// Do any additional setup after loading the view.
}
@IBAction func cancel(_ sender: Any) {
let alert=UIAlertController.init(title: "confirmation", message: "Are you sure you want to cancel", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction.init(title: "Yes", style: UIAlertActionStyle.default, handler: {(action:UIAlertAction!) in
self.performSegue(withIdentifier: "home", sender: self)
}))
alert.addAction(UIAlertAction.init(title: "No", style: UIAlertActionStyle.cancel, handler: nil))
self.present(alert, animated: true, completion: nil)
}

@IBAction func create(_ sender: Any) {
eventName.isEnabled = false
timeAndDate.isEnabled = false
createButton.isHidden = true
addButton.isHidden = false
memberName.isEnabled = true
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

override func viewDidAppear(_ animated: Bool) {
errorLabel.text=""
}

@IBAction func add(_ sender: Any) {
errorLabel.text=""
let newUser:String = memberName.text!
for one in members{
if(one == newUser){
errorLabel.text="\(newUser) already added"
return
}
}
var flag=false
refUser.observeSingleEvent(of: .value, with: {(snapshot) in
let value=snapshot.value as! NSDictionary
for val in (value.allKeys){
//print(val)
if(newUser == val as? String){
flag=true
break
}
//print("inside \(flag)")
}
if(flag){
self.members.append(newUser)
self.tableView.reloadData()
self.memberName.text=""
self.finishButton.isHidden=false
}
else{
self.errorLabel.text="No such UserNAme found"
}
})

}
@IBAction func finish(_ sender: Any) {
let event=eventName.text!
if(members.count<2){
let alert=UIAlertController.init(title: "No members added", message: "Add atleast one more member", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction.init(title: "Ok", style: UIAlertActionStyle.cancel, handler: nil))
self.present(alert, animated: true, completion: nil)
}
let formatter=DateFormatter()
formatter.dateFormat = "MMMM dd ,YYYY"
let date = formatter.string(from: timeAndDate.date)
formatter.dateFormat = "hh:mm a"
let time = formatter.string(from: timeAndDate.date)
ref.child("\(event)/latitude").setValue(rCoordinate.latitude)
ref.child("\(event)/longitude").setValue(rCoordinate.longitude)
ref.child("\(event)/date").setValue(date)
ref.child("\(event)/time").setValue(time)
ref.child("\(event)/noOfMembers").setValue(members.count)
for i in 0..<members.count{
ref.child("\(event)/member\(i)").setValue(members[i])
refUser.child("\(members[i])/noOfEvents").observeSingleEvent(of: .value, with: {(snapshot) in
var no = snapshot.value as! Int
no += 1
self.refUser.child("\(self.members[i])/noOfEvents").setValue(no)
self.refUser.child("\(self.members[i])/event\(no)").setValue(event)
})
}
let alert=UIAlertController.init(title: "Done", message: "Event created..!", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction.init(title: "Ok", style: UIAlertActionStyle.default, handler: {(action:UIAlertAction) in
self.performSegue(withIdentifier: "home", sender: self)
}))
self.present(alert, animated: true, completion: nil)
}

public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return members.count
}


public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{
let cell=tableView.dequeueReusableCell(withIdentifier: "members", for: indexPath)
cell.textLabel?.text=members[indexPath.row]
cell.selectionStyle = .none
return cell
}

func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
//let user = FIRAuth.auth()?.currentUser?.displayName
if(editingStyle == UITableViewCellEditingStyle.delete){
if(indexPath.row == 0){
let alert=UIAlertController.init(title: "Error !!", message: "You cannot remove yourself..!", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction.init(title: "Ok", style: UIAlertActionStyle.cancel, handler: nil))
self.present(alert, animated: true, completion: nil)
}
else{
members.remove(at: indexPath.row)
if(members.count < 2){
finishButton.isHidden = true
}
tableView.reloadData()
}
}
}

public func numberOfSections(in tableView: UITableView) -> Int{
return 1
}

最佳答案

Command+Shift+K 清理你的项目,然后 File->Workspace settings->DerivedData 旁边的小箭头并删除文件夹。这有时可以解决问题。

另外,我注意到在 Xcode 8.3 beta 中这个问题不再存在。

关于ios - 命令因信号 : Segmentation fault:11 而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42062913/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com