Here a short example for what you can do:
The Custom Class
@interface ITYourCustomClass : NSObject
@property (strong) NSString *title;
- (void)doSomethingWithTheTitle;
@end
@implementation ITYourCustomClass
- (void)doSomethingWithTheTitle {
NSLog(@"Here's my title: %@", self.title);
}
@end
Using it
@implementation ITAppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
ITYourCustomClass *objectOfYourCustomClass = [[ITYourCustomClass alloc] init];
[objectOfYourCustomClass doSomethingWithTheTitle];
}
@end
Class and object methods
Declaring a method with + means, that you can call the method directly on a class.
Like you did it with [myClass1 setLabel:@"something"];
.
This doesn't make sense. What you want, is creating a property.
A property is saved in an object, so you can create an object ITYourCustomClass *objectOfYourCustomClass = [[ITYourCustomClass alloc] init];
and setting the properties objectOfYourCustomClass.title = @"something"
. Then you can call [objectOfYourCustomClass doSomethingWithTheTitle];
, which is a public object method.