I have an NSMutableArray and I need to make the product of all the numbers inside it. I just can't understand how to do. PS. I'm quite new with objective-c so be as clear as possible. Thank's
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
H2CO3 is right. For the sake of completeness try
where numArray is your array.
You can have a look on NSExpression class it's very powerfull and you can customize it to your requirements. It's also support many build in functions, for example:
yes you can also do like this..
Assuming we're working with
int
values...int
andintValue
can easily be replaced withdouble
anddoubleValue
or whatever is appropriate for what you need.someArray
is the name of the array of values.If, however... the question is poorly worded and we've all misunderstood, and you need a new array whose indices contain the product of the values of the objects at the same indices in two other arrays, then you're looking for something more like this: