Comparing an NSArray of NSStrings with another NSArray of NSStrings - objective-c

I have two NSArrays each containing NSStrings. I need to test whether the two arrays are equal. In this instance, equality means not that the arrays contain the same objects, but that each object returns true for isEqualToString when compared its counterpart. The arrays are also not equal if one contains more items than the other, or the order of the items is different.
Can I assume isEqualToArray won't help me here?
Similarly, I don't see an approach using NSSet that would fulfill all of the criteria.
How might I test the equality of these two arrays?

The docs for isEqualToArray state:
Two arrays have equal contents if they each hold the same number of objects and objects at a given index in each array satisfy the isEqual: test.
That seems like it fits your criteria.

Related

Is there a way to perform arbitrary array spreading in ByteBuddy?

ByteBuddy lets you use the withArgumentArrayElements method to "spread" an array "into" distinct method parameters.
Is there a way to perform this spreading on arbitrary Object arrays, such as those that might be returned from a MethodCall invocation?

Implement insertion-ordered dictionary in objective-c

I want to create a dictionary, similar to NSMutableDictionary, but have it keep the insertion order of the elements. What is the most efficient way to do this?
You can try keeping an NSArray for the dictionary's keys. Each time you insert entry to you dictionary, you will also insert the key to the array. The array will preserve the insertion order, and if you'll want to get the value of the first inserted entry, you can just pull it by asking the value for the first key in the array.
As you know for NSDictionary there is no rules to keep their insertion order. If I make this, I would keep an order with a value in NSArray as a wrapper value.
NSMutableDictionary *mutableDic = #{#"key" : #[val, order]}

Invalid value for implementation data types

How to configure the Invalid Value for implementation data types (Especially for arrays, based on the size of the array we have to create that many array value specifications)??
For a single ImplementationDataType of category ARRAY, you just create one ArrayValueSpecification that contains as many NumericalValueSpecifications as required.

Pull a specific key from an array objective c

in PHP when using an array you can use myArray['firstElement'] to pull that specific key and its associated values from the array. How do I do this similar type of thing in objective c?
If you want to deal with key-value pairs, you would use an NSDictionary.
Although it is surprising to note that arrays in PHP are an ordered map.
You want to use NSDictionary instead of NSArray. NSDictionary is an associative array.

I need a dictionary-like mapping between characters and other kinds of objects. Which class would be best?

This is in Squeak/Pharo. If I want to have a mapping between Character objects like $a and $b to other kinds of objects, and want to look up those other objects based on the Character, what is the best class to use? Dictionary is an obvious choice, but seems wasteful to be hashing character objects which are basically already numbers. I guess what I want is a kind of array where the character value (number) is used as an index/offset, but I am not sure if this is possible with Unicode.
At least the hashing's cheap: Character hash just says "^value".