Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 为什么Xcode将我的变量值显示为“-”;0对象";?_Objective C_Xcode - Fatal编程技术网

Objective c 为什么Xcode将我的变量值显示为“-”;0对象";?

Objective c 为什么Xcode将我的变量值显示为“-”;0对象";?,objective-c,xcode,Objective C,Xcode,我的对象不是数组,也不是空的。我尝试过使用自动/本地选项,但似乎没有任何效果 TopCode的头文件: @interface TopCode : NSObject { /* Symbol's id code or -1 if invalid */ int code; /* Width of a single ring in pixels */ double unit; /* Angular orientation of the topcode in radian

我的对象不是数组,也不是空的。我尝试过使用自动/本地选项,但似乎没有任何效果

TopCode的头文件:

@interface TopCode : NSObject
{
   /* Symbol's id code or -1 if invalid */
   int code;

   /* Width of a single ring in pixels */
   double unit;

   /* Angular orientation of the topcode in radians */
   double orientation;
}

@property (assign) BOOL used;
@property (assign) double x;
@property (assign) double y;
@property (nonatomic, weak) NSString* string;

- (void)setText;
- (NSString *)description;

-(id) init;
-(double) getCenterX;
-(double) getCenterY;
-(double) getOrientation;
-(int) getCode;
-(void) setCode:(int)c;
-(void) setCenter:(double)cx cy:(double)cy;
-(double) getDiameter;
-(void) setDiameter:(double)d;
-(double) getRadius;
-(void) setRadius:(double)r;
-(BOOL) isValid;
-(BOOL) contains:(double)tx ty:(double)ty;
-(void) draw:(cv::Mat &)image;
-(int) decode:(cv::Mat &)image;
-(NSString *) toJSON;

#define WHEN_CODE 279
#define ENEMY_CODE 205
#define WALL_CODE 157
#define ISCLOSE_CODE 171
#define ISNOTINFRONT_CODE 283
#define ISFAR_CODE 331
#define ISINFRONT_CODE 31
#define MOVE_CODE 211
#define ROTATE_CODE 167
#define RIGHT_CODE 107
#define LEFT_CODE 47
#define FORWARD_CODE 333
#define BACKWARD_CODE 285
#define SHOOT_CODE 213
#define TENINCHES_CODE 109
#define FIVEINCHES_CODE 55
#define TWOINCHES_CODE 339
#define ONEINCH_CODE 295
#define ONEEIGHTYDEGREE_CODE 217
#define NINETYDEGREE_CODE 173
#define FORTYFIVEDEGREE_CODE 115
#define TENDEGREE_CODE 59

@end

问题在于,您在其他文件中将该类名定义为一个列表变量。例如:如果我有一个Subject类,然后我创建了一个NSArray*Subject,那么现在我已经重新定义了符号


将类TopCode重构为TopCodeLink或其他什么,您将解决这个问题。或者找到名为TopCode的NSArray,并将其更改为在这一天丢失了一天。这是XCode调试器中的一个BUG。我使用XCode 6.2。它停止显示对象引用和数据,而只是“0个对象”。使用NSLog检查对象及其值,它们应该是正常的。

唯一能解决此问题的方法是退出并重新启动TopCode类的
XCode

Post.h文件。忽略调试器输出。在控制台中使用NSLog或
po
。我知道我可以只使用po,但我正在寻找更方便的。您想要方便还是正确?最好两者都要?我还试图理解为什么会发生这种情况。我从来没有经历过这样的事情。它起作用了,但问题不断出现!我必须每次更改类名才能看到调试器输出中的值。