You cannot directly encode the pointer, because when you unload objects, the value of the pointer will be completely different. I mean, you can save it using
encodeValueOfObjCType:@encode(id) at:&m_pFarmer
, ; , , .
Barn Farmer, Barn ; Farmer, . , Barn .
- Farmer, ? Barn findMyFarmer, FarmerOwner , . (, farmerID ivar Farmer?). -[NSObject awakeAfterUsingCoder:(NSCoder *)] Barn, .
, . documentation , , .
NSArchiver NSKeyedArchiver , ( encodeConditionalObject:), , - . " .". , Farmer , , Barn - , .
, .