• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Object-C question #1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object-C question #1


  • Subject: Re: Object-C question #1
  • From: King Chung Huang <email@hidden>
  • Date: Tue, 07 Dec 2004 21:10:45 -0700

You probably intended to send the parseString: message to yourself. If so, the initWithString: method should probably look something like this:

- (id)initWithString:(NSString *)string {
if (self = [super init]) {
[self parseString:string];
}

return self;
}

King Chung Huang
Learning Commons
University of Calgary

On Dec 7, 2004, at 8:18 PM, Mark Dawson wrote:

I have a Objective-C questions:

I have made a subclass of an NSObject and am getting a "parseString undeclared (first use in this function). If I remove the implementation of "parseString", I get the above error PLUS the error "parseString" implementation not found". What is my problem?

Thanks! Mark

@interface LengthParser : NSObject {
double mLengthValue;
int mErrorCode;
}

- (id)initWithString:(NSString *)aString;
- (int)parseString:(NSString *)aString;
@end

@implementation LengthParser

- (id)initWithString:(NSString *)aString
{
[parseString aString];
return self;
}

- (int)parseString:(NSString *)aString
{
mLengthValue = NAN;
mErrorCode = eLengthSuccess;


return mErrorCode; // never should get here?
}
@end
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Object-C question #1
      • From: Thomas Davie <email@hidden>
References: 
 >Object-C question #1 (From: Mark Dawson <email@hidden>)

  • Prev by Date: [newbie] Cyclic #import
  • Next by Date: Re: [newbie] Cyclic #import
  • Previous by thread: Re: Object-C question #1
  • Next by thread: Re: Object-C question #1
  • Index(es):
    • Date
    • Thread