What is the syntax to say
if (object isObjectOfClass Class){ object.color = 1; }
I'm making a map application and i want to say "if this point on the map is a branch of THIS store- set the pin picture as this"
What is the syntax to say
if (object isObjectOfClass Class){ object.color = 1; }
I'm making a map application and i want to say "if this point on the map is a branch of THIS store- set the pin picture as this"
if([myObj isKindOfClass:[MyClass class]]) {
// ...
}
What you're looking for is the NSObject isKindOfClass
method.
if([object isKindOfClass:[ClassName class]) { object.color = 1};