Int property in class definition

Posted by Daniel I-S on Stack Overflow See other posts from Stack Overflow or by Daniel I-S
Published on 2010-04-24T22:56:12Z Indexed on 2010/04/24 23:03 UTC
Read the original article Hit count: 164

Filed under:
|

I have the following class structure for custom UITableViewCells:

NumericEntryCell - Contains method for controlling max value that can be entered into a textbox.

SliderCell - inherits from NEC and contains methods for handling slider-control of textbox value

TextOnlyCell - just contains a textbox

CellA - inherits from SliderCell and has a max value of 28

CellB - inherits from TextOnlyCell and has a max value of 150.

I want NumericEntryCell to contain a definition for a property that contains the maxValue. I want to be able to set a value for this in the initialize method of a child class (CellA or CellB).

Currently I have an int maxValue declared in the interface of NEC. I declare a property for this with @property int maxValue and @synthesize it within the .m file. However, attempting to modify this property's value from CellA or CellB's initialize method has no effect - when I hit a breakpoint in the NEC method that uses this value, its value is always zero. How can I get this to work?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c