Evgeniy Kleban
Evgeniy Kleban

Reputation: 6975

Add class to other as property

I want to add my custom NSObject class to other as property, is that possible?

Class look like this:

@interface PlaceHolder : NSObject

@property (strong, nonatomic) NSString *name;
@property (strong, nonatomic) NSString *description;
@property (strong, nonatomic) NSString *webPage;

I want to make it property of my other class to initialize it once, and then work with properties - name, description. webpage and other..

Do i need to create a category? Or there is another way to achieve this?

Any advice would be appreciated, thank you.

Upvotes: 0

Views: 28

Answers (1)

Gal Marom
Gal Marom

Reputation: 8629

Just add a property to the class that needs to use it

 @property (strong, nonatomic) PlaceHolder *placeHolder;

Upvotes: 1

Related Questions