iOS Question NativeObject CreateBlock

stevel05

Expert
Licensed User
Longtime User
I am trying to implement an ArraySort using sortedArrayUsingComparator: with the NativeObject CreateBlock, it doesn't appear that the sub gets called 'immediately' whichever option I choose for the Delayed parameter.

I attach a small example project.

Am I trying to implement this correctly?

Thanks
 

Attachments

  • AS.zip
    2.6 KB · Views: 176

stevel05

Expert
Licensed User
Longtime User
Thanks Erel,

The sub now runs at the correct time, but no matter what the returned values are, the array data is just returned in reverse order. See attached:

Steve
 

Attachments

  • AS1.zip
    2.6 KB · Views: 153
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Thanks Erel,

I had a feeling that would be the case, I did try writing a library to return an NSComparisonResult, but it wouldn't cast to an Object. Presumably because it's part of an Enum. You were correct when you said that Objective C is more complex than Java. I have an awful lot of learning to do.

Now you've implemented SortType in List, I'm sure I can achieve what I wanted using that. It was one of those, do it because you can experiments (or can't in this case). Experimenting is how I learn best.
 
Upvote 0
Top