• 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: mark <email@hidden>
  • Date: Tue, 07 Dec 2004 19:45:59 -0800

Thanks to all who replied--yes, I was using the C++ "implict this".  I knew
there was something I was missingŠ

I also should have added a if (self = [super init]) (I caught it in another
place, but missed it in this one).

Thanks again to all who quickly spotted my coming from C++ newbie mistake!

Mark

> From: Jeff Laing <email@hidden>
> Date: Wed, 08 Dec 2004 14:27:35 +1100
> To: 'Mark Dawson' <email@hidden>
> Subject: RE: Object-C question #1
>
> Your syntax is wrong, you meant to send the parseString: method to yourself.
> ie,
>
> [self parseString:sString];
>
> The syntax is
>
> [receiver message...]
>
> not
>
> [message args...];
>
> C++ programmer, huh?  No such thing as implicit "this->" in Objective-C
>
> -----Original Message-----
> From: Mark Dawson [mailto:email@hidden]
> Sent: Wednesday, December 08, 2004 2:19 PM
> To: email@hidden
> Subject: Object-C question #1
>
>
>
> 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

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