user1734792
user1734792

Reputation: 19

Create method for NSString

I want to create a method in Obj C taking a NSString and checking if the string is capitalized. Where do I declare it, another .m file?

Upvotes: 0

Views: 77

Answers (1)

TheAmateurProgrammer
TheAmateurProgrammer

Reputation: 9392

You can make a category for it in the file that will use that method, or another new file if a lot of classes will be using it.

@interface NSString (Capitalized)
-(BOOL)isCapitalized;
@end

Upvotes: 1

Related Questions