Search Results

Search found 173 results on 7 pages for 'reloaddata'.

Page 4/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • UITableView gives empty table, does not load data

    - by Alex L
    Hi, Everything works fine when the view that holds my table is the main (first) view. However, when it's not the first view and I switch into that view, my table does not load data and I get an empty table. Using NSLog I can tell that the program is not invoking numberOfRowsInSection and cellForRowAtIndexPath. I have <UITableViewDataSource, UITableViewDelegate>, IBOutlet UITableview *tableView all declared. They are also connected in the InterfaceBuilder. I tried using viewWillAppear and [tableView reloadData] but that did not help. I'm new to iPhone development and your help is appreciated!

    Read the article

  • iPad: CoreData FetchedRequest Ignores Changes in Predicate

    - by Michael
    Hi there, While programming an iPad-app, I'm just running into trouble using a fetchedResultsController with a "dynamic" predicate. it seems the changes to the predicate get ignored. No matter how the predicate changes, I always get the result of the first fetch ... same code runs without no problems on iphone-env (3.1.x) !! sample : - (void)performSearch:(NSString *)searchText { self.displaySearchResults = TRUE; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"searchWords contains[cd] %@", searchText]; [self.fetchedSearchResultsController.fetchRequest setPredicate:predicate]; NSError *error = nil; if (![self.fetchedSearchResultsController performFetch:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } if(deviceIsIPad) { [self showSearchResults]; } else { [cookBookOverview reloadData]; } } can anyone help plz ? btw.: excuse my painful english ;-)

    Read the article

  • iPhone equivalent of Application.DoEvents();

    - by BahaiResearch.com
    iPHone: We use MonoTouch, but Obj-C answers are ok. My singleton domain object takes a while to get all the data so it runs internally parts of the fetch in a thread. I need to inform the UI that the domain is done. Currently I do this. Is there a better way? In WinForms I would call Application.DoEvents() instead of Thread Sleep. PlanDomain domain = PlanDomain.Instance (); while (domain.IsLoadingData) { Thread.Sleep (100); //this is the main UI thread } TableView.Hidden = false; TableView.Source = new TableSource (this); TableView.ReloadData ();

    Read the article

  • pushViewController for same instance - only for animation purpose

    - by techastute
    Hi there, I am having single table view in a view controller. That table view lists the countries first. When I click on a country(row), it has to push the same view controller's view with cities under that country. I need to see the slide animation, which we usally get while pushing views in navigator. Is it possible to use the pushViewController for the same view controller by calling the tableView reloadData with city data (This should happen when country is selected) ? Please let me know whether it is possible.. Thanks in advance.. Raj

    Read the article

  • Why does my app crash when I add an row to the table view?

    - by mystify
    I'm adding a row like this, when a button is pressed. It must be the very first row in the first section: NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; [self insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; I don't call anything else here. No -reloadData. I keep getting this: * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (6) must be equal to the number of rows contained in that section before the update (6), plus or minus the number of rows inserted or deleted from that section (1 inserted, 0 deleted).'

    Read the article

  • Update tableview instantly as data pushed in core data iphone

    - by user336685
    I need to update the tableview as soon as the content is pushed in core data database. for this AppDelegate.m contains following code NSManagedObjectContext *moc = [self managedObjectContext]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; [request setEntity:[NSEntityDescription entityForName:@"FeedItem" inManagedObjectContext:moc]]; //for loop // push data in code data & then save context [moc save:&error]; ZAssert(error == nil, @"Error saving context: %@", [error localizedDescription]); //for loop ends This code triggers following code from RootviewController.m - (void)controllerWillChangeContent:(NSFetchedResultsController*)controller { [[self tableView] beginUpdates]; } But this updates the tableview only at the end of the for loop ,the table does not get updated after immediate push in db. I tried following code but that didn't work - (void)controllerDidChangeContent:(NSFetchedResultsController *)controller { // In the simplest, most efficient, case, reload the table view. [self.tableView reloadData]; } I have been stuck with this problem for several days.Please help.Thanks in advance for solution.

    Read the article

  • Animating Reloading of UITableView

    - by ustun
    I am trying to animate table rows in a UITableView in an iPhone project as I swipe across the screen to reload the data. When I disable animations and only call reloadData, table continues responding to swipe gestures. When I add animations with the reloadSections:WithRowAnimation: method, table stops responding to swipes, and only the navigation bar at the top responds to swipes. Another change is that, table starts responding to selection and I have to manually disable it again. I suspect these two issues might be related. I am using the swipe detection code over here btw: 1

    Read the article

  • UITableView becomes invisible after changing data in it

    - by Alexander Shemshurenko
    Hi I have application with TabBar that control several views. In one view i control connection to different servers.Each server provides different set of items. I display these items in UITableView on other view. I create table view like this UITableView * aTableView = [[UITableView alloc] initWithFrame:CGRectMake(X,Y,Width,Height) style:UITableViewStyleGrouped]; [[self view] addSubview:aTableView]; aTableView.da taSource = self; The problem is that Table view displayed ok first time , but if i go back to view number one and change server(changing list of items that should be displayed in table view), table view becomes invisible for some reason. If i tap on the screen in place where it should be, its becomes visible again. Ive tried to call to reloadData and setNeedDisplay in viewWillAppear of the UIViewController that hosts this table view, but without success. Any advice? Thanks

    Read the article

  • UITableView Animation when entering Editmode

    - by f0rz
    Hi! Maybe I´m just stupid but I cant understand why this isnt working. I want to achieve a little animation when I'm entering editing mode within a UITableView. [super setEditing:NO animated:YES]; [myTable setEditing:NO animated:YES]; [myTable reloadData]; [self.navigationItem.leftBarButtonItem setTitle:@"Edit"]; [self.navigationItem.leftBarButtonItem setStyle:UIBarButtonItemStylePlain]; Shouldnt this animated:YES suppose to animated this entering of the editmode? Regards. - f0rz

    Read the article

  • Including a NSUserDefault password test in 1st Tab.m to load a loginView gives eror?

    - by Michael Robinson
    I have a name and password in NSUserDefaults for login. I have this in my 1stTab View.m class to test for presence and load a login/signup loginView.xib modally if there is no password or name stored in the app. Here is the pulling of the defaults: -(void)refreshFields { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; usernameLabel.text = [defaults objectForKey:kUsernameKey]; passwordLabel.text = [defaults objectForKey:kPasswordKey]; { Here is the Test: - (void)viewDidAppear:(BOOL)animated { [self refreshFields]; [super viewDidAppear:animated]; if ([usernameLabel.text length] == 0 || [passwordLabel.text length] == 0) { LoginViewController * vc = [[[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil] autorelease]; [self presentModalViewController:vc animated: false]; } else { [[self tableView ]reloadData]; } } Thanks in advance, I'm getting this error in the console: * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key usernameLabel.'

    Read the article

  • Password test in 1st Tab.m to load a loginView gives class error?

    - by Michael Robinson
    I have a name and password in NSUserDefaults for login. I have this in my 1stTab View.m class to test for presence and load a login/signup loginView.xib modally if there is no password or name stored in the app. Here is the pulling of the defaults: -(void)refreshFields { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; usernameLabel.text = [defaults objectForKey:kUsernameKey]; passwordLabel.text = [defaults objectForKey:kPasswordKey]; { Here is the Test: - (void)viewDidAppear:(BOOL)animated { [self refreshFields]; [super viewDidAppear:animated]; if ([usernameLabel.text length] == 0 || [passwordLabel.text length] == 0) { LoginViewController * vc = [[[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil] autorelease]; [self presentModalViewController:vc animated: false]; } else { [[self tableView ]reloadData]; } } Thanks in advance, I'm getting this error in the console: * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key usernameLabel.'

    Read the article

  • Where I should call [object release] ?

    - by mongeta
    Hello, I've subclassed some UITextField and added some custom properties. In a UITableViewController, in the ViewDiDLoad I init them, and in the cellForRowAtIndexPath I add them to the cell with [cell.contentView addSubview:customTextField]; Each cell has a different customTextField as all of them are very different. Where I should call the [customTextField release] ? After I add them to the cell view ? If for example I call [self.tableView reloadData] my customTextField are going to be added again to the cell, so maybe I should change my approach in doing this ? thanks for the orientation ... regards, r.

    Read the article

  • How to solve the leaks when allocating the NSMutableArray in Objective-C

    - by Madan Mohan
    Hi Guys, I am getting leaks in Master view controller of iPhone. When I call this method, I am inserting them into filteredListCount array, because when I search I need to show the list from filteredListCount array otherwise customerArray. This functionality is working fine but I am getting leaks in the method below at allocation: filteredListCount = [[NSMutableArray alloc] initWithCapacity: [customerArray count]]; This is the first view controller of my application, I am showing the list and I am also allowing to search from a list. - (void)parser:(CustomerListLibXmlParser *)parser addCustomerObject:(Customer *)customerObj1 { [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; [customerArray addObject:customerObj1]; filteredListCount = [[NSMutableArray alloc] initWithCapacity: [customerArray count]]; [filteredListCount addObjectsFromArray: customerArray]; [theTableView reloadData]; } - (void)parser:(CustomerListLibXmlParser *)parser encounteredError:(NSError *)error { } - (void)parserFinished:(CustomerListLibXmlParser *)parser { [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; self.title=@"Customers"; }

    Read the article

  • UITableView Reload Data

    - by william-hu
    Hi, i used UITableView to show the info which was get for server. - (void)viewWillAppear:(BOOL)animated { //Create connection } Then i put the received data into array : NSSArray *dataFromServer: Then i want to show the data on each cell (some NSString object). As the connection was release, i call [self.tableView reloadData] , but cant work. So i'd like to know, how to make this? It means cellForRowAtIndexPath: has nothing at beginning, but after few seconds, shows something. Thank you so much!

    Read the article

  • How do you delete a core data entry from the detail view?

    - by Sam
    I am working with an app similar to apple's core data recipes sample code. I want to be able to delete the entry from the detail view, much like apple's contacts app. The code below is deleting the 1st entry and not the selected entry. Not sure what I am doing wrong. NSIndexPath *indexPath = [myTableView indexPathForSelectedRow]; NSManagedObjectContext *context = [fetchedResultsController managedObjectContext]; [context deleteObject:[fetchedResultsController objectAtIndexPath:indexPath]]; [myTableView reloadData];

    Read the article

  • iPhone - Launching selectors from a different class

    - by David Schiefer
    Hi, I'd like to reload a table view which is in another class called "WriteIt_MobileAppDelegate" from one of my other classes which is called "Properties". I've tried to do this via the NSNotificationCenter class - the log gets called but the table is never updated. Properties.h: [[NSNotificationCenter defaultCenter] postNotificationName:@"NameChanged" object:[WriteIt_MobileAppDelegate class] userInfo:nil]; WriteIt_MobileAppDelegate.m -(void)awakeFromNib { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadItProperties:) name:@"NameChanged" object:self]; } - (void) reloadItProperties: (NSNotification *)notification { NSLog(@"Reloading Data"); //this gets called [self.navigationController popToRootViewControllerAnimated:YES]; [self.tblSimpleTable reloadData]; [self.tblSimpleTable reloadSectionIndexTitles]; // but the rest doesn't } What am I doing wrong here?

    Read the article

  • reloading table

    - by edie
    Hi... I've have a table view that consist of item list that depends on the item that were purchased using in app purchasing. My question was how can I reload the tableView when the purchasing was completed/(or when new item was added on my list). The response of the storekit takes time to complete. Are there anyways to tell the app that the purchasing was completed and new item was added on my list so that I can reload my tableView. At this time I reloading my table view by adding [myTableView reloadData] in viewWillAppear method. But what if the user was already viewing the tableView, I can't reload the tableView because the viewWillAppear had passed. thanks...

    Read the article

  • Why Instruments report a leak?

    - by mike
    Hi, I am developing an iphone app. Instruments reported a leaked object ServiceTypes. Below is the relevant code. Does anyone have any ideas? Thanks a lot for your help. ServiceTypes *serviceTypes = [[ServiceTypes alloc] init]; if ([userConnection getServiceTypes:serviceTypes]) { if ([serviceTypes.types length] 0) { NSArray *array = [[NSArray alloc] initWithArray:[serviceTypes.types componentsSeparatedByString: SERVICE_TYPE_DELIMITOR]]; serviceRequestTypes = [[NSMutableArray alloc] initWithArray:array]; [array release]; } } [[self typesTableView] reloadData]; [serviceTypes release];

    Read the article

  • Show image from url in uiimageview

    - by skiria
    I try to show a image in my iphone app but it doesn't show. I connect in IB and I check to show a local image, it workd good. I also check the url from image and it is ok. I use the next code: NSURL *imageURL = [NSURL URLWithString: aVideo.urlThumbnail]; NSData *imageData = [NSData dataWithContentsOfURL:imageURL]; UIImage *image = [UIImage imageWithData:imageData]; imageView.image = image; and //Video.h NSString *urlThumbnail; and this is my code on the view. - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [tableView reloadData]; } - (void)viewDidLoad { [super viewDidLoad]; NSURL *imageURL = [NSURL URLWithString: aVideo.urlThumbnail]; NSData *imageData = [NSData dataWithContentsOfURL:imageURL]; UIImage *image = [UIImage imageWithData:imageData]; imageView.image = image; }

    Read the article

  • Trouble refreshing UITableView

    - by aahrens
    I'm trying to develop a basic GPA Calculator. I have an AllCourses class that holds Course objects. I have an AllCourses object in my CalcAppDelegate. In my ThirdViewController I can successfully update the number of Courses in my AllCourses object. However, the problem I'm having is that when I switch to the RootViewController the UITable isn't being repopulated with the updated Courses that were added. I tried [self reloadData] in the viewWillAppear in my RootViewController but it caused my app to close. I didn't use IB to create the views so I think it could be the case that I don't have things hooked up correctly. I did it programatically. Does anyone see anything I'm missing in my code? Here is the link to my project http://files.me.com/aahrens/q0odzi

    Read the article

  • UITableView: Need a liveUpdate (Huge amount of cells)

    - by antihero
    Hey all, I have a UITableView which shows some information. The informations are from a XMLFile. The Xmlfile is pretty big, about 500 entries. I don't want that the user has to wait until the parsing has finished, i want to add cell by cell to the TableView. Here's my code: -(void) onFinishedPartDownload:(id)item { if(odvTableViewDelegateController.odvs == nil) odvTableViewDelegateController.odvs = [NSMutableArray new]; if([odvTableViewDelegateController.odvs count]==0) { genericDelegate.tableView.delegate = odvTableViewDelegateController; genericDelegate.tableView.dataSource = odvTableViewDelegateController; } [odvTableViewDelegateController.odvs addObject:item]; [genericDelegate.tableView reloadData]; } This method is called everytime an item has parsed, but it reloads the tableView all at once at the end. I don't have my expected liveUpdate which i'm searching for. The intervall the method is called is about 0.001 to 0.0025 seconds. Any ideas to fix that? Sebastian

    Read the article

  • Why does the last row of my tableview not align to the bottom of the screen

    - by Liam
    I have a view which consists of a tableview and a navigation bar. For my tableview I have implemented a 'Load more' row which will load current + pagesize every time it is clicked The way the loading works is very simple, every time it is clicked I just request the amount of rows I want to display e.g. 5, 10, 15 and so on. This request populates an array and I call [self.tableView reloadData] The issue I am experiencing is that when I go to the tableview the first time, it correctly loads and displays the tableview. However, if I 'Load more' it returns the correct amount and displays the correct number of cells but the last cell will not fit properly at the bottom of the screen, about 1/2 of it (or roughly the size of the navigation bar of the cell) appears below the bottom of the screen. I thought it was sufficient to just tell the tableview to reload itself. Do I need to use [self.tableView insertRowsAtIndexPaths ...] to do this.

    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

  • How to access JSON values(array) in various tables

    - by ramya
    Hi, I am getting results from JSON, NSDictionary *pname=[[res objectAtIndex:i] objectForKey:@"ax21:productName"]; NSString *str = [pname objectForKey:@"$"]; i++; [detArray addObject:str]; [tblviewhome reloadData]; and calling it in table like cell.textLabel.text = [detArray objectAtIndex:indexPath.section]; this displays data in 4 sections.This is displaying data perfectly . JSON connectivity and table are in same class. but how to access this data in another table which is in another view controller. I hope i made my self clear.

    Read the article

  • Reranging a uitableview

    - by Nicolay
    Hallo @ All I ran into the same problem as desciped in http://stackoverflow.com/questions/1884491/crashing-while-trying-to-move-uitableview-rows! All I want to do is on specific reranging operations insert a new cell or delet the selected one! Sometimes I get a * Assertion failure in -[_UITableViewUpdateSupport _setupAnimationForReorderingRow], /SourceCache/UIKit/UIKit-963.10/UITableViewSupport.m:295 Attempt to create two animations for cell exception and when I want to reload my data by calling [self.tableView reloadData] I get a * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)' This is quiet anoying! Is there anybody out there who knows how to handle this problem? Please help me!

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >