Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store integer value into an NSMutableArray in iphone

I have NSMutableArray having values 10,15,26,28. I want to store them into another array as an integer form how do i store them. Thanks :)

like image 668
Pinku Avatar asked Sep 11 '26 04:09

Pinku


1 Answers

here how to add

[array addObject:[NSNumber numberWithInt:10]];

you can get the integer value like

//assuming array has nsnumber/nsstring objects.

[[array objectAtIndex:index] intValue];
like image 180
Rahul Vyas Avatar answered Sep 13 '26 17:09

Rahul Vyas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!