Search Results

Search found 1385 results on 56 pages for 'uitableview'.

Page 5/56 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Passing data back from detailViewController to Uitableview

    - by jsetting32
    I am currently at the issue where I have a UITableviewCell that needs to be updated. When the user presses on the uitableviewcell - THERES ONLY 1!!, the user is pushed to a UITABLEVIEWCONTROLLER where the user is allowed to select 1 of multiple cells with their own titles. I need to get the clicked tableviewcells title and pass the value back to the parentviewcontroller and update the 1 tableviewcell's name to the one the user clicked in the pushed uitableivewcontroller. Here is a picture of the parent viewcontroller... And heres the picture of the pushed viewcontroller.... I was told earlier yesterday that delegation would be needed but I am unsure what to do at this point :/. Heres some code I use in the parent viewcontroller... - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; ProblemTypes *view = [[ProblemTypes alloc] init]; [self.navigationController pushViewController:view animated:YES]; } I am also NOT USING storyboards, just a few xibs. Also heres the code for the pushedviewcontroller to pop to the parent viewcontroller when a cell is selected... #pragma mark - Table view delegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; NSLog(@"Cell's text: %@",cell.textLabel.text); [self.navigationController popViewControllerAnimated:YES]; } Thank you guys!

    Read the article

  • My UITableView has duplicated rows

    - by Mark
    Im not sure why, but my UITableView, which isnt anything fancy, is showing repeating rows when it shouldnt be. It seems that the rows that get added when the user scrolls (i.e. the rows that are off the screen to start with) are getting the data for the wrong row index. Its almost like when a new cell is de-queued, it's using a cell that 'was' used, but wasn't cleaned up correctly. Do you need to 'clean up' cells that are de-queue so that new cells dont use cells that are already created? my code is as below: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CustomCellIdentifier = @"CustomCellIdentifier"; MyDayCell *cell = (MyDayCell *)[tableView dequeueReusableCellWithIdentifier: CustomCellIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"MyDayCell" owner:self options:nil]; for (id oneObject in nib) if ([oneObject isKindOfClass:[MyDayCell class]]) cell = (MyDayCell *)oneObject; } NSUInteger section = [indexPath section]; NSUInteger row = [indexPath row]; NSArray *thisSectionItems = (NSArray*)[self.listData objectForKey: [[NSNumber alloc] initWithInt:section]]; MyDayDetails *rowData = [thisSectionItems objectAtIndex:row]; //setup my cells data here... return cell; } Is there anything wrong with this code? has anyone seen anything like this before?

    Read the article

  • UITableView not getting populated with sqlite database column

    - by Ingila Ejaz
    Here's the code of a method I used to populate UITableView with the contents of a column in sqlite database. However, this is giving no errors at run-time but still does not give any data in UITableView. If anyone could help, it'll be highly appreciated. - (void)viewDidLoad{ [super viewDidLoad]; self.title = @"Strings List"; UITableViewCell *cell; NSString *docsDir; NSArray *dirPaths; sqlite3_stmt *statement; // Get the documents directory dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); docsDir = [dirPaths objectAtIndex:0]; // Build the path to the database file databasePath = [[NSString alloc]initWithString: [docsDir stringByAppendingPathComponent:@"strings.sqlite"]]; NSFileManager *filemgr = [NSFileManager defaultManager]; if ([filemgr fileExistsAtPath: databasePath ] == NO) { const char *dbpath = [databasePath UTF8String]; if (sqlite3_open(dbpath, &contactDB) == SQLITE_OK) { NSString * query = @"SELECT string FROM strings"; const char * stmt = [query UTF8String]; if (sqlite3_prepare_v2(contactDB, stmt, -1,&statement, NULL)==SQLITE_OK){ if (sqlite3_step(statement) == SQLITE_ROW) { NSString *string = [[NSString alloc]initWithUTF8String:(const char*)sqlite3_column_text(statement, 0)]; cell.textLabel.text = string; } } else NSLog(@"Failed"); sqlite3_finalize(statement); } sqlite3_close(contactDB); } }

    Read the article

  • NSInvalidArgumentException accessing NSMutableArray in a UITableView

    - by kashar28
    Hello, I am a noob in iPhone programming so kindly guide me. I have 5 buttons in a custom UITableViewCell. Following is the code to determine which button was pressed. In ProductTableCustomCell.m -(IBAction) getRating:(id) sender { ProductTableView *ptv = (ProductTableView *)self.superview; if((UIButton *) sender == box1) { [ptv.totalComments addObject:@"BOX2"]; } else if((UIButton *) sender == box2){ NSLog(@"Box2"); [ptv.totalComments addObject:@"BOX2"]; NSLog(@"Am I here?"); }else if((UIButton *) sender == box3){ NSLog(@"Box3"); [ptv.totalComments addObject:@"BOX3"]; }else if((UIButton *) sender == box4){ NSLog(@"Box4"); [ptv.totalComments addObject:@"BOX4"]; }else if((UIButton *) sender == box5){ NSLog(@"Box5"); [ptv.totalComments addObject:@"BOX5"]; } } Here totalComments is a NSMutableArray in ProductTableView which is a UITableView. If for example I click button2, then I get the following error: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[UITableView totalComments]: unrecognized selector sent to instance 0x4036e00'** I don't understand the problem. I have double checked the IBOutlets and IBActions as well. Everything seems proper. I think the problem is in the superview.Any help would be appreciated.

    Read the article

  • UITableView's NSString memory leak on iphone when encoding with NSUTF8StringEncoding

    - by vince
    my UITableView have serious memory leak problem only when the NSString is NOT encoding with NSASCIIStringEncoding. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"cell"; UILabel *textLabel1; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; textLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(105, 6, 192, 22)]; textLabel1.tag = 1; textLabel1.textColor = [UIColor whiteColor]; textLabel1.backgroundColor = [UIColor blackColor]; textLabel1.numberOfLines = 1; textLabel1.adjustsFontSizeToFitWidth = NO; [textLabel1 setFont:[UIFont boldSystemFontOfSize:19]]; [cell.contentView addSubview:textLabel1]; [textLabel1 release]; } else { textLabel1 = (UILabel *)[cell.contentView viewWithTag:1]; } NSDictionary *tmpDict = [listOfInfo objectForKey:[NSString stringWithFormat:@"%@",indexPath.row]]; textLabel1.text = [tmpDict objectForKey:@"name"]; return cell; } -(void) readDatabase { NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDir = [documentPaths objectAtIndex:0]; databasePath = [documentsDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",myDB]]; sqlite3 *database; if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { const char sqlStatement = [[NSString stringWithFormat:@"select id,name from %@ order by orderid",myTable] UTF8String]; sqlite3_stmt *compiledStatement; if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) { while(sqlite3_step(compiledStatement) == SQLITE_ROW) { NSString *tmpid = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)]; NSString *tmpname = [NSString stringWithCString:(const char *)sqlite3_column_text(compiledStatement, 1) encoding:NSUTF8StringEncoding]; [listOfInfo setObject:[[NSMutableDictionary alloc] init] forKey:tmpid]; [[listOfInfo objectForKey:tmpid] setObject:[NSString stringWithFormat:@"%@", tmpname] forKey:@"name"]; } } sqlite3_finalize(compiledStatement); debugNSLog(@"sqlite closing"); } sqlite3_close(database); } when i change the line NSString *tmpname = [NSString stringWithCString:(const char *)sqlite3_column_text(compiledStatement, 1) encoding:NSUTF8StringEncoding]; to NSString *tmpname = [NSString stringWithCString:(const char *)sqlite3_column_text(compiledStatement, 1) encoding:NSASCIIStringEncoding]; the memory leak is gone i tried NSString stringWithUTF8String and it still leak. i've also tried: NSData *dtmpname = [NSData dataWithBytes:sqlite3_column_blob(compiledStatement, 1) length:sqlite3_column_bytes(compiledStatement, 1)]; NSString *tmpname = [[[NSString alloc] initWithData:dtmpname encoding:NSUTF8StringEncoding] autorelease]; and the problem remains, the leak occur when u start scrolling the tableview. i've actually tried other encoding and it seems that only NSASCIIStringEncoding works(no memory leak) any idea how to get rid of this problem?

    Read the article

  • iphone segmented control and uitableview

    - by Emma
    I have a UITableView with a segmented control at the top. When you tap on the different segments, I want the table to reload with a new different sized array. I have tried everything including [self.tableView reloadData]. When you click on a different tab now, it only changes the cells that are out of view and does not add any more. Any ideas??? Thanks.

    Read the article

  • Difference of 2 NSArray's for animated insert/delete in UITableView

    - by Alexander Cohen
    At some point in my Application, I have an NSArray whose contents change. Those contents are shown in a UITableView. I'm trying to find a way to find the diff between the contents of before and after of the NSArray so i can pass the correct indexPaths to insertRowsAtIndexPaths:withRowAnimation: and deleteRowsAtIndexPaths:withRowAnimation: in order to have the changes nicely animated. Any ideas? thx

    Read the article

  • Select First Row as default in UITableView [Urgent]

    - by tushar
    hi , ihave application that is viewbased and i am adding tableview as subview to main view and i have taken UITableViewDelegate to respond the table methods everything is working fine but i want to select first row or UITableView as default selected(Highlighted) plz help me if possible then send me sample code and where i have to place that code means in which method or event Thanks In Advance

    Read the article

  • UITableView section index overlaps search bar

    - by Snej
    Hi: I want to display a section index in an UITableView with a search bar in the table view header (not section header). But the index strip is now overlapping the search bar. Is there an elegant solution to avoid this and let the index start below the table header?

    Read the article

  • Handling empty UITableView in UITableViewController

    - by Travis
    I have a UITableViewController that is populated with some data. If the data comes back empty, obviously the table is empty. What is the appropriate method to use to handle this case and put up something like a UILabel with "No Data Available". I have been using - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section but it's proven a bit cumbersome and I'm not longer confident it's the best place to do this.

    Read the article

  • UITableView not rotating even after using autoresize mask and shouldAutororateForInterfaceOrientatio

    - by Amal
    I have a UIView, that contains a navigation bar, and UITableView. I implemented a UIViewController that implements a UITableViewDelegate. I over-rided the shouldAutorotateForInterfaceOrientation for the UIView to return YES for landscape and portrait mode. But the View does not seem to rotate. I did a similar thing without the Navigation bar and the Tableview and the view rotates. Is is something i am missing.

    Read the article

  • Optimizing UITableView

    - by Daniel Granger
    I have a UITableview made up with a custom cell loaded from a nib. This custom cell has 9 UILabel s and thats all. When scrolling the table on my iPhone the tables scrolling motion is slightly jerky, its not as smooth as other tableviews! (On the simulator it scrolls fine but I guess its using the extra power of my mac) Are there any tips to help optimize this or any tableview or methods to help find the bottleneck. Many Thanks

    Read the article

  • UITableView Header View Scrolls

    - by Jim Bonner
    I am using a header view, not section header, with my UITableView. The documentation says that the header view sits on top of the table, but my header view scrolls just like a normal row. Is there a way to make the header view always visible at the top of the table?

    Read the article

  • iPhone: UITableView with custom cells for settings

    - by Nic Hubbard
    I want to use a UITableView for my settings screen. So that my settings view will look like apple does it, with a group table view, and then the UI elements to let you change settings. So, it does not seem like the cells are loaded from an array, but seems like each one is customized. Ideas on how to do this?

    Read the article

  • UITableView performance difference between Iphone 3G and 3GS ?

    - by gotye
    Hey guys, I managed to put my new app on an adhoc distribution but I just noticed that I only have 3GS's ... It is working quite good on the 3GS (could be a bit faster but that's fine) ... but do you think I should test it on the 3G ? I know there has been a lot of improvements between 3G and 3GS but would that infer on my uitableview performance ? Thanks, Gotye.

    Read the article

  • How to create a right to left UITableView?

    - by embedded
    Hi, I want to create a right to left UITableView. right now I have the left to right table view. I would like to know if there is an easy way to transfrom the left to right table into right to left using the latest iphone SDK? I've tried the textAlignment on my custom table view cell but with no success. Thanks

    Read the article

  • UITableView in popover doesn't stop scrolling

    - by igul222
    I have a UITableView being shown in a popover. One cell in my table view has a UITextField in it. When the text field is being edited (the keyboard is visible) and I rotate the device from portrait to landscape and then try to scroll the table view, it keeps going past its bounds, instead of stopping and "bouncing". Does anyone know how to fix this?

    Read the article

  • UITableView less than full screen from code?

    - by Gerry
    I have a number of views that use UITableView. (I use UIViewController and implement UITableViewDelegate and UITableViewDataSource interfaces.) I'm having trouble creating a tableview that leaves room at the top for a toolbar. How to I size and layout the Tableview so that it is less than full screen? Is this an AutoResizing mask problem? Thanks, Gerry

    Read the article

  • UITableView: block cell dragging during reordering

    - by Luca
    Hi I've a problem with UITableView. When I'm in editing mode i want to reorder the cell but e when I drag a cell at the bottom of the screen it's allowed to go down as much as the TableView height and down the last tableViewCell. I've only 4 cell and i want that when Im dragging a cell it's not allowed to go down after the fourth cell. Can Anyone help me?!?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >