Search Results

Search found 295 results on 12 pages for 'uitableviewcontroller'.

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

  • Copy/Paste functionality in UITableViewController.

    - by Simon
    Hi.. I have a UITableViewController. I want to pop the copy/paste menu up when the user touches a cell. How to implement this functionality. Can someone help me. I tried this code, UIMenuController *theMenu = [UIMenuController sharedMenuController]; [theMenu setTargetRect:CGRectMake(10, 200, 100, 40) inView:[self tableView]]; [theMenu setMenuVisible:YES animated:YES]; But it doesn't work. My question is, What CGRect I have to pass as the setTargetRect parameter? Do I need to call SetNeedsDisplayInRect in my TableViewController? What else to do to make this work?

    Read the article

  • How do I get a reference to a rootViewController to a sub-view?

    - by Andy
    An answer posted for one of my previous questions brings up another question; I am calling a new view controller, "RuleBuilder," from my rootViewController. The rootViewController holds a reference to a contacts array. How do I get a reference to that array into the RuleBuilder? I tried adding UITableViewController *rootViewController; ... @property (nonatomic, retain) UITableViewController *rootViewController; to RuleBuilder.h, and then @synthesize rootViewController; in RuleBuilder.m. When I instantiate and push the RuleBuilder from within rootViewController, I do this: ruleBuilder.rootViewController = self; But when I try this [rootViewController.contacts addObject:newContact]; from within RuleBuilder, I get a compiler error to the effect of "request for 'contacts' in something not a struct" (or very similar; I haven't implemented this exact snippet of code, but I tried an identical approach not an hour ago for a couple of different references that I never was able to get working). Thanks, again, for your help.

    Read the article

  • iPhone: In landscape-only, after first addSubview, UITableViewController doesn't rotate properly

    - by Clay Bridges
    A minimal illustrative Xcode project for this is available on github. On my UIWindow, when I add second (and subsequent) UITableView's as subviews, they do not rotate properly, and thus appear sideways. This is only tested in the Simulator. Here's a little code for you: - (void)applicationDidFinishLaunching:(UIApplication *)application { ShellTVC* viewA = [[ShellTVC alloc] initWithTitle:@"View A"]; ShellTVC* viewB = [[ShellTVC alloc] initWithTitle:@"View B"]; // The first subview added will rotate to landscape correctly. // Any subsequent subview added will not. // You may try this by various commentings and rearranging of these two statements. [window addSubview:[viewA tableView]]; [window addSubview:[viewB tableView]]; [window makeKeyAndVisible]; } viewB appears sideways. Comment out the addSubview for viewB, and viewA appears correctly. Do that for viewA only, and viewB appears correctly. I am not creating these UITableViewControllers via NIBs, though the UIWindow is. In case you are wondering, ShellTVC is-a UITableViewController, and implements this method: - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft); } Also, I have set the UIInterfaceOrientation in the plist file to UIInterfaceOrientationLandscapeLeft. Probably related -- and unanswered -- SO questions here and here.

    Read the article

  • Custom Keyboard (iPhone), UIKeyboardDidShowNotification and UITableViewController

    - by Pascal
    On an iPhone App, I've got a custom keyboard which works like the standard keyboard; it appears if a custom textfield becomes first responder and hides if the field resigns first responder. I'm also posting the Generic UIKeyboardWillShowNotification, UIKeyboardDidShowNotification and their hiding counterparts, like follows: NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithCapacity:5]; [userInfo setObject:[NSValue valueWithCGPoint:self.center] forKey:UIKeyboardCenterBeginUserInfoKey]; [userInfo setObject:[NSValue valueWithCGPoint:shownCenter] forKey:UIKeyboardCenterEndUserInfoKey]; [userInfo setObject:[NSValue valueWithCGRect:self.bounds] forKey:UIKeyboardBoundsUserInfoKey]; [userInfo setObject:[NSNumber numberWithInt:UIViewAnimationCurveEaseOut] forKey:UIKeyboardAnimationCurveUserInfoKey]; [userInfo setObject:[NSNumber numberWithDouble:thisAnimDuration] forKey:UIKeyboardAnimationDurationUserInfoKey]; [[NSNotificationCenter defaultCenter] postNotificationName:UIKeyboardWillShowNotification object:nil userInfo:userInfo]; This code is working and I use it in UIViewController subclasses. Now since iPhone OS 3.0, UITableViewController automatically resizes its tableView when the system keyboards show and hide. I'm only now compiling against 3.0 and I thought that the controller should also resize the table if my custom keyboard appears, since I'm posting the same notification. However it doesn't. The table view controller is set as the delegate of the input fields. Does anyone have an idea why this might be the case? Has anyone implemented something similar successfully? I have standard input fields along the custom ones, so if the user changes the fields the standard keyboard hides and the custom one shows. It would be beneficial if the tableView didn't resize to full height and I didn't have to resize it back with a custom method.

    Read the article

  • rotating UITableViewController manually

    - by lope
    Hi there, I am trying to do something I am not really sure is possible :) I have application that is in portrait mode and doesn't react to device rotation. Almost all parts of app work best in portrait so I disabled autorotation. But one part should be viewed in landscape. I just drawed my view rotated by 90 degrees and with this forced user to rotate device (again no autorotation). Everything was ok until I added UITableViewController that is invoked from this (and only from this) rotated view. Table view is of course in portrait mode, so user has to rotate device again, which is not really user friendly experience. My problem is, how to manually rotate table view so it is in landscape mode without using autorotation feature. I was able to rotate it using transform, but I can't position it properly. Is this right way of doing this or did I missed something that would make this trivial task? I don't want to use autorotation because both part are pretty separated from each other and each of them would be almost useless in other's mode

    Read the article

  • How to avoid big and clumpsy UITableViewController on iOS?

    - by Johan Karlsson
    I have a problem when implementing the MVC-pattern on iOS. I have searched the Internet but seems not to find any nice solution to this problem. Many UITableViewController implementations seems to be rather big. Most example I have seen lets the UITableViewController implement UITableViewDelegate and UITableViewDataSource. These implementations are a big reason why UITableViewControlleris getting big. One solution would be to create separate classes that implements UITableViewDelegate and UITableViewDataSource. Of course these classes would have to have a reference to the UITableViewController. Are there any drawbacks using this solution? In general I think you should delegate the functionality to other "Helper" classes or similar, using the delegate pattern. Are there any well established ways of solving this problem? I do not want the model to contain to much functionality, nor the view. A believe that the logic should really be in the controller class, since this is one of the cornerstones of the MVC-pattern. But the big question is; How should you divide the controller of a MVC-implementation into smaller manageable pieces? (Applies to MVC in iOS in this case) There might be a general pattern for solving this, although I am specifically looking for a solution for iOS. Please give an example of a good pattern for solving this issue. Also an argument why this solution is awesome.

    Read the article

  • How to avoid big and clumsy UITableViewController on iOS?

    - by Johan Karlsson
    I have a problem when implementing the MVC-pattern on iOS. I have searched the Internet but seems not to find any nice solution to this problem. Many UITableViewController implementations seems to be rather big. Most examples I have seen lets the UITableViewController implement <UITableViewDelegate> and <UITableViewDataSource>. These implementations are a big reason why UITableViewControlleris getting big. One solution would be to create separate classes that implements <UITableViewDelegate> and <UITableViewDataSource>. Of course these classes would have to have a reference to the UITableViewController. Are there any drawbacks using this solution? In general I think you should delegate the functionality to other "Helper" classes or similar, using the delegate pattern. Are there any well established ways of solving this problem? I do not want the model to contain too much functionality, nor the view. I believe that the logic should really be in the controller class, since this is one of the cornerstones of the MVC-pattern. But the big question is: How should you divide the controller of a MVC-implementation into smaller manageable pieces? (Applies to MVC in iOS in this case) There might be a general pattern for solving this, although I am specifically looking for a solution for iOS. Please give an example of a good pattern for solving this issue. Please provide an argument why your solution is awesome.

    Read the article

  • Cocoa-Touch Fun. Name the Alphanumerically Longest Method Name?

    - by dugla
    So, as I get comfortable with Cocoa/Cocoa-Touch I, like others can't help but notice the rather verbose method names. What is the absolutely longest method in Cocoa-Touch that you have come across? To kick things off, I submit that perennial favorite from UITableViewController - tableView:accessoryButtonTappedForRowWithIndexPath: Cheers, Doug

    Read the article

  • ocjective-c Obtain return value from public method

    - by Felix
    I'm pretty new to objective-C (and C in general) and iPhone development and am coming from the java island, so there are some fundamentals that are quite tough to learn for me. I'm diving right into iOS5 and want to use storyboards. For now I am trying to setup a list in a UITableViewController that will be filled with values returned by a web service in the future. For now, I just want to generate some mock objects and show their names in the list to be able to proceed. Coming from java, my first approach would be to create a new Class that provides a global accessible method to generate some objects for my list: #import <Foundation/Foundation.h> @interface MockObjectGenerator : NSObject +(NSMutableArray *) createAndGetMockProjects; @end Implementation is... #import "MockObjectGenerator.h" // Custom object with some fields #import "Project.h" @implementation MockObjectGenerator + (NSMutableArray *) createAndGetMockObjects { NSMutableArray *mockProjects = [NSMutableArray alloc]; Project *project1 = [Project alloc]; Project *project2 = [Project alloc]; Project *project3 = [Project alloc]; project1.name = @"Project 1"; project2.name = @"Project 2"; project3.name = @"Project 3"; [mockProjects addObject:project1]; [mockProjects addObject:project2]; [mockProjects addObject:project3]; } And here is my ProjectTable.h that is supposed to control my ListView #import <UIKit/UIKit.h> @interface ProjectsTable : UITableViewController @property (strong, nonatomic) NSMutableArray *projectsList; @end And finally ProjectTable.m #import "ProjectsTable.h" #import "Project.h" #import "MockObjectGenerator.h" @interface ProjectsTable { @synthesize projectsList = _projectsList; -(id)initWithStyle:(UITableViewStyle:style { self = [super initWithStyle:style]; if (self) { _projectsList = [[MockObjectGenerator createAndGetMockObjects] copy]; } return self; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // only one section for all return 1; - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSLog(@"%d entries in list", _projectsList.count); return _projectsList.count; - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // the identifier of the lists prototype cell is set to this string value static NSString *CellIdentifier = @"projectCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; Project *project = [_projectsList objectAtIndex:indexPath.row]; cell.textLabel.text = project.name } So while I think everything is correctly set, I expect the tableView to show my three mock objects in its rows. But it stays empty and the NSLog method prints "0 entries in list" into the console. So what am I doing wrong? Any help is appreciated. Best regards Felix

    Read the article

  • cant populate cells with an array when i have loaded a second UITableViewController

    - by richard Stephenson
    hi there, im very new to iphone programming, im creating my first app, (a world cup one) the first view is a table view. the cell text label is filled with an array, so it shows all the groups (group a, B, c,ect) then when you select a group, it pulls on another UITableViewcontroller, but whatever i do i cant set the text label of the cells (e.g france,mexico,south africa, etc. infact nothin i do to the cellForRowAtIndexPath makes a difference , could someone tell me what im doing wrong please Thanks `here is my code for the view controller #import "GroupADetailViewController.h" @implementation GroupADetailViewController @synthesize groupLabel = _groupLabel; @synthesize groupADetail = _groupADetail; @synthesize teamsInGroupA; #pragma mark Memory management - (void)dealloc { [_groupADetail release]; [_groupLabel release]; [super dealloc]; } #pragma mark View lifecycle - (void)viewDidLoad { [super viewDidLoad]; // Set the number label to show the number data teamsInGroupA = [[NSArray alloc]initWithObjects:@"France",@"Mexico",@"Uruguay",@"South Africa",nil]; NSLog(@"loaded"); // Set the title to also show the number data [[self navigationItem]setTitle:@"Group A"]; //[[self navigationItem]cell.textLabel.text:@"test"]; //[[self navigationItem] setTitle[NSString String } - (void)viewDidUnload { [self setgroupLabel:nil]; } #pragma mark Table view methods - (NSInteger)numberOfSectionsInTableView:(UITableView*)tableView { // Return the number of sections in the table view return 1; } - (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in a specific section // Since we only have one section, just return the number of rows in the table return 4; NSLog:("count is %d",[teamsInGroupA count]); } - (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath { static NSString *cellIdentifier2 = @"Cell2"; // Reuse an existing cell if one is available for reuse UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier2]; // If no cell was available, create a new one if (cell == nil) { NSLog(@"no cell, creating"); cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier2] autorelease]; [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; } NSLog(@"cell already there"); // Configure the cell to show the data for this row //[[cell textLabel]setText:[NSString string //[[cell textLabel]setText:[teamsInGroupA objectAtIndex:indexPath.row]]; //NSUInteger row = [indexPath row]; //[cell setText:[[teamsInGroupA objectAtIndex:indexPath:row]retain]]; //cell.textLabel.text:@"Test" [[cell textLabel]setText:[teamsInGroupA objectAtIndex:indexPath.row]]; return cell; } @end #import "GroupADetailViewController.h" @implementation GroupADetailViewController @synthesize groupLabel = _groupLabel; @synthesize groupADetail = _groupADetail; @synthesize teamsInGroupA; #pragma mark Memory management - (void)dealloc { [_groupADetail release]; [_groupLabel release]; [super dealloc]; } #pragma mark View lifecycle - (void)viewDidLoad { [super viewDidLoad]; // Set the number label to show the number data teamsInGroupA = [[NSArray alloc]initWithObjects:@"France",@"Mexico",@"Uruguay",@"South Africa",nil]; NSLog(@"loaded"); // Set the title to also show the number data [[self navigationItem]setTitle:@"Group A"]; //[[self navigationItem]cell.textLabel.text:@"test"]; //[[self navigationItem] setTitle[NSString String } - (void)viewDidUnload { [self setgroupLabel:nil]; } #pragma mark Table view methods - (NSInteger)numberOfSectionsInTableView:(UITableView*)tableView { // Return the number of sections in the table view return 1; } - (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in a specific section // Since we only have one section, just return the number of rows in the table return 4; NSLog:("count is %d",[teamsInGroupA count]); } - (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath { static NSString *cellIdentifier2 = @"Cell2"; // Reuse an existing cell if one is available for reuse UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier2]; // If no cell was available, create a new one if (cell == nil) { NSLog(@"no cell, creating"); cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier2] autorelease]; [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; } NSLog(@"cell already there"); // Configure the cell to show the data for this row //[[cell textLabel]setText:[NSString string //[[cell textLabel]setText:[teamsInGroupA objectAtIndex:indexPath.row]]; //NSUInteger row = [indexPath row]; //[cell setText:[[teamsInGroupA objectAtIndex:indexPath:row]retain]]; //cell.textLabel.text:@"Test" [[cell textLabel]setText:[teamsInGroupA objectAtIndex:indexPath.row]]; return cell; } @end

    Read the article

  • Why won't my UISearchDisplayController fire the didSelectRowAtIndexPath moethod?

    - by John Wells
    I am having an odd problem when searching a UITableView using a UISearchDisplayController. The UITableViewController is a subclass of another UITableViewController with a working didSelectRowAtIndexPath method. Without searching the controller handles selections fine, sending the superclass a didSelectRowAtIndexPath call, but if I select a cell when searching the superclass receives nothing but the cell is highlighted. Below is the code from my subclass. @implementation AdvancedViewController @synthesize searchDisplayController, dict, filteredList; - (void)viewDidLoad { [super viewDidLoad]; // Programmatically set up search bar UISearchBar *mySearchBar = [[UISearchBar alloc] init]; mySearchBar.delegate = self; [mySearchBar setAutocapitalizationType:UITextAutocapitalizationTypeNone]; [mySearchBar sizeToFit]; self.tableView.tableHeaderView = mySearchBar; // Programmatically set up search display controller searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:mySearchBar contentsController:self]; [self setSearchDisplayController:searchDisplayController]; [searchDisplayController setDelegate:self]; [searchDisplayController setSearchResultsDataSource:self]; // Parse data from server NSData * jsonData = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]]; NSArray * items = [[NSArray alloc] initWithArray:[[CJSONDeserializer deserializer] deserializeAsArray:jsonData error:nil]]; // Init variables dict = [[NSMutableDictionary alloc] init]; listIndex = [[NSMutableArray alloc] init]; fullList = [[NSMutableArray alloc] init]; filteredList = [[NSMutableArray alloc] init]; // Get each item and format it for the UI for(NSMutableArray * item in items) { // Get the first letter NSString * firstKey = [[[item objectAtIndex:0] substringWithRange:NSMakeRange(0,1)] uppercaseString]; // Put symbols and numbers in the same section if ([[firstKey stringByTrimmingCharactersInSet:[[NSCharacterSet letterCharacterSet] invertedSet]] isEqualToString:@""]) firstKey = @"#"; // If there isn't a section with this key if (![listIndex containsObject:firstKey]) { // Add the key to the index for faster access (because it's already sorted) [listIndex addObject:firstKey]; // Add the key to the unordered dictionary [dict setObject:[NSMutableArray array] forKey:firstKey]; } // Add the object to the dictionary [[dict objectForKey:firstKey] addObject:[[NSMutableDictionary alloc] initWithObjects:item forKeys:[NSArray arrayWithObjects:@"name", @"url", nil]]]; // Add the object to the list for simple searching [fullList addObject:[[NSMutableDictionary alloc] initWithObjects:item forKeys:[NSArray arrayWithObjects:@"name", @"url", nil]]]; } filteredList = [NSMutableArray arrayWithCapacity:[fullList count]]; } #pragma mark - #pragma mark Table view data source // Custom method for object oriented data access - (NSString *)tableView:(UITableView *)tableView dataForRowAtIndexPath:(NSIndexPath *)indexPath withKey:(NSString *)key { return (NSString *)((tableView == self.searchDisplayController.searchResultsTableView) ? [[filteredList objectAtIndex:indexPath.row] objectForKey:key] : [[[dict objectForKey:[listIndex objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row] valueForKey:key]); } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return (tableView == self.searchDisplayController.searchResultsTableView) ? 1 : (([listIndex count] > 0) ? [[dict allKeys] count] : 1); } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return (tableView == self.searchDisplayController.searchResultsTableView) ? [filteredList count] : [[dict objectForKey:[listIndex objectAtIndex:section]] count]; } - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView { return (tableView == self.searchDisplayController.searchResultsTableView) ? [[NSArray alloc] initWithObjects:nil] : listIndex; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return (tableView == self.searchDisplayController.searchResultsTableView) ? @"" : [listIndex objectAtIndex:section]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *kCellID = @"cellID"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellID]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCellID] autorelease]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } NSString * name = nil; // TODO: Make dataForRowAtIndexPath work here if (tableView == self.searchDisplayController.searchResultsTableView) { // NOTE: dataForRowAtIndexPath causes this to crash for some unknown reason. Maybe it is called before viewDidLoad and has no data? name = [[filteredList objectAtIndex:indexPath.row] objectForKey:@"name"]; } else { // This always works name = [self tableView:[self tableView] dataForRowAtIndexPath:indexPath withKey:@"name"]; } cell.textLabel.text = name; return cell; } #pragma mark Search Methods - (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope { // Clear the filtered array [self.filteredList removeAllObjects]; // Filter the array for (NSDictionary *item in fullList) { // Compare the item's name to the search text NSComparisonResult result = [[item objectForKey:@"name"] compare:searchText options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch) range:NSMakeRange(0, [searchText length])]; if (result == NSOrderedSame) { // Add to the filtered array if it matches [self.filteredList addObject:item]; } } } - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { [self filterContentForSearchText:searchString scope: [[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]]; // Return YES to cause the search result table view to be reloaded. return YES; } - (void)viewDidUnload { filteredList = nil; } @end

    Read the article

  • Subview appears behind tableview

    - by Banjer
    When I add a subview to my UITableViewController, it seems to be underneath the tableview. I may be loading my subview incorrectly, or calling addSubview in the wrong place. The subview I'm referring to is the red area above the tabbar that also contains the "Click me" button: You can see that the cell lines kind of overlap. Here is where I'm adding the subview in my TableViewController: - (void)viewDidLoad { [super viewDidLoad]; CGRect hRect = CGRectMake(0, 170, 320, 480); HomeScreenOverlayView *homeView = [[HomeScreenOverlayView alloc] initWithFrame:hRect]; [self.tableView addSubview:homeView]; [homeView release]; } Any ideas? Thanks!

    Read the article

  • Can NSDictionary be used with TableView on iPhone?

    - by bobo
    In a UITableViewController subclass, there are some methods that need to be implemented in order to load the data and handle the row selection event: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; //there is only one section needed for my table view } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [myList count]; //myList is a NSDictionary already populated in viewDidLoad method } - (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 ]; } // indexPath.row returns an integer index, // but myList uses keys that are not integer, // I don't know how I can retrieve the value and assign it to the cell.textLabel.text return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Handle row on select event, // but indexPath.row only returns the index, // not a key of the myList NSDictionary, // this prevents me from knowing which row is selected } How is NSDictionary supposed to work with TableView? What is the simplest way to get this done?

    Read the article

  • Why won't my UISearchDisplayController fire the shouldReloadTableForSearchString method when I enter

    - by Gorgando
    I've been following Apple's TableSearch code example, but it's not working for me and I think I'm doing everything the same way they did it. The method below should be fired whenever the user types anything into the search box, but it never gets fired for me, just on the sample app. I have the appropriate @interface ContactsTableVC : UITableViewController { in the header file. I'm not sure what I'm missing or where else to look. My NSLog never gets called. Thanks for the help! - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString searchScope:(NSInteger)searchOption { NSLog(@"The shouldreloadtableforsearchstring method has been called!"); [self filterContentForSearchText:searchString]; // Return YES to cause the search result table view to be reloaded. return YES; }

    Read the article

  • IUNavigationController loading more viewControllers

    - by Goods
    Not a Noob as yesterday, but still green. I have a UITabbarcontoller and a IUNavigationController they seem to work fine. I have a UITableviewController to which I loads my NSMutable array. The user clicks a cell and didSelectRowAtIndexPath xib is loaded onto the stack. I have a 'Learn More' button on the current xib. I've tried a few approaches to load a newer xib when the 'Learn More' button is pressed but have failed. Im thinking it has to do with the Navigation Controller? Do I need to import the navigationcontroller to every ViewControllerSubclass I make? Thanks.

    Read the article

  • Enable editing does not call didSelectRowAtIndexPath ??

    - by elementsense
    Hi I have a UITableViewController where the user should be able to edit the items. In order to enable editing i use this : self.navigationItem.rightBarButtonItem = self.editButtonItem; And for everyone, how does not know where self.editButtonItem comes from, it is predefined by the SDK. So, now when I press on any item, this method is called : - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath but as soon as I hit the edit button and while editing is active, this method does not seemed to be called. Any idea what I missing ? This is the rest of the code that is related to editing : // Override to support conditional editing of the table view. - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { // Return NO if you do not want the specified item to be editable. return YES; } - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewCellEditingStyleNone; } - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath { return NO; } Thanks for the help. mcb

    Read the article

  • iPhone: Add background button to view when UITableView has no cells

    - by Nic Hubbard
    I have a UITableViewController, when there is no data to populate the UITableView, I want to add a button, which uses an image. So, rather than the user seeing a tableview with no records, they will see an image that says, "No records have been added, Tap to add one", then they click and we create a new one. I assumed I would just hide the UITableView, then create the button, but I never see the button. Here I am using: if ([[fetchedResultsController sections] count] == 0) { self.tableView.hidden = YES; // Create button w/ image UIButton * btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame = CGRectMake(0, 0, 100, 50); [btn setImage:[UIImage imageNamed:@"no-rides.png"] forState:UIControlStateNormal]; [self.view addSubview:btn]; } Ideas on why I would never see the button? When I show this view, it seems to have a transparent background for a second, then changes white...

    Read the article

  • iPhone UI: No edit button for UITableView, bad idea?

    - by Nic Hubbard
    I have a UITableViewController which lets the user drill down into different records. On the second level/view, the user can add and edit new records. But, I am not sure what to do, since the back button is on the top left, and I need to put the "Add" button on the top right, so there is no room (keeping to HIG) for the edit button, which would normally go where the back button is. (I am using a tab bar, so can't put it at the bottom.) Do you think that it is logical, to expect users to know to swipe to delete a record? Or, do I need to have an edit button? If I DO need an edit button, where should I put it if I am following HIG?

    Read the article

  • Custom cell and Delete/Move indicators

    - by Kamchatka
    Hello, I have a custom UITableViewCell. However, when I got in edit mode, I don't have any Delete and Move indicators appearing. The custom cell draws itself in the contentView. In layoutSubviews, I make sure there is space on the left and one the right of the contentView so that the controls can appear (if this was the problem). - (void)layoutSubviews { self.contentView.frame = CGRectMake(50, 0, self.frame.size.width - 100, sub.thumbnail.size.height + 20); } In the UITableViewController, I return YES in: - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { How could I solve this lack of interactivity. Is there something specific for custom cells? Thanks!

    Read the article

  • how to set a tableview delegate

    - by dubbeat
    Hi, I'm trying to use a tableview without using a nib and without using a UITableViewController. I have added a UITableView instance to a UIViewController Like So mytable = [[UITableView alloc] initWithFrame:CGRectMake(22, 207, 270, 233)]; [mytable setDelegate:self]; [self.view mytable]; Also I have added the following table view methods to my UIViewController (cut for brevities sake) - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { I am getting a warning saying that my UIViewController does not implement UITableView delegate protocol. Whats the correct way to tell the table view where its delegate methods are? (This is my first attempt at trying to use a UITableView without selecting the UITableTableview controller from the new file options)

    Read the article

  • UITableView - Color a selectede cell in table (remain colored)

    - by Liron Loop
    Hi In my app i'm using a UITableViewController ("grouped style") which in one of its section I want the user to be able to see what he had selected by making this cell colored and other "uncolored". Doing it by updating all cells' background color and reloading table data, each time user touches a cell (in didSelectRowAtIndexPath:) Problem is that there is some processing made in the didSelectRowAtIndexPath: so the color doesn't get changed right a way, rather in a bit delay after touch was made. (I gusse the processing is the resone for the tiny delay) Is there a better way of doing it? Any help will be appreciated Liron P.S. I'm new to all of this...

    Read the article

  • Reload table view in real time

    - by Lucas Vallim da Costa
    The app receives a UILocalNotification, but if the user is at the UITableViewController at the fire time, the table view (containing the scheduled notifications) does not reload. The user has to get out of that view and load the view again so that the cells are loaded and, as the notification was already fired, it will not be displayed on any cell of that table view. Problem is: If the user touches the specific tableView cell that contained the notification that just fired, the app crashes, cause the notification is not there anymore. I've implemented the - (void)reloadData in every place possible, and it still doesn't load in real time. What would be a better solution for this? Other detail, how can I push a specific view after the notification is displayed (when the user slides the app icon when the phone is locked)? Any help will be truly appreciated, since theres are the last details remaining to publish my first App.

    Read the article

  • Create an Edit view similar to Contacts App

    - by Daniel Granger
    I have an edit view in my app which is a instance of UITableViewController and contains one cell with a textfield in a grouped table. At the moment this cell is at the top of the screen and is firstResponder so they keyboard is visible as well. But in all the Apples apps like the Contacts App when you edit a piece of information like an Email it buts both of its rows in the middle between the Nav Bar and the Keyboard not at the top of the screen. How do I achieve this effect? Many Thanks

    Read the article

  • UITableView animations for a "lazy" UI design?

    - by donuts
    I have a UITableViewController that allows the user to perform editing tasks. Now, once a user has committed his change, the table view doesn't directly change the model and updates the table, rather "informs" the model what the user wants to do. The model in turn updates accordingly and then posts a notification that it has been changed. As far as I've seen, I need to begin/end updates on the tableview and in between change the model to its' final form. My changes though, are asynchronous and cannot guarantee to update the model before 'tableview endupdates' is called. Currently, each time I receive a 'model did change' notificaiton, I reload the entire table. So, how can I really make cell animations (delete/insert) work? Should the model fire a notification for each little change instead of the entire table?

    Read the article

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