Newbie question memory and code optimisation?

It is possible not to create separate variable for this. Replace detailsDomaine in second row with your right side of assignment in first row: cell.textLabel. Text = NSString stringWithFormat:@"%@",search_result objectAtIndex:indexPath.

Row valueForKey:@"nom" And no, you don't have to release the detailsDomaine object afterwards since you did not retain it.

It is possible not to create separate variable for this. Replace detailsDomaine in second row with your right side of assignment in first row: cell.textLabel. Text = NSString stringWithFormat:@"%@",search_result objectAtIndex:indexPath.

Row valueForKey:@"nom"; And no, you don't have to release the detailsDomaine object afterwards since you did not retain it.

Krifur If it would be reatained with property then it needs to be nil not release,and if you have allocated it then you can release it and also make it nil after that. – Sabby Jan 19 at 10:22.

No, you don't need to release detailsDomaine because you did not allocate any memory for it or retain it. You could do something like this: cell.textLabel. Text = NSString stringWithFormat:@"%@", search_result objectAtIndex:indexPath.

Row valueForKey:@"nom"; but it's rather ugly.

Thx again again! – krifur Jan 19 at 8:48 right bro...... – Sabby Jan 19 at 10:32.

First of all You do not need to release it ... you can write it also in a single statement like cell.textLabel. Text = NSString stringWithFormat:@"%@",search_result objectAtIndex:indexPath. Row valueForKey:@"nom".

The other answers are correct, let me just add this: What Johnny Grass said is true. It's ugly, i.e. Harder to read.It also won't gain you anything.

The compiler will probably note the excess assignment, and optimize it out. And even if it does, unless this is going to be called 10,000 times in a second, it's not worth optimizing it.

Thx, you just anticipate what I was about to ask! – krifur Jan 19 at 8:54.

This works fine the first time the code runs, but running the changeBackgroundColor mehod again (from a button action) doesn't change the color to red, even though debugging the code clearly shows the method runs as expected. Please could someone explain why the view color doesn't update?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions