Questions tagged [nsmutableset]

The NSMutableSet class declares the programmatic interface to a mutable, unordered collection of distinct objects.

The NSMutableSet class declares the programmatic interface to an object that manages a mutable set of objects. NSMutableSet provides support for the mathematical concept of a set.

NSMutableSet is “toll-free bridged” with its Core Foundation counterpart, CFMutableSetRef.

Resources:

74 questions
0
votes
1 answer

NSMutableSet respondsToSelector addObject: returning false

I'm having a problem with respondsToSelector with NSMutableSet. I have a program like this: NSArray *arguments = [[NSProcessInfo processInfo] arguments]; theClass = [arguments objectAtIndex: 1]; theMethod = [arguments objectAtIndex: 2]; theArgument…
Lucas Kreutz
  • 369
  • 2
  • 4
  • 12
0
votes
1 answer

Removal of core data object does not nullify all of its relations?

I have an entity called Task which has a to-one relationship with the entities TaskTemplate and Occurrence. Both of these entities have to-many relationships with Tasks. Deletion rules are set to Nullify. Within an Occurrence, I try to remove all…
0
votes
1 answer

Equality of Two NSMutableSets Using Custom Class Attributes

How do you check if two NSMutableSets are equal (same members, same number of members)? My implementation of isEqualToSet does not seem to be working. // members is a NSMutableSet of AUser objects // users is also a NSMutableSet of AUser objects,…
GangstaGraham
  • 8,865
  • 12
  • 42
  • 60
0
votes
2 answers

If any element in setA is in setB

Just a quick question regarding sets in Obj-c. Given two sets: NSMutableSet* a = [NSMutableSet setWithObjects: 1, 2, 3, nil]; NSMutableSet* b = [NSMutableSet setWithObjects: 3, 4, 5, nil]; is there a quick and easy way to determine if any element…
Clev3r
  • 1,568
  • 1
  • 15
  • 28
0
votes
4 answers

Can I create a custom object to be used in NSMutableSet?

I'm new to Objective-C, so please bear with me. I need to create an array (or a set) of name=value pairs with one condition that names can repeat in the set (thus I can't use NSMutableDictionary.) I found out that NSMutableSet seems to be what I…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
0
votes
1 answer

Deleting object in NSMutableSet Core Data

I am having trouble deleting an object in an NSMutableSet using core Data. I am trying to delete a "player" object in the second section of my tableview. I am getting the error; Invalid update: invalid number of rows in section 1. The number of …
Luke
  • 612
  • 1
  • 6
  • 19
0
votes
1 answer

Core Data NSMutable Set trouble

Ok I am trying to grab a NSMutable Set. Yes I have a previous post on this but this is slightly different. I have A player entity and a team entity. It is set up as a one to many relationship... On a different view controller I added players to the…
Luke
  • 612
  • 1
  • 6
  • 19
0
votes
2 answers

IsEqual Method Sent to Deallocated Instance When Trying to Add Object To MutableOrderedSet

I have an NSMutableOrdered set that holds two types of objects (that I created), Pieces and Others. Piece and Other both have their isEqual method overridden like so: Piece: - (BOOL)isEqual:(Piece *)object { if (([title isEqualToString:[object…
Kyle Rosenbluth
  • 1,672
  • 4
  • 22
  • 38
-1
votes
2 answers

Converting NSMutableSet to NSSet

Is there a way to convert NSMutableSet to NSSet? I have tried several methods: moving to an NSArray and the setWithArray; instantiating an NSSet with the contents of the NSMutableSet. The program compiles but I get a run time error. …
Kevin McFadden
  • 337
  • 1
  • 5
  • 23
-1
votes
2 answers

How do I access fields in a NSArray created with a NSMutableSet?

I have a class, called Schedule, with 4 properties in it: @interface Schedule : NSObject { } @property (strong, nonatomic) NSDate *apptStartTime; @property (strong, nonatomic) NSDate *apptEndTime; @property (strong, nonatomic) NSString…
SpokaneDude
  • 4,856
  • 13
  • 64
  • 120
-1
votes
2 answers

How to update a core data object in an NSMutableSet?

I've seen many posts showing how to add or remove core data objects from an NSMutableSet for a "to-many" relationship. However, how do you update an existing one? Specifically, I am displaying a table of objects from the "many" side of a…
Barb
  • 124
  • 7
-2
votes
6 answers

Sorting NSMutableSet

I have to use NSMutableSet to store my string objects. I wan to store them in right order for example from smallest to biggest number: 1 2 3 4 How ever if do this: NSMutableSet *set = [[NSMutableSet alloc] init]; [set addObject:[NSString…
Streetboy
  • 4,351
  • 12
  • 56
  • 101
-2
votes
4 answers

addObject not working with NSMutableSet

I've tried to add an Object to the NSMutableSet but it doesn't work where it perfectly works fine with NSMutableArray. //doesn't Work [arr_NSMutableSet addObject:Object]; NSLog(@"%@",arr_NSMutableSet); // Shows nil //Works fine [arr_NSMutableArray…
Rahul
  • 211
  • 2
  • 18
-3
votes
1 answer

Adding Strings to NsMutableSets

If I have two string objects that both have value "hi", and I add them to an NSMutableSet, are they treated as different objects or not? Thanks a bunch!
billy bob
  • 23
  • 1
1 2 3 4
5