views:

29

answers:

2

quick question to the gurus of coding!

What do you advise? should i programmatically draw my textfields, labels, images or should i use IB?

would it make any difference? i have scrolling issues (bit jerky) but not something i cannot live without!

thanks

EDIT: Please, Please gentleman.... get in line for your answers.... NOT all together....

A: 

I would use IB to help maintain the app. Jerky performance is usually a result to memory management issues and not specific to IB. IB just does the object creation and sets common properties, so do it in code, or in IB the end result is the creation of objects and setting of properties.

nolimitsdude
ok thanks. when i run the app with "leaks" i dont get any mem leaks (which is always good). i got a custom cell with variable rows. when it is created it goes through the data as many times as the rows. when user scrolls down and rows are not visible cells are destroyed and created again every time the user scrolls them into view! is this the way it should be done? or is there an another way?
treasure
Look for notes on dequeueReusableCellWithIdentifier: I use that to reuse cells that scroll off screen. Here is a sample in my code. // we only have one kind, so we'll just call it "Cell" static NSString *CellIdentifier = @"Cell"; // try to reuse an off screen cell. if there aren't any, we'll make a new one UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; }
nolimitsdude
thanks nolimitsdude! i m actually using this... i will have a look again in the notes...
treasure
A: 

ok. problem solved. you were right and wrong regarding the IB...

to explain myself:

I was loading my cell from a nib file.

The trick and thanks goes to this site: http://iphoneincubator.com/blog/tag/dequeuereusablecellwithidentifier

i forgot to set my cell identifier to the nib file so i was creating the cells every time they were scrolled off the screen!

so tip!

When you load from nib ALWAYS put the right identifier in the "identifier" place!!!

thanks to nolimitsdude who actually pointed to the right way!!

treasure

related questions