How to declare an array of characters so that all the functions that has been defined inside the class can use it with the updated values.
Getting errors when defining the char data[4096] in the @synthesize definition.
@interface A: NSObject
{
char data[4096];
}
@property(nonatomic,retain)char data;
@end
@implementation A
@synthesize data
@end
I am getting “No declaration of the property ‘pData’ found in the interface”
Not sure why you get that error, but several things are clearly wrong in your code:
datainstance variable and property for it have different types. Property declaration should beYou must use retain attribute only for obj-c types properties, for plain c-types use assign (or don’t specify anything as assign is used by default)
Exposing your pointer to char directly to changes may be not a good idea – better make your property readonly and make special method to change its contents:
P.S. May be consider using
NSString*(orNSMutableString*) instead of char[]?P.P.S. Or if you just store some random byte data consider using NSData/NSMutableData for that. (Thanks @bbum for suggesting that)