App crashes when i use nsmutablestring iOS swift

  Solution:

@property (nonatomicassignNSMutableStringstr;


When i use the above line try to run the app it crashes.


Because it's a mutable value.. NSMutableString and NSString are came from nsobject with mutble value..


@property (nonatomicweakNSMutableStringstr;


You must have to use like above the app will works fine..You cannot be able to assign a value to the mutated objects.You must use that as weak property..


Happy coding...


Comments

Popular posts from this blog

store cgpoint in userdefaults iOS swift

libc++abi: terminating due to uncaught exception of type NSException iOS swift