what is the syntax to use an object (NSString) that declared in another class?
object workId in class works, i want to use it's value in class jobs.
thanks.
Go here: http://www.cocoadevcentral.com/d/learn_objectivec/
And scroll down to the "Properties" section.
if you declared workId as a property and synthesized it, you should be able to access it using works.workId or [works workId]
If you'd like to hold a pointer to the same object you can declare a second property in the Jobs class using 'assign' or 'retain', if you'd just like a copy you could declare the property using 'copy'.
@property(nonatomic, copy) NSString* theString; If Jobs has a pointer to Works like so:
@interface Jobs { Works* works; } @property (nonatomic, retain) Works* works; @end You could just use self.works.workId to access the work id from within an instance of the Jobs class.
Could you let us know a little more about your particular use case, it would help to determine what you should be doing.