ios - Swift : [MyApp.MyClass retain]: message sent to deallocated instance -
i getting following crash app.
[myapp.myclass retain]
i not know issue @ honest you.
this occuring in swift class. need know why is occurring , general way fix this.
here swift code in general (there more it, don't need post all.
class myclass : nsobject, apidelegate, uialertviewdelegate { var apiclient : api? func initmyclass (authkey : nsstring?) { apiclient = api(authkey: authkey, debugmode:false) apiclient?.delegate = self }
as rob said, looks culprit methods begin init
not initializers. seems swift strange these method around memory management.
anyway, in own code, renamed of these methods begin setup
instead of init
, , haven't received "retain message sent deallocated instance" error again.
xcode should provide warning prevent error.
Comments
Post a Comment