Search Results

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

Page 10/56 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • login using UITableView

    - by EquinoX
    How can I create a login for username/password just like in the skype application? I know it's a grouped table view.. but how can I do that? I searched the site and found the following code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; UILabel *startDtLbl = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 80, 25)]; if (indexPath.row == 0) startDtLbl.text = @"Username"; else { startDtLbl.text = @"Password"; } startDtLbl.backgroundColor = [UIColor clearColor]; [cell.contentView addSubview:startDtLbl]; UITextField *passwordTF = [[UITextField alloc] initWithFrame:CGRectMake(100, 5, 200, 35)]; passwordTF.delegate = self; if (indexPath.row == 0) passwordTF.tag = 0; else { passwordTF.tag = 1; } [cell.contentView addSubview:passwordTF]; } return cell; } When I do: NSString * username = [((UITextField*)[self.view viewWithTag:0]) text]; NSString * password = [((UITextField*)[self.view viewWithTag:1]) text]; it gives me this error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView text]: unrecognized selector sent to instance 0x6c3c600 Why is this?

    Read the article

  • UITableView having one Cell with multiple UITextFields (some of them in one row) scrolling crazy

    - by Allisone
    I have a UITableView (grouped). In that tableview I have several UITableViewCells, some custom with nib, some default. One Cell (custom) with nib has several UITextfields for address information, thus also one row has zip-code and city in one row. When I get the keyboard the tableview size seems to be adjusted automatically (vs. another viewController in the app with just a scrollview where I had to code this functionality on my own) so that i can scroll to the bottom of my tableview (and see it) even though the keyboard is up. That's good. BUT when I click on a textfield the tableview gets either scrolled up, or down, I can't figure out the logic. It seems to be rather random up/down scrolling / contentOffset setting. So I have bound the Editing Did Begin events of the textfields to a function that has this code. - (IBAction)textFieldDidBeginEditing:(UITextField *)textField { CGPoint pt; CGRect rc = [textField bounds]; rc = [textField convertRect:rc toView:self.tableView]; pt = rc.origin; pt.x = 0; [self.tableView setContentOffset:pt animated:YES]; ... } This, well, it seems to work most of the time, BUT it doesn't work if I click the first textfield (the view jumps so that the second row gets to the top and the first row is out of the current visible view frame) AND it also doesn't work if I first select the zip textfield and next the city textfield (both in one row) or vice versa. If I do so, the tableview seems to jump to the (grouped tableview) top of my viewForHeaderInSection(this section with this mentioned cell with all my textfields) What is is going on ? Why is this happening ? How to fix this ? Edit This on the other hand behaves as expected (for the two Textviews wit same origin.y) if (self.tableView.contentOffset.y == pt.y) { pt.y = pt.y + 1; [self.tableView setContentOffset:pt animated:YES]; }else { [self.tableView setContentOffset:pt animated:YES]; } But this is a stupid solution. I wouldn't like to keep it that way. And this also doesn't fix the wrong jumping, when clicking the first textfield at first.

    Read the article

  • Get UITableView to scroll to the selected UITextField and Avoid Being Hidden by Keyboard

    - by Lauren Quantrell
    I have a UITextField in a table view on a UIViewController (not a UITableViewController). If the table view is on a UITableViewController, the table will automatically scroll to the textField being edited to prevent it from being hidden by the keyboard. But on a UIViewController it does not. I have tried for a couple of days reading through multiple ways to try to accomplish this and I cannot get it to work. The closest thing that actually scrolls is: -(void) textFieldDidBeginEditing:(UITextField *)textField { // SUPPOSEDLY Scroll to the current text field CGRect textFieldRect = [textField frame]; [self.wordsTableView scrollRectToVisible:textFieldRect animated:YES]; } However this only scrolls the table to the topmost row. What seems like an easy task has been a couple of days of frustration. I am using the following to construct the tableView cells: - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *identifier = [NSString stringWithFormat: @"%d:%d", [indexPath indexAtPosition: 0], [indexPath indexAtPosition:1]]; UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:identifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease]; cell.accessoryType = UITableViewCellAccessoryNone; UITextField *theTextField = [[UITextField alloc] initWithFrame:CGRectMake(180, 10, 130, 25)]; theTextField.adjustsFontSizeToFitWidth = YES; theTextField.textColor = [UIColor redColor]; theTextField.text = [textFieldArray objectAtIndex:indexPath.row]; theTextField.keyboardType = UIKeyboardTypeDefault; theTextField.returnKeyType = UIReturnKeyDone; theTextField.font = [UIFont boldSystemFontOfSize:14]; theTextField.backgroundColor = [UIColor whiteColor]; theTextField.autocorrectionType = UITextAutocorrectionTypeNo; theTextField.autocapitalizationType = UITextAutocapitalizationTypeNone; theTextField.clearsOnBeginEditing = NO; theTextField.textAlignment = UITextAlignmentLeft; //theTextField.tag = 0; theTextField.tag=indexPath.row; theTextField.delegate = self; theTextField.clearButtonMode = UITextFieldViewModeWhileEditing; [theTextField setEnabled: YES]; [cell addSubview:theTextField]; [theTextField release]; } return cell; } I suspect I can get the tableView to scroll properly if I can somehow pass the indexPath.row in the textFieldDidBeginEditing method? Any help is appreciated.

    Read the article

  • iPhone: Repeating Rows in Each Section of Grouped UITableview

    - by Rank Beginner
    I'm trying to learn how to use the UITableView in conjunction with a SQLite back end. My issue is that I've gotten the table to populate with the records from the database, however I'm having a problem with the section titles. I am not able to figure out the proper set up for this, and I'm repeating all tasks under each section. The table looks like this. The groups field is where I'm trying to pull the section title from. TaskID groups TaskName sched lastCompleted nextCompleted success 1 Household laundry 3 03/19/2010 03/22/2010 y 1 Automotive Change oil 3 03/20/2010 03/23/2010 y In my viewDidLoad Method, I create an array from each column in the table like below. //Create and initialize arrays from table columns //______________________________________________________________________________________ ids =[[NSMutableArray alloc] init]; tasks =[[NSMutableArray alloc] init]; sched =[[NSMutableArray alloc] init]; lastComplete =[[NSMutableArray alloc] init]; nextComplete =[[NSMutableArray alloc] init]; weight =[[NSMutableArray alloc] init]; success =[[NSMutableArray alloc] init]; group =[[NSMutableArray alloc] init]; // Bind them to the data //______________________________________________________________________________________ NSString *query = [NSString stringWithFormat:@"SELECT * FROM Tasks ORDER BY nextComplete "]; sqlite3_stmt *statement; if (sqlite3_prepare_v2( database, [query UTF8String], -1, &statement, nil) == SQLITE_OK) { while (sqlite3_step(statement) == SQLITE_ROW) { [ids addObject:[NSString stringWithFormat:@"%i",(int*) sqlite3_column_int(statement, 0)]]; [group addObject:[NSString stringWithFormat:@"%s",(char*) sqlite3_column_text(statement, 1)]]; [tasks addObject:[NSString stringWithFormat:@"%s",(char*) sqlite3_column_text(statement, 2)]]; [sched addObject:[NSString stringWithFormat:@"%i",(int*) sqlite3_column_int(statement, 3)]]; [lastComplete addObject:[NSString stringWithFormat:@"%s",(char*) sqlite3_column_text(statement, 4)]]; [nextComplete addObject:[NSString stringWithFormat:@"%s",(char*) sqlite3_column_text(statement, 5)]]; [success addObject:[NSString stringWithFormat:@"%s",(char*) sqlite3_column_text(statement, 6)]]; [weight addObject:[NSString stringWithFormat:@"%i",(int*) sqlite3_column_int(statement, 7)]]; } sqlite3_finalize(statement); } In the table method:cellForRowAtIndexPath, I create controls on the fly and set their text properties to objects in the array. Below is a sample, I can provide more but am already working on a book here... :) /create the task label NSString *tmpMessage; tmpMessage = [NSString stringWithFormat:@"%@ every %@ days, for %@ points",[tasks objectAtIndex:indexPath.row],[sched objectAtIndex:indexPath.row],[weight objectAtIndex:indexPath.row]]; CGRect schedLabelRect = CGRectMake(0, 0, 250, 15); UILabel *lblSched = [[UILabel alloc] initWithFrame:schedLabelRect]; lblSched.textAlignment = UITextAlignmentLeft; lblSched.text = tmpMessage; lblSched.font = [UIFont boldSystemFontOfSize:10]; [cell.contentView addSubview: lblSched]; [lblSched release]; My numberOfSectionsInTableView method looks like this // Figure out how many sections there are by a distinct count of the groups field // The groups are entered by user when creating tasks //______________________________________________________________________________________ NSString *groupquery = [NSString stringWithFormat:@"SELECT COUNT(DISTINCT groups) as Sum FROM Tasks"]; int sum; sqlite3_stmt *statement; if (sqlite3_prepare_v2( database, [groupquery UTF8String], -1, &statement, nil) == SQLITE_OK) { while (sqlite3_step(statement) == SQLITE_ROW) { sum = sqlite3_column_int(statement, 0); } sqlite3_finalize(statement); } if (sum=0) { return 1; } return 2; } I know I'm going wrong here but this is all that's in my numberOfRowsInSection method return [ids count];

    Read the article

  • UITableView: Juxtaposing row, header, and footer insertions/deletions

    - by jdandrea
    Consider a very simple UITableView with one of two states. First state: One (overall) table footer One section containing two rows, a section header, and a section footer Second state: No table footer One section containing four rows and no section header/footer In both cases, each row is essentially one of four possible UITableViewCell objects, each containing its own UITextField. We don't even bother with reuse or caching, since we're only dealing with four known cells in this case. They've been created in an accompanying XIB, so we already have them all wired up and ready to go. Now consider we want to toggle between the two states. Sounds easy enough. Let's suppose our view controller's right bar button item provides the toggling support. We'll also track the current state with an ivar and enumeration. To be explicit for a sec, here's how one might go from state 1 to 2. (Presume we handle the bar button item's title as well.) In short, we want to clear out our table's footer view, then insert the third and fourth rows. We batch this inside an update block like so: // Brute forced references to the third and fourth rows in section 0 NSUInteger row02[] = {0, 2}; NSUInteger row03[] = {0, 3}; [self.tableView beginUpdates]; state = tableStateTwo; // 'internal' iVar, not a property self.tableView.tableFooterView = nil; [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObjects: [NSIndexPath indexPathWithIndexes:row02 length:2], [NSIndexPath indexPathWithIndexes:row03 length:2], nil] withRowAnimation:UITableViewRowAnimationFade]; [self.tableView endUpdates]; For the reverse, we want to reassign the table footer view (which, like the cells, is in the XIB ready and waiting), and remove the last two rows: // Use row02 and row03 from earlier snippet [self.tableView beginUpdates]; state = tableStateOne; self.tableView.tableFooterView = theTableFooterView; [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObjects: [NSIndexPath indexPathWithIndexes:row02 length:2], [NSIndexPath indexPathWithIndexes:row03 length:2], nil] withRowAnimation:UITableViewRowAnimationFade]; [self.tableView endUpdates]; Now, when the table asks for rows, it's very cut and dry. The first two cells are the same in both cases. Only the last two appear/disappear depending on the state. The state ivar is consulted when the Table View asks for things like number of rows in a section, height for header/footer in a section, or view for header/footer in a section. This last bit is also where I'm running into trouble. Using the above logic, section 0's header/footer does not disappear. Specifically, the footer stays below the inserted rows, but the header now overlays the topmost row. If we switch back to state one, the section footer is removed, but the section header remains. How about using [self.tableView reloadData] then? Sure, why not. We take care not to use it inside the update block, per Apple's advisement, and simply add it after endUpdates. This time, good news! The section 0 header/footer disappears. :) However ... Toggling back to state one results in a most exquisite mess! The section 0 header returns, only to overlay the first row once again (instead of appear above it). The section 0 footer is placed below the last row just fine, but the overall table footer - now reinstated - overlays the section footer. Waaaaaah … now what? Just to be sure, let's toggle back to state two again. Yep, that looks fine. Coming back to state one? Yecccch. I also tried sprinkling in a few other stunts like using reloadSections:withRowAnimation:, but that only serves to make things worse. NSRange range = {0, 1}; NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:range]; ... [self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationFade]; Case in point: If we invoke reloadSections... just before the end of the update block, changing to state two hides the first two rows from view, even though the space they would otherwise occupy remains. Switching back to state one returns section 0's header/footer to normal, but those first two rows remain invisible. Case two: Moving reloadSections... to just after the update block but before reloadData results in all rows becoming invisible! (I refer to the row as being invisible because, during tracing, tableView:cellForRowAtIndexPath: is returning bona-fide cell objects for those rows.) Case three: Moving reloadSections... after tableView:cellForRowAtIndexPath: brings us a bit closer, but the section 0 header/footer never returns when switching back to state one. Hmm. Perhaps it's a faux pas using both reloadSections... and reloadData, based on what I'm seeing at trace-time, which brings us to: Case four: Replacing reloadData with reloadSections... outright. All cells in state two disappear. All cells in state one remain missing as well (though the space is kept). So much for that theory. :) Tracing through the code, the cell and view objects, as well as the section heights, are all where they should be at the opportune times. They just aren't rendering sanely. So, how to crack this case? Clues welcome/appreciated!

    Read the article

  • UITableView UITableViewCell not reloading on reloadData

    - by David van Dugteren
    This question has been asked a few times now, but there exists no answer on the web that has solved the problem for me yet... See the code: { const NSInteger TOP_LABEL_TAG = 1001; static NSString *CellIdentifier = @"CellIdentifier"; UITableViewCell *cell = [theTableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } getAQuestionToAnswer = [[QuestionsToAnswer sharedInstance] getLatestLoadedQuestion]; UILabel *topLabel; topLabel = [[[UILabel alloc] initWithFrame: CGRectMake ( 50, 18, 260, 75)] autorelease]; [cell.contentView addSubview:topLabel]; topLabel.tag = TOP_LABEL_TAG; topLabel.backgroundColor = [UIColor clearColor]; topLabel.textColor = [UIColor colorWithRed:0.25 green:0.0 blue:0.0 alpha:1.0]; topLabel.highlightedTextColor = [UIColor colorWithRed:1.0 green:1.0 blue:0.9 alpha:1.0]; [topLabel setFont:[UIFont fontWithName:@"MarkerFelt-Thin" size:13]]; topLabel.numberOfLines = 4; topLabel = (UILabel *)[cell viewWithTag:TOP_LABEL_TAG]; topLabel.text = [NSString stringWithFormat:@"%@", [getAQuestionToAnswer valueForKey:@"question"] ]; Some code is omitted but the basics is there, I'm updating by means of a shake gesture, the NSLog confirms that the getAQuestionToAnswer is indeed updated with a new question after the gesture. Yet at run time, no matter what I do... e.g. [self.tableview reloaddata]; nothing works. It just doesn't want to refresh.

    Read the article

  • Draw a Custom cell for tableview ( uitableview ) , with changed colors and separator color and width

    - by Madhup
    Hi, I want to draw the background of a UITableViewCell which has a grouped style. The problem with me is I am not able to call the -(void)drawRect:(CGRect)rect or I think it should be called programmatically... I have taken code from following link . http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view/1031593#1031593 // // CustomCellBackgroundView.h // // Created by Mike Akers on 11/21/08. // Copyright 2008 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> typedef enum { CustomCellBackgroundViewPositionTop, CustomCellBackgroundViewPositionMiddle, CustomCellBackgroundViewPositionBottom, CustomCellBackgroundViewPositionSingle } CustomCellBackgroundViewPosition; @interface CustomCellBackgroundView : UIView { UIColor *borderColor; UIColor *fillColor; CustomCellBackgroundViewPosition position; } @property(nonatomic, retain) UIColor *borderColor, *fillColor; @property(nonatomic) CustomCellBackgroundViewPosition position; @end // // CustomCellBackgroundView.m // // Created by Mike Akers on 11/21/08. // Copyright 2008 __MyCompanyName__. All rights reserved. // #import "CustomCellBackgroundView.h" static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth,float ovalHeight); @implementation CustomCellBackgroundView @synthesize borderColor, fillColor, position; - (BOOL) isOpaque { return NO; } - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { // Initialization code } return self; } - (void)drawRect:(CGRect)rect { // Drawing code CGContextRef c = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(c, [fillColor CGColor]); CGContextSetStrokeColorWithColor(c, [borderColor CGColor]); CGContextSetLineWidth(c, 2.0); if (position == CustomCellBackgroundViewPositionTop) { CGFloat minx = CGRectGetMinX(rect) , midx = CGRectGetMidX(rect), maxx = CGRectGetMaxX(rect) ; CGFloat miny = CGRectGetMinY(rect) , maxy = CGRectGetMaxY(rect) ; minx = minx + 1; miny = miny + 1; maxx = maxx - 1; maxy = maxy ; CGContextMoveToPoint(c, minx, maxy); CGContextAddArcToPoint(c, minx, miny, midx, miny, ROUND_SIZE); CGContextAddArcToPoint(c, maxx, miny, maxx, maxy, ROUND_SIZE); CGContextAddLineToPoint(c, maxx, maxy); // Close the path CGContextClosePath(c); // Fill & stroke the path CGContextDrawPath(c, kCGPathFillStroke); return; } else if (position == CustomCellBackgroundViewPositionBottom) { CGFloat minx = CGRectGetMinX(rect) , midx = CGRectGetMidX(rect), maxx = CGRectGetMaxX(rect) ; CGFloat miny = CGRectGetMinY(rect) , maxy = CGRectGetMaxY(rect) ; minx = minx + 1; miny = miny ; maxx = maxx - 1; maxy = maxy - 1; CGContextMoveToPoint(c, minx, miny); CGContextAddArcToPoint(c, minx, maxy, midx, maxy, ROUND_SIZE); CGContextAddArcToPoint(c, maxx, maxy, maxx, miny, ROUND_SIZE); CGContextAddLineToPoint(c, maxx, miny); // Close the path CGContextClosePath(c); // Fill & stroke the path CGContextDrawPath(c, kCGPathFillStroke); return; } else if (position == CustomCellBackgroundViewPositionMiddle) { CGFloat minx = CGRectGetMinX(rect) , maxx = CGRectGetMaxX(rect) ; CGFloat miny = CGRectGetMinY(rect) , maxy = CGRectGetMaxY(rect) ; minx = minx + 1; miny = miny ; maxx = maxx - 1; maxy = maxy ; CGContextMoveToPoint(c, minx, miny); CGContextAddLineToPoint(c, maxx, miny); CGContextAddLineToPoint(c, maxx, maxy); CGContextAddLineToPoint(c, minx, maxy); CGContextClosePath(c); // Fill & stroke the path CGContextDrawPath(c, kCGPathFillStroke); return; } else if (position == CustomCellBackgroundViewPositionSingle) { CGFloat minx = CGRectGetMinX(rect) , midx = CGRectGetMidX(rect), maxx = CGRectGetMaxX(rect) ; CGFloat miny = CGRectGetMinY(rect) , midy = CGRectGetMidY(rect) , maxy = CGRectGetMaxY(rect) ; minx = minx + 1; miny = miny + 1; maxx = maxx - 1; maxy = maxy - 1; CGContextMoveToPoint(c, minx, midy); CGContextAddArcToPoint(c, minx, miny, midx, miny, ROUND_SIZE); CGContextAddArcToPoint(c, maxx, miny, maxx, midy, ROUND_SIZE); CGContextAddArcToPoint(c, maxx, maxy, midx, maxy, ROUND_SIZE); CGContextAddArcToPoint(c, minx, maxy, minx, midy, ROUND_SIZE); // Close the path CGContextClosePath(c); // Fill & stroke the path CGContextDrawPath(c, kCGPathFillStroke); return; } } - (void)dealloc { [borderColor release]; [fillColor release]; [super dealloc]; } @end static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth,float ovalHeight) { float fw, fh; if (ovalWidth == 0 || ovalHeight == 0) {// 1 CGContextAddRect(context, rect); return; } CGContextSaveGState(context);// 2 CGContextTranslateCTM (context, CGRectGetMinX(rect),// 3 CGRectGetMinY(rect)); CGContextScaleCTM (context, ovalWidth, ovalHeight);// 4 fw = CGRectGetWidth (rect) / ovalWidth;// 5 fh = CGRectGetHeight (rect) / ovalHeight;// 6 CGContextMoveToPoint(context, fw, fh/2); // 7 CGContextAddArcToPoint(context, fw, fh, fw/2, fh, 1);// 8 CGContextAddArcToPoint(context, 0, fh, 0, fh/2, 1);// 9 CGContextAddArcToPoint(context, 0, 0, fw/2, 0, 1);// 10 CGContextAddArcToPoint(context, fw, 0, fw, fh/2, 1); // 11 CGContextClosePath(context);// 12 CGContextRestoreGState(context);// 13 } but the problem is my drawRect is not getting called automatically......... I am doing it like this. CustomCellBackgroundView *custView = [[CustomCellBackgroundView alloc] initWithFrame:CGRectMake(0,0,320,44)]; [cell setBackgroundView:custView]; [custView release]; and doing this gives me transparent cell. I tried and fought with code but could get any results. Please help me out. I am really having no idea how this code will run.

    Read the article

  • What's the best way to refresh a UITableView within a UINavigationController hierarchy

    - by Steve Neal
    Hi, I'm pretty new to iPhone development and have struggled to find what I consider to be a neat way around this problem. I have a user interface where a summary of record data is displayed in a table inside a navigation controller. When the user clicks the accessory button for a row, a new view is pushed onto the navigation controller revealing a view where the user can edit the data in the corresponding record. Once done, the editing view is popped from the navigation controller's stack and the user is returned to the table view. My problem is that when the user returns to the table view, the table still shows the state of the data before the record was edited. I must therefore reload the table data to show the changes. It doesn't seem possible to reload the table data before it is displayed as the call only updates displayed records. Reloading it after the table has been displayed results in the old data changing before the user's eyes, which I'm not too happy with. This seems to me like a pretty normal thing to want to do in an iPhone app. Can anyone please suggest the best practice approach to doing this? I feel like I'm missing something. Cheers - Steve.

    Read the article

  • Wrap words in uitableview, iphone

    - by Nithin
    I am creating an rss feed application. As a sample i have downloaded apples rss feed, but the problem with it is that the words in the table cells are not wrapped. As the contents are of very lengthy, the users may not be able to read the full text from the table unless by going to that link. Instead, I need to display that in 2 or 3 lines, otherwise saying, need to use word wrap in the tables. How to implement that? pls reply

    Read the article

  • UITableView custom popping

    - by ckrames1234
    Okay, I made an app that has a list of items as a main view, and when you select an item it pushes a detail view controller. In this detail view controller you can switch between items. I want to be able to push a view, scroll a few items, and pop the view as if the current item was initially selected. I want to push a view, and then when i pop it, i want it to look like a different view was initially pushed. Here's a rough image, because its hard to explain in writing: http://96.248.81.29:83/misc/PushPopSituation.png (Thats a fixed IP, its not going anywhere) If anyone knows how I could do something like this, it would be a great help to me.

    Read the article

  • Reorder cells in a UITableView without displaying a "delete" button

    - by iter
    I want to be able to reorder cells in a table, but not to delete or insert them. I want a picture like this: This image appears in Apple's Table View Programming Guige, but the code samples there produce a table with red "delete" buttons when the table goes into editing mode. I can set editingStyleForRowAtIndexPath to UITableViewCellEditingStyleNone and that makes the delete buttons go away, but the rows are still indented as if to make room for these buttons.

    Read the article

  • UITableView insertRowsAtIndexPaths out of order

    - by bschlenk
    I currently have a UISegmentedControl set to add/remove table view cells when its value changes. Removing cells works perfectly, however when I insert cells they're in reverse order every other time. NSArray *addindexes = [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:2 inSection:0], [NSIndexPath indexPathForRow:3 inSection:0], [NSIndexPath indexPathForRow:4 inSection:0], nil]; NSArray *removeindexes = [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:2 inSection:0], [NSIndexPath indexPathForRow:3 inSection:0], [NSIndexPath indexPathForRow:4 inSection:0], nil]; [self.tableView beginUpdates]; switch (switchType.selectedSegmentIndex) { case 0: [self.tableView insertRowsAtIndexPaths:addindexes withRowAnimation:UITableViewRowAnimationTop]; break; case 1: [self.tableView deleteRowsAtIndexPaths:removeindexes withRowAnimation:UITableViewRowAnimationTop]; break; default: break; } [self.tableView endUpdates];} For example, every other time I add/remove cells they're in reverse order. (4, 3, 2 instead of 2, 3, 4) 1) Remove cells- add cells- correct order 2) Remove cells- add cells- incorrect order 3) Remove cells- add cells- correct order

    Read the article

  • Clip UITableView Cell's Separator

    - by Drewsmits
    I've been trying to build a view that looks similar to the "stocks" application (surprise). What I would like is to have the scroller bar outside of my rounded table view, shown in the image link below, but clip the cell separators. You can see how they overlap the scroller bar, which is annoying. I can't figure out how Apple put the scroller bar in a spot that looks like it is outside their table. Any ideas? (sorry, can't imbed images yet because I'm a new user). Scroller Problem Image

    Read the article

  • UITableViewCellSeparatorStyleNone does not hide blue separator line when selecting in UITableView

    - by clozach
    Before describing the problem, let me first point out that this is a distinct issue from this question. The Problem This screenshot was taken with a break set at tableView:didSelectRowAtIndexPath:, and as you can see in the simulator (far right of the image), there's a single-pixel blue line at the bottom of the selected cell. This is not the design asked for by the client, nor is it how this app used to behave: there should be no separator, even on selection. How I Got Here I'd initially designed this table view using custom UITableViewCell classes with corresponding nib (.xib) files and had no trouble with selections: the separator was hidden as desired. Predictably, scrolling was sluggish due to all the overhead from the view hierarchy, so I reworked the custom cells to use Loren Brichter's fast scrolling solution. Now scrolling is much faster, but I can't get rid of the separator for the life of me. What I've tried At the time of the screenshot above... the table view has "Separator [None]" in IB. the UIViewController that contains the table view has this line in viewDid Load: self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; As you can see in the screenshot, I inserted some unused lines to prove that separatorStyle is set as desired. Other testing confirms that tableView and self.tableView are equivalent pointers at that same breakpoint. I've also tried setting tableView.separatorColor to black and to clear, all with the same result: the cells look right until a selection is made.

    Read the article

  • UITableView scrolling to specific position

    - by Dave
    I am using iPhone SDK 3.1.3. I have a UITableViewController which gets data from another controller. The tableview is added as a subview to the mainview but the frame is set so that it is not visible. The tableview frame is updated and made to slide over the main view by tapping on a button. The table view appears and i scroll to the last row. if i select the last row, i reload the table with more data. The table gets updated with more data. everything works fine except the scroll position is always the top. I need the scroll position to be the last row that I clicked on to load more data. I save the scroll position and call the following code after it loads more data. It executes without issues but the scroll position is always the top. [theTableView scrollTRowAtIndexPath:[NSIndexPath indexPathForRow:savedScrollPosition inSection:0] atScrollPosition:savedScrollPosition animated:NO]; The above seems to have no effect. ViewWillAppear: ViewDidAppear: does not fire and I am told that if the view controller is instantiated in code, which is the case, these don't fire.

    Read the article

  • MKMapView within UITableView

    - by john-london
    I have a MKMapView within a UITableviewCell and I want to be able to disable scrolling of the table view when the user starts to drag within the map view. My plan had been to override the MKMapView touchesBegan/Moved etc methods and if they were called to then disable scrolling in the parent view. Scrolling in the parent view would be enabled again only when the touches in the MKMapView ended or were cancelled. My problem is that the touchesBegan/Moved methods inside MKMapView are not called - the problem is also discussed here: stackoverflow discussion. My table view is within a tab control, so I don't think I can extend UIWindow the way they describe, as there are several views that could be within the window, depending on which tab is active. How can I access the MKMapView touch events please?

    Read the article

  • Adding rows to UItableview and passing data between Viewcontrollers

    - by Jonathan
    I have a list of websites in a plist, when the app loads this populates a tableview (which is inside a navigation controller) But I have added an add button to the navigation bar and then created another View Controller to deal with inputting of the new website (Like Title and URL). It is very similar to how the contacts app looks. There is a table view and when you tap add, the add UI slides up. I have got all this working great so far. My Problem is what happens when the user taps Done. I can add the website to the plist (each website is a dictionary in the plist with 2 keys, atm) But then how do I tell the tableView to update? The table view has not been removed from the main window, just the add view has been added on top of the "screen". Another way of asking is, when you tap Save on Add a Contact screen: (not my image) How does the new contact's data (Xyz's data) get shown on the tableview?

    Read the article

  • uitableview delegate methods are not called

    - by Sean
    hi all i got the problem that the tableview methods are not called the first time the tableview is shown. if switch back to the previous view and then click the button to show the tableview again, the methods are called this time. i've to say that i show an actionsheet while the tableview is loading. the actionsheet i call in the ViewWillAppear method. thanks in advance sean

    Read the article

  • What's the UITableView index magnifying glass character?

    - by David Grant
    In Apple's iPhone apps (like Contacts), they have a nice magnifying glass icon at the top of the table view index. Since the table view index API is character-based, I assume that this magnifying glass is a Unicode character. So far I've resorted to placing a question mark character there, but that looks lame. Can anyone tell me what character the magnifying glass is?

    Read the article

  • iPhone - Setting background on UITableView

    - by Hans Espen
    Is there any way to set a background view on a UITableViewController? I try with the code I am using on a UIViewController, but the view comes over all the contents of the table view, and if I add the background view in the cellForRowAtIndexPath-method, it is not showing at all. Anyone done this before or have an idea on how it can be done? Here is the code I am using: UIImage *image = [UIImage imageNamed: @"background.jpg"]; UIImageView *backImage = [[UIImageView alloc] initWithImage: image]; [self.view addSubview: backImage]; [self.view sendSubviewToBack: backImage]; Thanks

    Read the article

  • Refresh a UITableView after loading

    - by Alavoil
    I am trying to load a table view from a cache very quickly and have the cached data in the table view appear. Then I want download new data, and then reload the table. Right now I am downloading the new data on viewDidAppear, but the view still refreshes before it displays. Any idea how I can do this?

    Read the article

  • How to troubleshoot deallocation of object in uitableview?

    - by 4thSpace
    I have a table view with tall cells. About 300 in height. The cells are custom and have an associated nib. In cellForRowAtIndexPath, I access an object in an array using indexPath.row. The object has properties, which I assign to labels on the custom cell. This works fine for the first two cells. Once I scroll enough for the third cell to get created, the app crashes. I have NSZombieEnabled set and here is the output: 2010-04-19 21:48:13.360 MyApp[54463:207] *** -[CALayer release]: message sent to deallocated instance 0xfc4e50 (gdb) continue 2010-04-19 21:48:18.382 MyApp[54463:207] *** NSInvocation: warning: object 0xfc4e50 of class '_NSZombie_CALayer' does not implement methodSignatureForSelector: -- trouble ahead 2010-04-19 21:48:18.383 MyApp[54463:207] *** NSInvocation: warning: object 0xfc4e50 of class '_NSZombie_CALayer' does not implement doesNotRecognizeSelector: -- abort (gdb) continue Program received signal: “EXC_BAD_ACCESS”. (gdb) I'm not sure what is deallocated. How can I trace this to the source?

    Read the article

  • UITableView: Header below a section gets duplicated if a row is deleted from the section above

    - by Megasaur
    In the editing mode of one of my tableviews, I delete a row from a section. The section below has a header. The deletion of the row in the section above leads to duplication of the section header below. So I have 2 header titles, one above the other. I also tried forcing a reload of the section after the delete to no avail: [self.tableView beginUpdates]; [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; NSIndexSet * indexSet = [[NSIndexSet alloc] initWithIndexesInRange:NSMakeRange(3,1)]; [self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationFade]; [indexSet release]; [self.tableView endUpdates]; Any ideas of what I have done wrong? It is also interesting that the header that failed to get removed is not "seen". If I scroll right off the content of the table view, and let it snap back, only the top header view is seen. It always ignores the header that should have been removed.

    Read the article

  • Using sectioned tables from an sqlite file with an iPhone uitableview

    - by Chris
    I am currently trying to make a sectioned table like this: Section 1: Entry 1 Entry 2 Entry 3 Section 2: Entry 4 Entry 5 Entry 6 Section 3: Entry 7 Entry 8 ... However, using this code: Event *lists = (Event *)[eventList objectAtIndex:indexPath.row]; accessStatement = "select * from DatabaseName"; [self findEvents]; // Code that builds each object's strings from database cell.textLabel.text = lists.name; Section 1: Entry 1 Entry 2 Entry 3 Section 2: Entry 1 Entry 2 Entry 3 Section 3: Entry 1 Entry 2 ... It keeps on repeating itself. How do I make the index so that it continues in each section rather than restarts? Thanks in advance.

    Read the article

  • UITableView rows load asynchronously

    - by Mohan
    On launch of app, i want to show 10 rows, at the bottom "Load 15 more", on click on "Load 15 more" the next 15 rows should add to the bottom of the table and again show "Load 15 more", until no rows found. note: I am using php to load table data as an xml feed. If anyone has any tutorial/sample code pl send me the link

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >