I have the following method:
(void)makeString:(NSString *)str1,... {
va_list strings; NSString *innerText = [[NSString alloc] init]; NSString *tmpStr = [[NSString alloc] init]; if (str1) { va_start(strings, str1); while (tmpStr = va_arg(strings, id)) { innerText = [innerText stringByAppendingString:tmpStr]; } label.text = [str1 stringByAppendingString:innerText]; } [tmpStr release];
}
I will eventually get to Objective C Memory Management reading, where I'm sure I will find the answer to this - probably related to pointers and copying - , but for now, can anyone explain why if I add [innerText release]; as the last line of this function, i get an EXC_BAD_ACCESS error at runtime?