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 8304965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:58:28+00:00 2026-06-08T17:58:28+00:00

I am new to obj C, and coming from a very good C++ background.

  • 0

I am new to obj C, and coming from a very good C++ background. I started iOS dev, and made a custom object which I use in a View.
This Custom object is

    @interface GameData : NSObject{
    @private
        int Lives;
        ...
        bool isAnswered[5];
    };

    -(int)getLives;
    -(void)LivesPlusOne;
    ...
    -(void)increasePoints:(int)howManyPoints ;
    -(int)getMult;
    ...
    -(void)markAsAnswered:(int)idToRemove; //idToRemove is marked as answered
    -(bool)isMarkedAsAnswered:(int)idToCheck;
    @end

My Problem is that, although XCode recognizes and autocompletes methods like gameData.getLives; and compiles them just OK ( i use #import “GameData.h” ), it does not for methods with a parameter,like:

    -(bool)isMarkedAsAnswered:(int)idToCheck;

which might be the problem? (I already tried deleting derived data (window->organizer->projects->derived data->delete) and nothing changed.

Extra info: I am using the gameData object in a View and i manipulate the “int Lives”ect, via accessors and mutators (getters/setters) and works really fine. When I get to use

    [gameData.isMarkedAsAnswered:someInt] 

I get a build error.

it does not even autocomplete when I type

    [gamedata.i

Thanks in Advance,
Giorgos

  • 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-06-08T17:58:30+00:00Added an answer on June 8, 2026 at 5:58 pm
    [gameData.isMarkedAsAnswered:someInt]
    

    You’re mixing up C++ and Objective-C syntax. You use the dot accessor to refer to declared properties, not methods. Use the following:

    [gameData isMarkedAsAnswered:someInt];
    

    Due to implementation issues, when a method has no arguments, you can call it using the dot accessor, however this is not what it was designed for and you should stop doing so immediately.

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

Sidebar

Related Questions

I'm pretty new to C#/WPF, coming from Obj-c background. I'm not really sure how
I have a script which creates a user-defined object like this: obj = new
Im new to VB. I am coming from a Java background. In the following
I am a new cocoa developer coming from a C#/Java background. I had been
// // To Throw void PrintType(object obj) { if(obj == null) { throw new
private void btnSend_Click(object sender, RoutedEventArgs e) { Button obj=(Button)sender; obj.Content=Cancel; SendImage send = new
I have read a bit about casting in C++. Coming from a C background,
I want to add new obj of JSON like: 128: { Msg: [{ me:
What are the differences between these two codes in JavaScript? var obj = new
Preface : I am new to the iPhone SDK, Obj-C, Interface Builder and Cocoa.

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.