Xcode help- incomplete implementation.

This is a discussion on Xcode help- incomplete implementation. within the C++ Programming forums, part of the General Programming Boards category; im supposed to be creating two objects in xcode and i cant for the life of me find where my ...

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    14

    Xcode help- incomplete implementation.

    im supposed to be creating two objects in xcode and i cant for the life of me find where my aCar is incomplete implementation.
    Code:
    //
    //  aCar.m
    //  carObject
    //
    //  Created by Nicholas Smith on 9/26/12.
    //  Copyright (c) 2012 Nicholas Smith. All rights reserved.
    //
    
    
    #import "aCar.h"
    
    
    @implementation aCar
    
    
    
    
    -(void) setColor:(NSString *)aColor
    {
     color=aColor;
    }
    -(NSString *) color
    {
     return color;
    }
    
    
    -(void) setModel:(NSString *)aModel
    {
     model=aModel;
    }
    -(NSString *) model
    {
     return model;
    }
    
    
    
    
    -(void) setYear:(NSString *)aYear
    {
     year=aYear;
    }
    -(NSString *) year
    {
     return year;
    }
    
    
    
    
    -(void) setYearsOwned:(int)aYearsOwned
    {
     yearsOwned=aYearsOwned;
    }
    -(int) yearsOwned
    {
    returnyearsOwned;
    }
    
    
    
    
    
    
    -(void) setNumOfOwners:(int)aNumOfOwners
    {
     numOfOwners=aNumOfOwners;
    }
    -(int) numOfOwners
    {
    returnnumOfOwners;
    }
    
    
    
    
    
    
    @end
    
    
    //
    //  aCar.h
    //  carObject
    //
    //  Created by Nicholas Smith on 9/26/12.
    //  Copyright (c) 2012 Nicholas Smith. All rights reserved.
    //
    
    //acar.h
    #import <foundation/foundation.h>
    @interface aCar: NSObject
    {
     NSString * company;
     NSString * model;
     NSString * color;
     NSString * year;
     int yearsOwned;
     int numOfOwners;
    }
    -(void) setCompany:(NSString *)aCompany;
    -(NSString *) company;
    
    
    -(void) setModel:(NSString *)aModel;
    -(NSString *) model;
    
    
    -(void) setColor:(NSString *)aColor;
    -(NSString *) color;
    
    
    -(void) setYear:(NSString *)aYear;
    -(NSString *) Year;
    
    
    -(void) setYearsOwned:(int)aYearsOwned;
    -(int) yearsOwned;
    
    
    -(void) setNumOfOwners:(int)aNumOfOwners;
    -(int) numOfOwners;
    
    
    @end
    
    
    // main.c
    #import <Foundation/Foundation.h>
    #import "aCar.h"
    
    
    int main(int argc, const char * argv[])
    {
        @autoreleasepool
        {
            aCar * c1=[[aCar alloc]init];
    
            [c1 setCompany:@"toyota"];
            [c1 setModel:@"hybrid"];
            [c1 setColor:@"green"];
            [c1 setYear:@"1990"];
            [c1 setYearsOwned:22];
            [c1 setNumOfOwners:1];
            NSLog(@"The company for this car is %@",[c1 company]);
            NSLog(@"The model is %@",[c1 model]);
            NSLog(@"The car is %@",[c1 color]);
            NSLog(@"the year is %@",[c1 year]);
            NSLog(@"How many years owned:%d",[c1 yearsOwned]);
            NSLog(@"This car has had %d owner.",[c1 numOfOwners]);
    
    
    
            }
     return 0;
    }



    Last edited by dstrain42; 09-26-2012 at 07:48 PM.

  2. #2
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,147
    O_o

    That isn't C++; that is Objective C.

    You'll get a lot more help if you post at a forum that does Objective C.

    Soma

  3. #3
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,648
    Where is your implementation of setCompany? Hence the error "incomplete implementation"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with Xcode
    By Zach Sisk in forum C++ Programming
    Replies: 2
    Last Post: 09-26-2012, 05:29 AM
  2. C Code in Xcode
    By rmcinnes in forum C Programming
    Replies: 2
    Last Post: 04-11-2011, 07:27 AM
  3. difference between IDE and SDK (VS and Xcode)
    By c_lady in forum Tech Board
    Replies: 4
    Last Post: 05-14-2010, 06:19 PM
  4. getline under Xcode on a Mac
    By Dino in forum C++ Programming
    Replies: 7
    Last Post: 12-26-2009, 10:37 AM
  5. mac os x xcode
    By magus2500x in forum C++ Programming
    Replies: 2
    Last Post: 11-02-2005, 11:12 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21