Questions tagged [nsmutableorderedset]

15 questions
13
votes
1 answer

NSMutableOrderedSet to NSMutableArray

array = [NSMutableArray arrayWithArray:[set allObjects]]; This worked with an NSSet, but how do I get it to work with an NSMutableOrderedSet?
8
votes
2 answers

KCOrderedAccessorFix objc_msgSend too many arguments to function call, expected 0, have 2

In Xcode 6 KCOrderedAccessorFix is producing errors on following line: NSMutableOrderedSet *primitive = objc_msgSend(_s, fastPrimitiveGetter) How can I resolve it? Thanks,
Shoaib Ahmad
  • 141
  • 1
  • 9
4
votes
2 answers

How to implement a Mutable Ordered Set generic type formerly known as NSMutableOrderedSet in native Swift?

I am trying to implement a generic Mutable Ordered Set type and it needs to conform to many protocols to behave the same way as an Array and a Set does in Swift. First of all to accomplish that the generic type element needs to conform to Hashable…
Leo Dabus
  • 229,809
  • 59
  • 489
  • 571
2
votes
1 answer

Core Data adding data to relationship in Swift

I'm trying to add this instance of serie to a country via a core-data relation. The only problem is that my NSOrderedSet gets very big and this method of adding gets inefficient because I have to load the whole NSOrderedSetthat already exists (way…
sloeberGJ
  • 355
  • 3
  • 13
1
vote
2 answers

How to check my NSString is exist in my NSMutableOrderedSet?

I am getting below response from the one of the third party SDK, Now how to check that my String value is exist in the response? And the key I need to compare with friendlyName key. channelList = ( "<: sid: 'CH84',…
1
vote
0 answers

iOS: unexplained -[__NSOrderedSetM removeObjectAtIndex:]: index 0 beyond bounds for empty ordered set

I got -[__NSOrderedSetM removeObjectAtIndex:]: index 0 beyond bounds for empty ordered set in the following code: - (void)moveAdapter:(SUBaseAdapter *)adapter from:(NSMutableOrderedSet *)src to:(NSMutableOrderedSet…
Yotam
  • 9,789
  • 13
  • 47
  • 68
1
vote
1 answer

Swift: Core data trouble with to-many relationship and mutableOrderedSetValueForKey

I'm having trouble understanding why my ordered set is only saving 1 entry. my code is as follows: let newInovice = NSEntityDescription.insertNewObjectForEntityForName("Invoice", inManagedObjectContext: managedObjectContext) as! InvoiceMO let…
1
vote
1 answer

how to initialize a NSMutableOrderedSet

Can someone show me how to initialize an NSMutableOrderedSet? I tried the following NSMutableOrderedSet *answerSet = [NSMutableOrderedSet orderedSet]; but hang there an the log is just (lldb) will insert object Answer #import "Answer.h" #import…
Mark Thien
  • 1,108
  • 2
  • 22
  • 35
1
vote
1 answer

Changing order of NSMutableOrderedSet CoreData relationship

I am trying to replace objects in a many to one ordered CoreData relationship... My code is here: NSMutableOrderedSet *battingLineUpTemp = [battingOrderToChange.battingOrder mutableCopy]; NSUInteger newBatsmanIndex = 0; NSLog(@"Original…
simonthumper
  • 1,834
  • 2
  • 22
  • 44
0
votes
1 answer

how do I sort an NSMutableSet in Swift?

I am trying to use a NSMutableOrderedSet to store some data, but I would like to sort the set by a specific attribute. I tried to look online on how to use the sort(comparator cmptr: (Any, Any) -> ComparisonResult) function of the…
Ace
  • 603
  • 2
  • 15
  • 33
0
votes
0 answers

NSMutableOrderedSet function "contains(_ object: Any)" does not always call the object's isEqual method

var entries:NSMutableOrderedSet //contains DataEntry objects I'm adding seven objects to this ordered set using this function: func dataAssignment(data: Any) { if let dict = data as? [String:DataEntry] { …
johnnyMac
  • 381
  • 2
  • 14
0
votes
0 answers

Prevent adding duplicate item to a NSMutableOrderedSet

Add new array (addObjectFromArray) to NSMutableOrederedSet, how to check if the NSMutableOrederset already has an existing copy of item/items and no duplication happens? Code : Alamofire.request(.GET, jsonUrl).responseJSON(){ (_,…
moz ado
  • 490
  • 4
  • 17
0
votes
3 answers

NSMutableOrderedSet addObject not ordered

I have an NSMutableOrderedSet which contains NSDate objects. Initially, here are the values: 2014-10-08 12:46:48 +0000 2014-10-08 12:46:42 +0000 After calling addObject with 2014-10-08 12:45:40 +0000, I get the following output: 2014-10-08 12:46:42…
Lord Zsolt
  • 6,492
  • 9
  • 46
  • 76
0
votes
1 answer

Is it possible to save a NSMutableOrderedSet to a NSData attribute in a NSManagedObject subclass?

I have a NSMutableOrderedSet property named currentSongsList on a NSObject subclass. I have a NSData property named currentSongsList on a NSManagedObject subclass. I want to archive the NSMutableOrderedSet property into the database, so that it can…
Carl Smith
  • 1,236
  • 15
  • 18
0
votes
0 answers

UITableView cell rearranging array trouble

i have a UITableView that a user can add and rearrange objects in... when the user moves an item, i try to re-arrange the data array to fit what the user has changed his cell order to... i am obviously not doing it correctly... here is my code -…