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";  

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;    
}    
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.