Objective C and Swift in same Project - -[__NSCFNumber length]: unrecognized selector sent to instance -
i new in swift, have appdelegate file in objective-c , current controller in swift. issue have property in appdelegate user_id contain login user id , token property auth_token.
@property (nonatomic, strong) nsstring * user_id; @property (nonatomic, strong) nsstring * auth_token;
i want these values on swift controller. have instance of current appdelegate like:
let app_delegate_swift = uiapplication.shared.delegate as! appdelegate
and when print these value on swift controller like:
print("authtoken - \(app_delegate_swift.auth_token!)") print("user id - \(app_delegate_swift.user_id!)")
i able value of auth_token, in case of user_id, gives me error like:
terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nscfnumber length]: unrecognized selector sent instance 0xb000000000036783'
error indicates using nsstring method on nsnumber. please, check if data strings.
Comments
Post a Comment