
I am confused with the memory management issue in iPhone. I do not know which variable need to release?

I guess you need to release variables only which you assign using alloc.
For eg:
// string1 will be released automatically
NSString* string1 = [NSString string];
// must release this when done
NSString* string2 = [[NSString alloc] init];
[string2 release];
Hope it helps,
-Dinny