objective c - Expected specifier-qualifier-list before 'string' -


with latest version of xcode apple, have following problem.

upon launching, , starting new project, no matter project, error.

let's build "mac os x command line tool" of type "foundation".

then, add new class, go file > add file > cocoa class > objective-c class (subclass of nsobject).

next, in .h file of new class created, replace following code:

// //  newclass.h //  untitled //  #import <cocoa/cocoa.h>   @interface newclass : nsobject {     string username; }  @property string username;  @end 

and implementation following code:

// //  newclass.m //  untitled //  #import "newclass.h"   @implementation newclass  @synthesize username;  @end 

and click "build & run" following errors occur:

newclass.h:11: error: expected specifier-qualifier-list before 'string'


newclass.h:14: error: expected specifier-qualifier-list before 'string'


newclass.m:11: error: no declaration of property 'username' found in interface

what doing wrong? i've looked similar previous questions , have had fact there have been missing or incorrect inputs far can tell.

i can't seem find out how mine relate considering new project.

i think you're looking nsstring *. string c++ class , objective-c not c++.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -