Reputation: 43
I am very new to coding and i have decided to begin learning swift. I have encountered a problem with a bug apparently and my app is not running properly. I have attached all the code in my project. Hope anyone can help. Thanks In advance
Upvotes: 1
Views: 9166
Reputation: 146
Remove the lines where object creates inside a class like
var thirdContact = Contacts()
in Contacts class. You can't create object inside same class, it leads to endless loop. Stack trace example
#1 0x000000010b6c3f88 in Contacts.init(name:phone:) at Contacts.swift:12
#2 0x000000010b6c3e11 in Contacts.__allocating_init(name:phone:) ()
#3 0x000000010b6c415a in Contacts.init(name:phone:) at Contacts.swift:22
#4 0x000000010b6c3e11 in Contacts.__allocating_init(name:phone:) ()
#5 0x000000010b6c415a in Contacts.init(name:phone:) at Contacts.swift:22
...
Upvotes: 6