Jayson Ong Jayson Ong - 5 months ago 21
iOS Question

Objective-C Remove extra parentheses inside NSArray

I have this Mutable array that has this value

myArray = (
(
"1466759705.37136"
),
(
"1466761980.81194"
),
(
"1466990587.45011"
)


I want to remove the () on each element inside the array and make it like this

innerArrayOfDate = (
"1466759705.37136",

"1466761980.81194",

"1466990587.45011"
)


I tried myArray[0] to see if I will not include the parentheses but it still includes.

myArray[0] = (
"1466759705.37136"
)

Answer

You have array value which is inside of another array.

The value which you want is at 0 index of array so, you need to just add this myArray[0][0] instead of this myArray[0]


myArray[0] = (
        "1466759705.37136"
    )

myArray[0][0] = "1466759705.37136"
Comments