Search Results

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

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

  • How to delete a cell in UITableView by using custom button in cell ?

    - by srikanth rongali
    I have UITableView. I customized the cell height (increased). I have 4 labels(UILabel) and 1 image(UIImage) and 3 buttons (UIButton). one of the button is delete button. By touching the cell or button(play button) on the image a video is loaded and played. I need to delete the cell by touching delete button. If I touched the delete button the corresponding video is deleted from library . But, how to delete the cell and all remaining data in it ? I am not able to delete the cells or the data in the cells. How to do it ? I used these. But the control is not entering in to second method committedEditingStyle: - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return YES; } - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { } } Thank you. The following image shows the delete button of my program.

    Read the article

  • numberOfSectionsInTableView is requested in/after viewDidLoad ONLY if tableview is empty

    - by Ben Packard
    A simple tableviewController, empty. A modal that can be launched from a button. No data in the data source for the tableview, and no rows displayed. I open the modal, use it to add an item, and return to the tableview controller. The tableview updates itself automatically, and the new row is displayed. I add a second item. The table view does NOT update automatically. I can tell by logging inside numberOfSectionsInTableView that even if I go to add the first item and cancel, the tableview refreshes - it asks for the number of sections, rows, and the cell to display (if there is one). But not if there is one pre-existing row in the table. I've scoured my code but can't find anything that would cause the tableview to know when the first item is added, but none afterwards. Any ideas? EDIT - I have further narrowed my issue so will close this shortly and post a more specific question

    Read the article

  • Tableview not drilling down

    - by JoshD
    I have a Tableview which is loaded with a dummy list of exercises. I need to drill to a different page. My didSelectRow is being called, but not implementing the method. The app is a tab bar navigation app that loads a UITableView. #import <UIKit/UIKit.h> @interface Schedule : UIViewController <UITableViewDelegate, UITableViewDataSource> { NSArray *mySchedule; } @end #import "Schedule.h" #import "AnotherViewController.h" @implementation Schedule - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return mySchedule.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //create a cell UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; //fill it with contents cell.textLabel.text = [mySchedule objectAtIndex:indexPath.row]; //return it return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherViewController" bundle:nil]; [self.navigationController pushViewController:anotherViewController animated:YES]; [anotherViewController release]; } /* // 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 { NSString *myFile = [[NSBundle mainBundle] pathForResource:@"exercise" ofType:@"plist"]; mySchedule = [[NSArray alloc] initWithContentsOfFile:myFile]; [super viewDidLoad]; }

    Read the article

  • iPhone -trouble with a loading data from webservice into a tableview

    - by medampudi
    I am using a Window based application and then loading up my initial navigationview based controller. After loading it if the user is not registered/ does not have a credentials present then it takes the user to a login view controller . loginViewController *sampleView = [[loginViewController alloc] initWithNibName:@"loginViewController" bundle:nil]; [self.navigationController presentModalViewController:sampleView animated:YES]; [sampleView release]; then right after that i try to load the table with data that i get from a webservice using asiHTTP .. for this question lets say it takes 3 seconds time to get the data and then deserialize it . now... my question is it works out okey in the later runs as I store the username and password in a seure location... but in the first instance.... i am not able to get the data to laod to the tableview... I have tried a lot of things... 1. Initially the data fetch methods was in a diffrent methods.. so i thought that might be the problem as then moved it the same place as the tbleviewController(navigationController) 2. I event put in the Reload data at the end of the functionality for the data parsing and deserialization... nothing happens. 3. i did not understand the concept of @property and alll.... 4. The screen is black screen with nothing displayed on it for a good 5 seconds in the consecutive launches of the app.... so could we have something like a MBPorgressHUD implemented for the same. could any one please help for these scenarios and guidance as to what paths to take from here...

    Read the article

  • How to delete a customized cell in UITableView ?

    - by srikanth rongali
    I have UITableView. I customized the cell height (increased). I have 4 labels(UILabel) and 1 image(UIImage) and 3 buttons (UIButton). one of the button is delete button. By touching the cell or button(play button) on the image a video is loaded and played. I need to delete the cell by touching delete button. If I touched the delete button the corresponding video is deleted from library . But, how to delete the cell and all remaining data in it ? I am not able to delete the cells or the data in the cells. How to do it ? Thank you.

    Read the article

  • How to use tags in iPhone application code ?

    - by srikanth rongali
    I need to access the [indexPath row] outside the tableView method. I need to use it in my own method in same class and other classes also. How can I do it. If the cell in the table view have buttons, By selecting the buttons how can I say which row was selected ? I think of using the tags. But, I do not know much about tags. Thank you.

    Read the article

  • Invalidating UITableView contents

    - by Roman
    I have an application with several UITableViewControllers. Now, the user is allowed to change "Data source". In that case I need to invalidate (reset) data in the relevant UITableViews. I figured out, that I can use NSNotificationCenter and add these controllers as observers to events which will be generated when the data source changes. The question is, how do I reset the underlying tables? I can, of course, set some boolean flag, and call UITableView:reloadData in viewWillAppear or viewDidAppear, but I was wondering, if there's a cleaner way of doing it. Or perhaps I'm completely missing the point, and I don't need NSNotificationCenter altogether. Thank you very much in advance.

    Read the article

  • iPhone: Same Rows Repeated in Each Section of Grouped UITableview

    - by Rank Beginner
    I have an app that is a list of tasks, like a to do list. The user configures the tasks and that goes to the SQLite db. The list is displayed in a tableview. The SQL table in question consists of a taskid int, groupname varchar, taskname varchar, lastcompleted datetime, nextdue datetime, weighting integer. I currently have it working by creating an array from each column in the SQL table. In the tableView:cellForRowAtIndexPath: method, I create the controls for each task by binding their values to the array for each column. I want to add configurable task groups that should display as the section titles. I got the task groups to display as the section headers. My problem is that all the task rows are repeated in each group under each header. How do I get the correct rows to show up only under the correct section? I'm really new to development period and took on a hobby of trying to teach myself how to develop iphone apps. So, pretty please, be a little more detailed than you normally would with a professional developer. :)

    Read the article

  • How can we know which cell is touched in tablView when a custom button in the cell is touched ?

    - by srikanth rongali
    I need to know which cell is touched when any button inside the cell is touched. I have custom UIButton *button1 in the cell and UIButton *button2 on the cell.imageView.image of the cell. I wrote selectors for both buttons.; But, I could not differentiate the buttons for each cell. How do I know which cell button was touched. What to do, to know that a particular cell's button was touched ? Thank you.

    Read the article

  • Loading a UIView from a UITableview

    - by Michael Robinson
    I can firgure out how to push a UIView from a Tableview and have the "child" details appear. Here is the view I'm trying to load: Here is the code that checks for children and either pushes a itemDetail.xib or an additional UITable, I want to use the above .xib but load the correct contents "tableDataSource" into the UItable: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //Get the dictionary of the selected data source. NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row]; //Get the children of the present item. NSArray *Children = [dictionary objectForKey:@"Children"]; if([Children count] == 0) { ItemDetailViewController *dvController = [[ItemDetailViewController alloc] initWithNibName:@"ItemDetailView" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:dvController animated:YES]; [dvController release]; } else { //Prepare to tableview. FirstTab *rvController = [[FirstTab alloc] initWithNibName:@"FirstView" bundle:[NSBundle mainBundle]]; //Increment the Current View rvController.CurrentLevel += 1; //Set the title; rvController.CurrentTitle = [dictionary objectForKey:@"Title"]; //Push the new table view on the stack [self.navigationController pushViewController:rvController animated:YES]; rvController.tableDataSource = Children; [rvController release]; } } Thanks for the help. I see lots of stuff on this but can't find the correct push instructions.

    Read the article

  • Moving UITableView cells and maintaining consistent data

    - by Mark F
    I've enabled editing mode and moving cells around to allow users to position table view content in the order they please. I'm using Core Data as the data source, which sorts the content by the attribute "userOrder". When content is first inserted, userOrder is set to a random value. The idea is that when the user moves a cell around, the userOrder of that cell changes to accomodate its new position. The following are problems I am running into while trying to accomplish this: Successfully saving the the new location of the cell and adjusting all changed locations of influenced cells. Getting the data to be consistent. For example, the TableView handles the movement fine, but when i click on the new location of the cell, it displays data for the old cell that used to be that location. Data of all influenced cells gets messed up as well. I know I have to implement this in: - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath {} I just don't know how. The apple docs are not particularly helpful if you are using Core Data, as in my situation. Any guidance greatly appreciated!

    Read the article

  • error prepareForSegue between a viewController and a tableViewController

    - by beta
    -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"My_TableView"]) { MyTableViewController *destViewController = segue.destinationViewController; destViewController.data = data; } } Hi, I have a problem doing a segue (modal) between a ViewController to a TableViewController. The name of the segue between the ViewController and the NavigationController is "My_TableView". Compiler gives me this error: unrecognized selector sent to instance 0x9275b50 what's the problem?

    Read the article

  • iPhone: increasing size of view frame in a UItabbarcontroller?

    - by dpigera
    I currently have a UITabBarController defined, with the tab bar moved a few pixels down to make it thinner: self.tabBarController = [[UITabBarController alloc] init]; self.tabBarController.tabBar.frame=CGRectMake(0,self.window.bounds.size.height-38.5,self.window.bounds.size.width,50); [self.window addSubview:self.tabBarController.view]; I then have a UIViewController object assigned to the first tab using: Home *home = [[Home alloc] initWithNibName:@"Home" bundle:nil]; UINavigationController *nHome = [[UINavigationController alloc] initWithRootViewController:home]; nHome.tabBarItem.image=[UIImage imageNamed:@"home.png"]; [tabBarController setViewControllers:[NSArray arrayWithObjects:nHome,nil]]; As a result, there is a thin sliver of space between the tabbarcontroller and the view. Can someone please tell me how I can get rid of this space?

    Read the article

  • Display TableViews corresponding to segmentedControl in a single tableview without pushing a new view

    - by user1727927
    I have a tableViewController where I have used the Interface Builder to insert a Segmented Controller having two segments. Since by default, first segment is always selected, I am not facing any problem in displaying the tableview corresponding to first segment. However, when I click on the second segment, I want to display another tableView. Here goes the problem. I am calling newTableViewController class on clicking the second segment. Hence, this view is getting pushed instead. Please suggest me a method to have these two tableViews in the main tableView upon clicking the segments. I have used switch case for switching between the segments. Here's the relevant part of the code: This method is in the FirstTableViewController since first segment is by default selected. -(IBAction) segmentedControlChanged { switch(segmentedControl.selectedSegmnentIndex) { case 0: //default first index selected. [tableView setHidden:NO]; break; case 1: NewViewController *controller=[[NewViewController alloc] initWithNibName:@"NewViewController" bundle:nil]; self.navigationController pushViewController:controller animated:YES]; [controller release]; break; default: break; } }

    Read the article

  • What is a good way for a custom accessory view in a UITableViewCell to message the table view contro

    - by Alex Gosselin
    Hi Everyone, I am working on adding a custom accessory view, (a button) to a UITableViewCell, and I need it to tell the table view when it is touched, but I can't figure out how to communicate to the table view what button was pressed. Ideally I'd like to somehow call a function like this: [controller tableView:view didSelectCustomButtonAtIndexPath:indexPath usingCell:self]; when my custom view button is pressed. Sorry if this is a bit vague, I'm not really sure how to explain this well. I am basically looking for how to mimic the implementation for tableView:didSelectRowAtIndexPath: without having to subclass UITableViewCell. Thanks for any help.

    Read the article

  • Unsure how i load the right data into a tableview, chosen from a previous tableview.

    - by Bob
    I currently have two TableViewControllers. The first has seven objects, each day-name listed. Weekdays *mandag = [[Weekdays alloc] initWithName:@"Mandag" daylist:mondayArray]; Weekdays *tirsdag = [[Weekdays alloc] initWithName:@"Tirsdag" daylist:tuesdayArray]; Weekdays *onsdag = [[Weekdays alloc] initWithName:@"Onsdag" daylist:wedensdayArray]; Weekdays *torsdag = [[Weekdays alloc] initWithName:@"Torsdag" daylist:thursdayArray]; Weekdays *fredag = [[Weekdays alloc] initWithName:@"Fredag" daylist:fridayArray]; Weekdays *lordag = [[Weekdays alloc] initWithName:@"Lørdag" daylist:saturdayArray]; Weekdays *sondag = [[Weekdays alloc] initWithName:@"Søndag" daylist:sundayArray]; daylist being a NSMutableArray. The idea is: The name of the day is displayed on table-1. And the array (daylist) of each day is displayed on table-2 - when tabbed one a day. The first table, displaying the names is working fine: VisueltSkemaAppDelegate *appDelegate = (VisueltSkemaAppDelegate *)[[UIApplication sharedApplication] delegate]; Weekdays *ugeDag = (Weekdays *)[appDelegate.ugeDage objectAtIndex:indexPath.row]; cell.textLabel.text = ugeDag.name; return cell; However i thought i could do the same, for the second table - but i have been strugling with it for hours now. This is what i got: VisueltSkemaAppDelegate *appDelegate = (VisueltSkemaAppDelegate *)[[UIApplication sharedApplication] delegate]; Weekdays *ugeDag = (Weekdays *)[appDelegate.ugeDage objectAtIndex:indexPath.row]; cell.textLabel.text = [ugeDag.daylist objectAtIndex:indexPath.row]; return cell; Abit more of the code: http://pastebin.com/iW5AAJXt

    Read the article

  • How can I replace a UITableViewController with a UIViewController that contains a UITableView?

    - by Dr Dork
    I created a new SplitView iPad project in Xcode and setup the code to populate the TableView (in the RootView on the left) with data. Now I'd like to customize the RootView to contain a DatePicker view along with the TableView, but I'm unsure how to accomplish this. Since the default RootViewController is a subclass of a UITableViewController, I couldn't add a DatePicker view to it in IB (since you can't add a DatePicker to a UITableView). The only way I understand to accomplish my goal of adding a DatePicker to the "Left" RootView is to change the RootViewController from a subclass of a UITableViewController to a subclass of a UIViewController, then I'll be able to add a view to it that contains a DatePicker view and a TableView using IB. Questions... Is this the correct approach to add a DatePicker to the "Left" RootView? If so and I change the RootViewController to a subclass of a UIViewController (instead of a UITableViewController) and add to it a TableView (along with the DatePicker), how will that affect the code I currently have in place for populating my current TableView? Thanks so much for all your help! Below is my current interface code for my RootViewController, if it'll help any. @interface RootViewController : UITableViewController <NSFetchedResultsControllerDelegate> { DetailViewController *detailViewController; NSFetchedResultsController *fetchedResultsController; NSManagedObjectContext *managedObjectContext; } @property (nonatomic, retain) IBOutlet DetailViewController *detailViewController; @property (nonatomic, retain) NSFetchedResultsController *fetchedResultsController; @property (nonatomic, retain) NSManagedObjectContext *managedObjectContext; - (void)insertNewObject:(id)sender; @end

    Read the article

  • [UITableViewController loadView] loaded the "PersonnalDetails" nib but didn't get a UITableView.

    - by tak
    I am trying to load a new view with the following code - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { PersonnelDetails *detailViewController = [[PersonnelDetails alloc] initWithNibName:@"PersonnelDetails" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:detailViewController animated:YES]; [detailViewController release]; } inhertance :- PersonnelDetails inherits UITableViewController but i am getting an exception : Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "PersonnalDetails" nib but didn't get a UITableView.' even though i have a UITableView in the PersonnalDetails nib and also i have connected the view outlet of PersonnelDetails(viewController) to the UITableView. what can be the posible cause?

    Read the article

  • Would you use a UITableViewController to implement a check list on the iPhone?

    - by Tony
    I am creating an application that will have a list of items that can be checked. I just implemented it as a Table View by subclassing UITableViewController. Now I am realizing that since individual items don't have a child view (i.e. clicking on an item "Dinner" does not need to pull up a child list of "Dinner Items") then maybe I should have just created a custom view for the list. In your experience, would it be better to use the Table View or create something custom? thanks! p.s. I am a bit new to iPhone dev, but NOT new to C

    Read the article

  • iPhone: Does it ever make sense for an object to retain its delegate?

    - by randombits
    According to the rules of memory management in a non garbage collected world, one is not supposed to retain a the calling object in a delegate. Scenario goes like this: I have a class that inherits from UITableViewController and contains a search bar. I run expensive search operations in a secondary thread. This is all done with an NSOperationQueue and subclasses NSOperation instances. I pass the controller as a delegate that adheres to a callback protocol into the NSOperation. There are edge cases when the application crashes because once an item is selected from the UITableViewController, I dismiss it and thus its retain count goes to 0 and dealloc gets invoked on it. The delegate didn't get to send its message in time as the results are being passed at about the same time the dealloc happens. Should I design this differently? Should I call retain on my controller from the delegate to ensure it exists until the NSOperation itself is dealloc'd? Will this cause a memory leak? Right now if I put a retain on the controller, the crashes goes away. I don't want to leak memory though and need to understand if there are cases where retaining the delegate makes sense. Just to recap. UITableViewController creates an NSOperationQueue and NSOperation that gets embedded into the queue. The UITableViewController passes itself as a delegate to NSOperation. NSOperation calls a method on UITableViewController when it's ready. If I retain the UITableViewController, I guarantee it's there, but I'm not sure if I'm leaking memory. If I only use an assign property, edge cases occur where the UITableViewController gets dealloc'd and objc_msgSend() gets called on an object that doesn't exist in memory and a crash is imminent.

    Read the article

  • iOS app with a lot of text

    - by rdurand
    I just asked a question on StackOverflow, but I'm thinking that a part of it belongs here, as questions about design pattern are welcomed by the faq. Here is my situation. I have developed almost completely a native iOS app. The last section I need to implement is all the rules of a sport, so that's a lot of text. It has one main level of sections, divided in subsections, containing a lot of structured text (paragraphs, a few pictures, bulleted/numbered lists, tables). I have absolutely no problem with coding, I'm just looking for advice to improve and make the best design pattern possible for my app. My first shot (the last one so far) was a UITableViewController containing the sections, sending the user to another UITableViewController with the subsections of the selected section, and then one strange last UITableViewController where the cells contain UITextViews, sections header help structure the content, etc. What I would like is your advice on how to improve the structure of this section. I'm perfectly ready to destroy/rebuild the whole thing, I'm really lost in my design here.. As I said on SO, I've began to implement a UIWebView in a UIViewController, showing a html page with JQuery Mobile to display the content, and it's fine. My question is more about the 2 views taking the user to that content. I used UITableViewControllers because that's what seemed the most appropriate for a structured hierarchy like this one. But that doesn't seem like the best solution in term of user experience.. What structure / "view-flow" / kind of presentation would you try to implement in my situation? As always, any help would be greatly appreciated! Just so you can understand better the hierarchy, with a simple example : -----> Section 1 -----> SubSection 1.1 -----> Content | -----> SubSection 1.2 -----> Content | -----> SubSection 1.3 -----> Content | | | UINavigationController -------> Section 2 -----> SubSection 2.1 -----> Content | -----> SubSection 2.2 -----> Content | -----> SubSection 2.3 -----> Content | -----> SubSection 2.4 -----> Content | -----> SubSection 2.5 -----> Content | -----> Section 3 -----> SubSection 3.1 -----> Content -----> SubSection 3.2 -----> Content |------------------| |--------------------| |-------------| 1 UITableViewController 3 UITableViewControllers 10 UIViewControllers (3 rows) (with different with a UIWebView number of rows)

    Read the article

  • iPhone - how to find a parent View

    - by Oscar Peli
    Hi there, I need some help to find a View inside a hierarchy. Here is how I build up the View stack. Inside my first UITableViewController I push an UIViewController that contains an UITabBarController: [[self navigationController] pushViewController:itemVC animated:YES]; Inside the UITabBarController I add an UITableViewController: ISSTableViewController *graphics = (ISSTableViewController *)[tabBarController.viewControllers objectAtIndex:3]; Inside the didSelectRowAtIndexPath I present a Modal View Controller using a UINavigationController: GraficoViewController *graph = [[GraficoViewController alloc] initWithNibName:@"GraficoViewController" bundle:nil]; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:graph]; [self presentModalViewController:navigationController animated:YES]; [navigationController release]; Now the (BIG) question is: I have to hide the NagivationBar of my first UITableViewController inside my last view. I tried with this: [[[[[self parentViewController] parentViewController] parentViewController] navigationController] setNavigationBarHidden:YES]; but it doesn't work. Can someone tell me how I can find my ancestor View??? Thanks.

    Read the article

  • How can I get a custom UITableView to automatically scroll to a selected text field?

    - by nornagon
    I have a UITableView, which I am controlling from a custom UIViewController. When the user clicks the 'add' button, I add a row to the UITableView with a text field in it, and make it the first responder. The problem is, when the bottom of the table is out of view (or hidden by the keyboard), the UITableView doesn't scroll to bring the text field into view. UITableViewController does this automatically, but my View Controller can't be a subclass of UITableViewController.

    Read the article

  • In short, how is NSFetchedResultsController used?

    - by mystify
    I'm reading now since one hour through the documentation and still don't get the point of NSFetchedResultsController. Is it a replacement for UITableViewController? Or is the UITableViewController using the NSFetchedResultsController? Is the NSFetchedResultsController the data source? What is it?

    Read the article

  • When and where should I add a view to a UITableView's footer?

    - by camelCase
    I am populating a UITableViewController's UITableView through code only. At the bottom of the table I wish to position a button that scrolls into view as the user scrolls to the bottom of the table. When in the UITableViewController life cycle should I populate the table footer with a button? viewDidLoad? p.s. I wish to avoid using section footers in the UITableView.

    Read the article

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