Cannot add something to an array swift

 Problem:

I want add some values to an array iOS swift.Not able to add in that.


Solution:

It's not possible to add values in an array.You can assign values to an array is possible.

In NSMutableArray only you can add values in that dynamically.


var value:NSArray!

value.addObject(some value).    ////not possible


var value:NSMutableArray!

value.addObject(some value).    ////possible


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