腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
为什么
retainCount
是
0
而
不是
1
?
iphone
、
objective-c
、
memory-management
下面
是
代码。我已经用NSString测试过了,它返回-
1
。但是对于NSMutableArray来说是
0
。NSMutableArray *items = [[NSMutableArray alloc] init]; {/*for(items in items) NSLog(@"%@", items);
浏览 3
提问于2011-03-09
得票数 0
回答已采纳
2
回答
目标C中块的生命周期
objective-c
NSAutoreleasePool alloc] init];
为什么
这段代码能工作呢?顺便说一句,这个片段也能工作: NSLog(@"%ld", [o
浏览 2
提问于2013-08-20
得票数 0
回答已采纳
2
回答
需要关于内存管理的建议
objective-c
、
memory-management
我使用Objective-C大约有一个月了,但遗憾的
是
,我在内存管理方面仍然
是
一个彻头彻尾的笨蛋,所以我需要你的建议。self.navigationController pushViewController:bidView animated:YES]; `[seatsForTableCreated release]; NSLog(@"%i",[seatsForTableCreated
retainCount
])
浏览 0
提问于2011-11-22
得票数 0
回答已采纳
3
回答
为什么
不是
EXC_BAD_ACCESS呢?
ios
、
exc-bad-access
上次发布后
retainCount
应该是
0
,
为什么
不是
呢?NSString *string = [[NSString alloc] initWithFormat:@"test"];
浏览 0
提问于2012-06-16
得票数 1
3
回答
Objective-C的
retainCount
的基本用法
objective-c
、
retaincount
我们都知道retain方法将为+
1
retainCount
,release将为-
1
\f25
retainCount
,如果
retainCount
==为
0
,则对象取消分配。= [[Person alloc] init]; [per
1
release];[per
浏览 4
提问于2014-01-11
得票数 0
2
回答
Objective-C中的内存管理
objective-c
、
memory-management
const *argv[]) SampClass *obj=[[SampClass alloc] init]; NSLog(@"%i", [obj
retainCount
]);}
为什么
retainCount
为
1
,
而
它应该是
0
浏览 1
提问于2010-01-07
得票数 2
回答已采纳
1
回答
调用release,
retainCount
用发行版分析EXC_BAD_ACCESS
objective-c
、
memory-management
、
exc-bad-access
我
是
一个目标C的java程序员,所以请轻点:)- (void)NSLog(@"in before decoding Retain count: %i", [scrn
retainCount
]);// logs retain count of
1
decodingi :
1
retaincount
image
0
浏览 0
提问于2012-02-20
得票数 0
2
回答
@"“和@"123”之间有什么不同?
objective-c
、
ios
当我测试"
retainCount
“方法时,我遇到了一个问题,如下所示:NSString*s_afmt
1
= [[NSString alloc] initWithFormat:@"123"]; //
1
NSLog(@"s_afmt
0
:%d", [s_af
浏览 0
提问于2012-10-31
得票数 0
3
回答
为什么
宏值
是
0
而
不是
1
?
c
、
macros
这里base->left
是
NULL,base->right->height
是
0
以上表达式的结果应该是
1
,有人知道原因吗?这句话
是
怎么来的? #define MAX_PLUS_
1
(a, b) (((a) > (b))
浏览 3
提问于2011-11-02
得票数 2
回答已采纳
4
回答
为什么
打印的
是
1
而
不是
0
?
python
、
python-3.x
、
for-loop
、
nested
当我打印'i‘的值时,我搞不懂
为什么
'
0
’从不打印。
为什么
会这样。 for z in range(i): print([i], end=' ')
浏览 0
提问于2017-04-05
得票数 0
3
回答
保留合成属性的计数
objective-c
、
properties
、
retaincount
]); //
1
/* --> */ NSLog(@"%d", (int)[[objA objB] <
浏览 6
提问于2011-04-26
得票数 0
3
回答
为什么
打破-保留-循环不会像这样陷入无限循环?
ios
、
objective-c
、
memory-management
下面
是
我的代码来验证这个问题。//注意,在B的dealloc中,self
retainCount
仍然
是
1
,
而
不是
0
,
为什么
? 的
retainCount
是
1
。//但是,在我的想象中,它没有递归地进入B的dealloc,
而
只是
浏览 0
提问于2014-04-16
得票数 0
回答已采纳
2
回答
内存管理
objective-c
、
cocoa-touch
、
ios
、
memory-management
、
exc-bad-access
方法removeFromSuperView:
是
如何工作的?当我想要重新启动视图时,我遇到了内存访问错误的问题 if (!:%d", [_mainView
retainCount
]); NSLog(@"
retainCount
:%d", [_mainView
retainCount
//init
retainCount
浏览 6
提问于2011-05-15
得票数 1
回答已采纳
4
回答
此时未拥有的引用计数的不正确递减
ios
、
memory-management
我不明白这个,除非是因为我要释放财产
而
不是
伊瓦尔。有人能解释一下这个问题吗?3 = %d", [dataToBeLoaded_
retainCount
]);每个log语句的保留计数为
0
、
1
、2、
1
。我似乎认为这个警告(在这个问题上)
是
假的,
而
不是
什么值得担心
浏览 2
提问于2012-05-12
得票数 4
回答已采纳
2
回答
为什么
它不会崩溃?
ios
、
objective-c
、
crash
、
exc-bad-access
为什么
循环中的第二行( a.
retainCount
行)不会崩溃(由于访问不佳)?NSArray* a
0
= @[[NSMutableString stringWithString:@"a"]]; [a
0
release];[a
0
release]; { //NSLog(@"%d&qu
浏览 0
提问于2013-07-01
得票数 0
回答已采纳
4
回答
为什么
NSString保留计数为2?
iphone
、
objective-c
、
cocoa-touch
、
nsstring
[NSString stringWithFormat:@"http://%@", kTestingURL]];
为什么
保留计数
是
2
而
不是
1
?
浏览 0
提问于2011-07-26
得票数 4
回答已采纳
4
回答
Objective-C保留问题
objective-c
、
xcode
、
memory
、
memory-management
然而,在切换到另一个视图后,我记录了控制器的保留计数,令我惊讶的
是
,它是
1
而
不是
0
。代码如下:和: [super
浏览 0
提问于2011-04-12
得票数 0
1
回答
为什么
retainCount
会增加?
objective-c
_testObject = [[TestObject alloc] init]; }@property (retain) TestObject*testObject;
为什么
这些NSLog()的输出分别是
浏览 3
提问于2012-02-09
得票数 1
回答已采纳
5
回答
一个alloc,
retainCount
== 2
iphone
、
memory-management
我有一个下面的代码:NSLog(@"%d", [chart
retainCount
]);[Session started at 2011-03-28 11:09:46 +0200.] 2011-03
浏览 1
提问于2011-03-28
得票数 3
回答已采纳
2
回答
块中的
retainCount
显示异常行为
objective-c
、
objective-c-runtime
、
objective-c-blocks
retainCount
]=%lu (after)", [_cancelBlock
retainCount
]);} AsyncOperation-overrideCancelWithBlock-[cancelBlock
retainCount
]=
1
(before) AsyncOperation-overrideCancelWithBlock-[_cancelBlock
retainCount
]=<em
浏览 5
提问于2011-03-08
得票数 1
回答已采纳
点击加载更多
相关
资讯
为什么使用MQTT而不是HTTP?
为什么提到电脑,大家默认是Windows,而不是Mac电脑呢?
为什么AI需要的是角色扮演,而不是象棋和围棋?
你为什么选择WPS,而不是Office?
我为什么选择 Vue 而不是 React?
热门
标签
更多标签
云服务器
ICP备案
对象存储
即时通信 IM
云直播
活动推荐
运营活动
广告
关闭
领券