Is there a way to check if a set is empty?
NSMutableSet *setEmpty = [[NSMutableSet alloc] init];
// Code to do things...
// Check for empty set?
[setEmpty release];
gary
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use [setEmpty count] to see how many elements are in the set… so:
or
etc…
I didn’t see an explicit ‘isEmpty’ method on http://developer.apple.com/mac/library/documentation/cocoa/Reference/Foundation/Classes/NSSet_Class/Reference/Reference.html but if it exists, go for that instead of checking the count.