This error appears when trying to get a CGPoint from NSValue:
"Cannot get value with size 16. The type encoded as {?={CGPoint=dd}d} is expected to be 24 bytes"
for (NSValue *p in array) {
CGPoint pointValue = p.CGPointValue; //Here appears this error
}
for (NSValue *p in array) {
CGPoint pointValue = [p CGPointValue]; //Here appears this error too
}
The NSValue is created from a Library and cannot access on it.
Edit 1
Printing p.objCType results is: {CGPoint=dd}
Edit 2 Printing array result is:
2021-09-09 16:04:04.251526+0200 App[4964:674948] (
"{length = 24, bytes = 0xa3b27988de206940eb42b35cc9586740000000000000f03f}",
"{length = 24, bytes = 0x33b2fe8e136f6840ace8651ab5b967409dc9d7ee7b0bef3f}",
"{length = 24, bytes = 0xc154b1089cdd6740ace8651ab5b96740b28e3f23264dea3f}",
"{length = 24, bytes = 0x580edb282aeb6640d62444f11779674016af93916f39e63f}",
"{length = 24, bytes = 0xf581a96211b865401f0e49e9040867404ded927b8a12e33f}",
"{length = 24, bytes = 0x1324e1e2ce74644087a474027c66664034f3481fe7b4e13f}",
"{length = 24, bytes = 0x3523ebef38116340ef3aa01bf3c46540778fc387b583e03f}",
"{length = 24, bytes = 0x506850e349ee6140777ef255f4f26440e3d77dc1a4b2e13f}",
"{length = 24, bytes = 0xea7e4c9084db6040ffc14490f52064405e2015fe2ed3e23f}",
"{length = 24, bytes = 0xfe131ad478f25f40a6b2bdeb801e63401999aea8afcae13f}",
"{length = 24, bytes = 0x149fdaad30105f4042147f91332c62404e8f96066287e53f}",
"{length = 24, bytes = 0x1db6515436af5e40ca57d1cb345a6140679349620e80e73f}",
"{length = 24, bytes = 0x1db6515436af5e40529b230636886040f83000f8e0c2e73f}",
"{length = 24, bytes = 0x1db6515436af5e409e9f7c15bd8c5f40153010013271e83f}",
"{length = 24, bytes = 0x0a8863072b715f406fccd347ab495e40869a27450e63e83f}",
"{length = 24, bytes = 0x71675af0b38a604054179ae54ae65c40a7e25a959d81e53f}",
"{length = 24, bytes = 0x5cdc9916fc6c6140fb071341d6e35b4069a857606cb8e53f}",
"{length = 24, bytes = 0xc52270f66d5f62408dda1c31b0015b40d144c5cd8e6ee53f}",
"{length = 24, bytes = 0xaadd0a035d826340cc346a73c4a05a40b88edb022dbbe43f}",
"{length = 24, bytes = 0x0d6a3cc975b56440f670484a27605a40ef474c247756e33f}",
"{length = 24, bytes = 0x6d999b02e2086640f670484a27605a40a01777914c97e23f}",
"{length = 24, bytes = 0x493dbf68cb8c6740f670484a27605a40b2b27e1fcb90e03f}",
"{length = 24, bytes = 0x2a9b87e80dd06840cc346a73c4a05a402a0dc7148d2ae33f}",
"{length = 24, bytes = 0x0cf94f6850136a404f80cfee9b625b4077e1eade1208e33f}",
"{length = 24, bytes = 0xf0b3ea743f366b40bcadc5fec1445c40538bb556a938e33f}",
"{length = 24, bytes = 0xdb282a9b87186c403ff92a7a99065d40e0d373bbad4ee63f}",
"{length = 24, bytes = 0xc9fa3b4e7cda6c40d762ff6022a85d4049ccc22b4fc7e73f}",
"{length = 24, bytes = 0x3b5889d4f36b6d403072860597aa5e40c7cefa969a66e83f}",
"{length = 24, bytes = 0xb7cc4d01719c6d40f11739c3820b5f40ac55403eec59ed3f}"
)
Edit 3 Note that getting the value in this way:
CGPoint pointValue = CGPointMake(0, 0);
[p getValue:&pointValue];
Works in Debug mode but crashes in Release.
dstays for double. Looking at your debug print it seems those are 3 values in a struct. So those numbers could represent any data type that fits in 8 byte each (8*3=24).If
{?={CGPoint=dd}d}is your describing C String of NSValue then you should be able to do the following decoding as a NSValue extensionAnd yes, NSValues can still be collected in NSArray. Just follow what the C struct description told you.
Ps: not tested code.. Some hints taken from this google search result or read more at NSHipster
Edit: as Rob pointed out..
there are different lists for ObjCType encodings and StringFormat Specifiers
And here the NSValue documentation