【发布时间】:2012-08-16 09:36:04
【问题描述】:
在我的接口头文件中我有:
@proprty (readwrite, assign) float longitude;
如果我像这样为该属性赋值:
loc.longitude = [[NSString stringWithUTF8String:(const char *)attr->children->content] floatValue];
调试器说 [loc longitude] 似乎没有指向有效的对象。
但如果我使用
NSLog(@"%f", [[NSString stringWithUTF8String:(const char *)attr->children->content] floatValue]);
浮点值被写入。
我做错了什么,好像没有将值分配给属性?
【问题讨论】:
标签: iphone objective-c ios properties casting