How the Title says - I want to be sure that the object is on the last position but I cant find any functions for NSOrderedSet
. Is it possible to set it simply at data[data.count]
?
NSOrderedSet
is immutable. You'll need NSMutableOrderedSet
, in particular, you'll want to use addObject(_:)
, such as:
data.addObject(myData)
NSOrderedSet
and NSMutableOrderedSet
are both a part of the Foundation framework, and do not conform to the CollectionType protocol, so you cannot use the []
operator like in your question.