私は機能を持っています:
-(id)initWithCoder:(NSCoder *)decoder
{
self = [super init];
if (self) {
_smID = [[decoder decodeObjectForKey:@"_smID"]intValue];
_link = [decoder decodeObjectForKey:@"_link"];
_trigger = [decoder decodeObjectForKey:@"_trigger"];
_status = [decoder decodeObjectForKey:@"_status"];
_expiration = [[decoder decodeObjectForKey:@"_expiration"]intValue];
_timeFromRegistratio = [[decoder decodeObjectForKey:@"_timeFromRegistratio"]intValue];
_timeFromSubsription = [[decoder decodeObjectForKey:@"_timeFromSubsription"]intValue];
_timeFromLastOpening = [[decoder decodeObjectForKey:@"_timeFromLastOpening"]intValue];
_timeToTrigger = [[decoder decodeObjectForKey:@"_timeToTrigger"]intValue];
}
return self;
}
の前にオブジェクトを印刷するとreturn self;
。しかし、呼び出し元の行に戻ると、オブジェクトは既になくなっています。呼び出し回線は次のとおりです。
SMBase *oldMonkeySurvayRule = [[NSKeyedUnarchiver unarchiveObjectWithData:oldMonkeySurvayRuleData]retain];
このエラーが発生しました:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x60000008
0x0449709b in objc_msgSend ()
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context to what it was before the call.
To change this behavior use "set unwindonsignal off"
Evaluation of the expression containing the function (_NSPrintForDebugger) will be abandoned.
.h は次のとおりです。
@interface SMBase : NSObject{
NSString *_status;
NSString *_trigger;
int _expiration;
int _timeFromRegistratio;
int _timeFromSubsription;
int _timeFromLastOpening;
int _timeToTrigger;
int _smID;
NSString *_link;
}
@property (nonatomic, strong) NSString *status;
@property (nonatomic, strong) NSString *link;
@property (nonatomic, strong) NSString *trigger;
@property (nonatomic,assign)int expiration;
@property (nonatomic,assign)int timeFromRegistratio;
@property (nonatomic,assign)int timeFromSubsription;
@property (nonatomic,assign)int timeFromLastOpening;
@property (nonatomic,assign)int timeToTrigger;
@property (nonatomic,assign)int smID;
リテイニングが足りない?