No declaration of the property 'pData' found in the interface-Objective C -


how declare array of characters functions has been defined inside class can use updated values.

getting errors when defining char data[4096] in @synthesize definition.

@interface a: nsobject {  char data[4096]; } @property(nonatomic,retain)char data; @end @implementation @synthesize data @end 

i getting "no declaration of property 'pdata' found in interface"

not sure why error, several things wrong in code:

  1. data instance variable , property have different types. property declaration should

    @property(nonatomic) char[4096] data;  
  2. you must use retain attribute obj-c types properties, plain c-types use assign (or don't specify assign used default)

  3. exposing pointer char directly changes may not idea - better make property readonly , make special method change contents:

    @property(nonatomic, readonly) char[4096] data; - (void) changedata:...//some parameters here 

p.s. may consider using nsstring* (or nsmutablestring*) instead of char[]?

p.p.s. or if store random byte data consider using nsdata/nsmutabledata that. (thanks @bbum suggesting that)


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -