Re: Feh. Obj-C syntax question
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