• 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: Feh. Obj-C syntax question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feh. Obj-C syntax question


  • Subject: Re: Feh. Obj-C syntax question
  • From: Joachim Deelen <email@hidden>
  • Date: Thu, 8 Nov 2007 01:19:58 +0100

This is not the correct Syntax for Properties...

You have to declare them outside of the {} Block

Example:

@interface Converter : NSObject
{
	float mSourceCurrencyAmount;	// Only needed when in 32 Bit Mode
}
@property(readwrite) float mSourceCurrencyAmount;
....
@end

If you are still under 32 Bit, you have to declare a corresponding variable within the {} block. If you are under 64 Bit, you can skip this since the compiler will generate it for you.
Furthermore, if you don't have you own getter and setter within your implementation, you have to use the line:


@implementation Converter

@sythesize mSourceCurrencyAmount;

....

@end

In the implementation of the class.

regards
Joachim




Am 08.11.2007 um 00:42 schrieb Rick Mann:


On Nov 7, 2007, at 3:24 PM, Thomas Davie wrote:

The error means that the compiler found the '@' symbol somewhere it shouldn't be. It probably means something like the last line of your header file has a missing semicolon.

My file is exactly this (between "---" lines):

---
#import <Cocoa/Cocoa.h>


@interface Converter : NSObject { @property(readwrite) float mSourceCurrencyAmount; @property(readwrite) float mRate; }

- (float)		convertCurrency;

@end

---


This file was generated by Xcode, and I added a few newlines here and there, as well as the content.



_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Feh. Obj-C syntax question
      • From: Rick Mann <email@hidden>
References: 
 >Feh. Obj-C syntax question (From: Rick Mann <email@hidden>)
 >Re: Feh. Obj-C syntax question (From: Thomas Davie <email@hidden>)
 >Re: Feh. Obj-C syntax question (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Feh. Obj-C syntax question
  • Next by Date: Re: Feh. Obj-C syntax question
  • Previous by thread: Re: Feh. Obj-C syntax question
  • Next by thread: Re: Feh. Obj-C syntax question
  • Index(es):
    • Date
    • Thread