Unable to access object of other class

前端 未结 3 1276
悲哀的现实
悲哀的现实 2020-12-12 06:41

I am accessing object of one class in the another class. But instance variable is Showing null.

This is my code.

fvcObj = [[FirstViewController alloc         


        
3条回答
  •  一生所求
    2020-12-12 07:22

    In header file (*.h) for example:

    @interface MyClass : NSObject
    
    {
        NSString *someString;
    }
    
    @end
    
    @property (nonatomic,retain) someString;
    

    In implementation file (*.m)

    @synthesize someString
    

    This create setter and getter for someString

提交回复
热议问题