0

In my application I need to put some c-struct-like data into an NSMutableArray. After some research I found that the most suggested solution is to wrap the struct into NSValue and insert that into the array.

What about creating a custom subclass of NSObject with some properties to match the fields of the struct and insert that into the array?

NSValue is a subclass of NSObject so the overhead in term of performance and memory shouldn't be huge. Am I missing something obvious?

Jacopo
  • 1,031
  • 2
  • 12
  • 25

1 Answers1

0

The better idea is to create custom object of NSObject so you can directly access those values as well as insert it into your NSArray, So don't need to convert it into NSValue instead directly create object for that.

Dhawal Dawar
  • 354
  • 2
  • 8