头文件:
@interface Picker : UITableViewController <NSXMLParserDelegate> {
NSMutableString *currentRow;
}
@property (nonatomic, retain) NSMutableString *currentRow;
@end
实施文件:
#import "Picker.h"
@implementation Picker
@synthesize currentRow;
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
currentRow = [[NSMutableString alloc] initWithString:@"VehicleYear"];
}
return self;
}
@end
在调试这个并进入 currentRow 用字符串初始化的地方之后。跳过该语句,然后将鼠标悬停在 currentRow 上,值显示“无效摘要”。似乎它得到了一个指针,因为我得到了一个地址引用,比如 0x33112 而不是实际的内存引用。无论我做什么,我都无法在这个属性中得到一个有效的字符串,所以我所有的比较都失败了。我究竟做错了什么?