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

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift