Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

moomy

macrumors newbie
Original poster
Apr 28, 2010
28
0
Hi there,

I have a UITableView which is behaving strangely. When I scroll down beyond item 8 (ie off the bottom of the page) The lines between my cells disappear, also the blue highlight bar goes strange. It sticks on line 8 and only highlights later selections briefly.

here is a pic, notice that the fine line between strings disappears, this is scrolled down a bit.



here is the code m file
Code:
#import "MiddleViewController.h"
#import "FinalViewController.h"


@implementation MiddleViewController

@synthesize myList;

#pragma mark -
#pragma mark Table View Data Source Methods

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return myList.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"Cell";
	
    
	

	
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
     cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
		
		
    }
	
	// Configure the cell.
	cell.textLabel.text = [myList objectAtIndex:indexPath.row];
	

	
	
	cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
	
	
	
	

	
	    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
	
	FinalViewController *anotherViewController = [[FinalViewController alloc] initWithNibName:@"FinalViewController" bundle:nil];
	anotherViewController.title = [tableView cellForRowAtIndexPath: indexPath].textLabel.text;
	anotherViewController.myLabel = [NSString stringWithFormat:@"%@", 
									 anotherViewController.title];
	
	
	
	[self.navigationController pushViewController:anotherViewController animated:YES];
	[anotherViewController release];
}

- (void)viewDidLoad {
    [super viewDidLoad];
}


/*
 // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
}
*/

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}


@end

I have looked in a couple of books and at some source code and this seems to be a common way to do it so I'm not quite sure what's missing??


Any help would be amazing. Thanks
 

Attachments

  • IMG_0488.PNG
    IMG_0488.PNG
    45.6 KB · Views: 58

moomy

macrumors newbie
Original poster
Apr 28, 2010
28
0
Hi guys,
tried to delete this as i have worked it out. The issue was in interface builder rather than the code.

not sure how to delete a thread though.

thanks
mooms
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
not sure how to delete a thread though.


You can't. Moderators can but in general only do so if there is a good reason. If you want a moderator to look at deleting the thread report the first post yourself (using the little warning triangle) and explain why you want the thread deleted.
 

moomy

macrumors newbie
Original poster
Apr 28, 2010
28
0
no problem,
just didn't want it clogging up the forum.
:)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.