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
  • 0 Views
  • 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

How do I get the latest version of my solution recursively like its done
I'm setting up a new development server and want to install the latest version
I just created a new Xcode project. In the AppControl class Header file I
I have problem with BWToolkit and XCode. For some reasons Xcode not recognize bwtoolkit
I have a 3.1 xcode project that has been running my app just fine
I pulled the latest version of three20 from github and installed their template. I
I have multiple versions of Xcode installed. I can build my project against older
In the latest version of WordPress, it gives you the opportunity to view a
After upgrading to the latest version of TortoiseSVN (1.5.2.13595), it's context menu is no
Does the latest version of the enterprise library ( http://msdn.microsoft.com/en-us/library/cc512464.aspx ) come with the

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.