0

Hello I am getting this error:
error: expected '=',',',';', 'asm' or 'attribute' before '.' token

I am not sure what is causing it, it's probably something stupid which I have over looked, here is the problem code.
This is a mac app btw

DataClass *obj=[DataClass getInstance];  
obj.str= @"test";  

Edited by testingcore99

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by testingcore99
0

Here is the relevant header and main as well.

//DataClass.h

@interface DataClass : NSObject {    

NSString *str;     

}    
@property(nonatomic,retain)NSString *str;    
+(DataClass*)getInstance;    
@end  

//DataClass.m

@implementation DataClass    
@synthesize str;    
static DataClass *instance =nil;    
+(DataClass *)getInstance    
{    
    @synchronized(self)    
    {    
        if(instance==nil)    
        {    

            instance= [DataClass new];    
        }    
    }    
    return instance;    
}    
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.