Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3442286
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:39:00+00:00 2026-05-18T08:39:00+00:00

With the latest version of Xcode from Apple, I have the following problem. Upon

  • 0

With the latest version of Xcode from Apple, I have the following problem.

Upon launching, and starting a new project, no matter what the project, I get an error.

Let’s say I would like to build a “Mac OS X Command Line Tool” of type “Foundation”.

Then, to add a new class, I go to File > Add File > Cocoa Class > Objective-C Class (subclass of NSObject).

Next, in the .h file of the new class created, I replace with the following code:

//
//  newclass.h
//  Untitled
//

#import <Cocoa/Cocoa.h>


@interface newclass : NSObject
{
    string userName;
}

@property string userName;

@end

And then the implementation with the following code:

//
//  newclass.m
//  Untitled
//

#import "newclass.h"


@implementation newclass

@synthesize userName;

@end

And then click “Build & Run” the 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 the interface

What am i doing wrong? I’ve looked up similar previous questions and they have all had to do with the fact that there have been missing or incorrect inputs as far as I can tell.

I can’t seem to find out how mine would relate considering everything is from a new project.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:39:01+00:00Added an answer on May 18, 2026 at 8:39 am

    I think you’re looking for NSString *. string is a C++ class and Objective-C is not C++.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running the latest version of XCode, I run into the problem that when I
I'm using mac os lion with the latest xcode version. I installed phonegap from
Has the browser window been removed from the latest version of Xcode? I've seen
Like most, I recently downloaded the latest version of XCode (4.3.1). I've noticed that
I have downloaded the latest varsion of Xcode. All the tutorials i see for
I have installed the latest version of netbeans and its working.. I have opened
I am using the latest version of protobuf-net with VS2008 integration. I have created
I am using the latest version of Xcode(4.2.1) and out of the blue, when
I just created a new Xcode project. In the AppControl class Header file I
I have created a xcode project using unity3d tool, while building the project for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.