Program receives SIGABRT when setting an ivar
[[self numSidesBox] setName: @"numSidesBox"];
This line of code receives the SIGABRT signal and i don't know why. numSidesBox is an instance of my subclass of UITextField. I have an NSString ivar that uses the
@property (nonatomic, retain) NSString *name;
way of 开发者_运维知识库creating setters/getters. I have no idea what's causing this problem.
Why not try:
self.numSidesBox.name=@"numSidesbox"
This assumes you have the following in your numSidesBox
header:
@property (nonatomic, retain) NSString*name;
and in your .m:
@synthesize name;
This is just a general idea to get you started and point you in the right direction; you might prefer something other than retain
and will also need your numSidesBox
object similarly synthesized in the current .h/.m to use dot notation on it.
Additionally, just because numSidesBox
has an ivar, does not mean it actually exists in memory. Before you can use it, you have to at some point initialize it with alloc
and init
or a custom or dedicated initializer.
精彩评论