iOS 字符串问题。一种有效,一种无效,有何作用?
.h
NSString *_maplink;
@property (nonatomic, retain) NSString *mapLink;
从.m 中的
可以看出,
NSString *link = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,+%f&daddr=thatCity+thatState+515+north+state+street", latitude, longitude];
我稍后需要该属性,所以我
mapLink = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,+%f&daddr=thatCity+thatState+515+north+state+street", latitude, longitude];
在
NSLog(@"the map link %@", mapLink);
另一个函数中,并且得到了 ole SIGABRT。
迪莉是什么?
from the .h
NSString *_maplink;
@property (nonatomic, retain) NSString *mapLink;
in the .m
this one is fine
NSString *link = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,+%f&daddr=thatCity+thatState+515+north+state+street", latitude, longitude];
i need the property later so i'm
mapLink = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,+%f&daddr=thatCity+thatState+515+north+state+street", latitude, longitude];
then i
NSLog(@"the map link %@", mapLink);
in a different function and I get the ole SIGABRT.
what's the dilly o?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单地将字符串分配给
mapLink
变量不会保留它。您需要:Simply assigning your string to the
mapLink
variable won't retain it. You need to: