iphone - How to add array values in a string in ios -
can please tell me how put array values[adding values]
string
or integer
.
suppose array a=[1,2,3]
.
after adding(+ action) should like
string=1+2+3=>6
thanks , regards,
use kvc collection operator
nsarray *array =@[@(1),@(2),@(3)]; nslog(@"sum : %@", [array valueforkeypath:@"@sum.self"]);
Comments
Post a Comment