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

  • Home
  • SEARCH
  • 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 283487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:22:40+00:00 2026-05-12T05:22:40+00:00

Ok, I have this prototype that was written by someone else in C# and

  • 0

Ok, I have this prototype that was written by someone else in C# and I’m trying to put it into Objective-C. Now, I haven’t had any formal experience with C# yet, so I don’t know everything about it yet. I understand what the first three variables are, but I’m running into problems with what the fourth and fifth lines (c_data) are doing. Is the fourth declaring a method and then the fifth defining it or what’s happening? Thanks for your help!

public class c_data {
    public double value;
    public int label;
    public int ID;
    public c_data() { }
    public c_data(double val) {
        value = val;
    }
}
  • 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-12T05:22:40+00:00Added an answer on May 12, 2026 at 5:22 am

    The fourth and fifth lines are constructors in C#. They are the equivalent to [[c_data alloc] init] chains in objective-c. C# allows you to overload constructors based on the parameters they take. This is equivalent to having two different initialization methods in Objective-C:

    @interface CData : NSObject
    {
       double value;
       int label;
       int ID;
    }
    
    @property double value;
    @property int label;
    @property int ID;
    
    -(id) init;
    -(id) initWithValue:(double)value;
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a very simple PrototypeJS class that looks like this: var
I have the below prog Object.prototype.inherit = function(baseConstructor) { this.prototype = (baseConstructor.prototype); this.prototype.constructor =
I have this base type: typeA = function () { }; typeA.prototype = {
This didn't happen until I have added jQuery. function mfunc() {} mfunc.prototype.create = function(value)
I have some simple OO code I've written that I'm playing with: //define a
I have written a PHP script that checks whether a domain is available for
I have this opaque type type_t and a function prototype like foo(type_t *t) and
I have a basic plugin written according the jQuery authoring guide . This plugin
@ref prototype.js I have seen this Prototype.js ajax syntax used everywhere. However I have
I have two Doctrine entities that have a one-to-many relationship, like this: License class

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.