Re: Can you @synthesize simple arrays?
Re: Can you @synthesize simple arrays?
- Subject: Re: Can you @synthesize simple arrays?
- From: "Clark Cox" <email@hidden>
- Date: Mon, 17 Nov 2008 07:20:39 -0800
On Mon, Nov 17, 2008 at 7:14 AM, Greg Robertson <email@hidden> wrote:
> I have a couple of simple ivar arrays:
>
> NSString *myString[4];
> NSInteger myInteger[4];
>
> How can I @synthesize these so I can access them with simple dot notation:
I'm not sure that you can. However, this should get you the interface
that you want:
@interface MyClass :NSObject {
NSString *myString[4];
NSInteger *myInteger[4];
}
@property (readonly) NSString **myString;
@property (readonly) NSInteger *myInteger;
@end
@implementation MyClass
-(NSString**)myString {
return myString;
}
-(NSInteger*)myInteger {
return myInteger;
}
@end
>
> ie. self.myInteger[2] = 100;
>
> I have tried several ways to set them up in the @interface but I keep
> getting compile errors. Could someone show me the proper @property or
> is this not possible?
>
> I would prefer to avoid NSArray if I can.
--
Clark S. Cox III
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden