- Home /
How can we check if PlistElementArray contains a certain string value?
I am doing some plist post processing in Unity for Xcode and I want to avoid adding duplicate elements to a PlistElementArray.
Contains and IndexOf do not work since they require a PlistElement. I also tried
if (elementArray["blah"] == null) {
elementArray.addString("blah")
}
But got: Error building Player: InvalidCastException: Cannot cast from source type to destination type.
Answer by creganjordan292 · Aug 24, 2017 at 11:23 PM
The simplest solution would be to iterate over the whole array and check for a string, if that string is found then you skip, otherwise you add to the array.
Your answer
Follow this Question
Related Questions
PostProcessBuild files fail 2 Answers
PostProcess Build Scripts / GameCenter Capability 0 Answers
U3DXT support for tvOS? 0 Answers
touch of the controls 0 Answers
How do I code sign ios app using xcode ? (For clients) 0 Answers