Hello there,
I have some problems concerned retain, release problem. I understand well what those 2 do. But, when I write some code, a really funny situation appear. Actually I write 2 little projects to try out these methods, one run normally
And one project acted funny.
On the first line where I create an object, init is called and print out retain count, which is :
I dont understand why it run like that. Retain count didnt even decrease when release method was called.
I attached my code below, so please check it out.
I have some problems concerned retain, release problem. I understand well what those 2 do. But, when I write some code, a really funny situation appear. Actually I write 2 little projects to try out these methods, one run normally
Code:
2012-11-21 10:44:25.472 RetainRelease[1352:a0f] init:retain count of 1
2012-11-21 10:44:25.475 RetainRelease[1352:a0f] Count : 2
2012-11-21 10:44:25.476 RetainRelease[1352:a0f] Count : 1
2012-11-21 10:44:25.476 RetainRelease[1352:a0f] dealloc called. Delete
And one project acted funny.
On the first line where I create an object, init is called and print out retain count, which is :
Code:
2012-11-21 10:34:51.691 HelloObjC[1274:a0f] init: Retain count of 57568
2012-11-21 10:34:51.694 HelloObjC[1274:a0f] Count : 57568
2012-11-21 10:34:51.694 HelloObjC[1274:a0f] Count : 57568
2012-11-21 10:34:51.695 HelloObjC[1274:a0f] Count : 57568
2012-11-21 10:34:51.695 HelloObjC[1274:a0f] Count : 57568
2012-11-21 10:34:51.696 HelloObjC[1274:a0f] Count : 57568
2012-11-21 10:34:51.696 HelloObjC[1274:a0f] Count : 57568
2012-11-21 10:34:51.697 HelloObjC[1274:a0f] Count : 57568
2012-11-21 10:34:51.697 HelloObjC[1274:a0f] Count : 57568
I dont understand why it run like that. Retain count didnt even decrease when release method was called.
I attached my code below, so please check it out.