Search Results

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

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

  • NSURLConnection not "firing" until UITableView scrolls..

    - by Simon
    Hi, I've got a UITableView that loads an image asynchronously and places it in the UITableViewCell once it's loaded (I'm using almost the exact same code as in the "LazyTableImages" tutorial). This works fine for all images when I scroll the table, but it's not loading the images that are first in the view. The code is definitely working fine as the class that actually sends the NSURLConnection request is being called correctly (I added an NSLog and it reached the console). The NSURLConnection is just not calling the delegate methods (didReceiveData, connectionDidFinishLoading, etc). Here's my code: HomeController.m - (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]; NSArray *feed = [feeds objectAtIndex: indexPath.row]; /** * Name of person */ [...] /** * Feed entry */ [...] /** * Misc work */ [...] } FeedRecord *feedRecord = [self.entries objectAtIndex:indexPath.row]; if( !feedRecord.image ) { if (self.table.dragging == NO && self.table.decelerating == NO) { [self startIconDownload:feedRecord forIndexPath:indexPath]; } cell.imageView.image = [UIImage imageNamed:@"Placeholder.png"]; } return cell; } - (void)startIconDownload:(FeedRecord *)feedRecord forIndexPath:(NSIndexPath *)indexPath { IconDownloader *iconDownloader = [imageDownloadsInProgress objectForKey:indexPath]; if (iconDownloader == nil) { iconDownloader = [[IconDownloader alloc] init]; iconDownloader.feedRecord = feedRecord; iconDownloader.indexPathInTableView = indexPath; iconDownloader.delegate = self; [imageDownloadsInProgress setObject:iconDownloader forKey:indexPath]; [iconDownloader startDownload]; [iconDownloader release]; } } IconDownload.m #import "IconDownloader.h" #import "FeedRecord.h" #define kAppIconHeight 48 @implementation IconDownloader @synthesize feedRecord; @synthesize indexPathInTableView; @synthesize delegate; @synthesize activeDownload; @synthesize imageConnection; #pragma mark - (void)dealloc { [feedRecord release]; [indexPathInTableView release]; [activeDownload release]; [imageConnection cancel]; [imageConnection release]; [super dealloc]; } - (void)startDownload { NSLog(@"%@ %@",@"Started downloading", feedRecord.profilePicture); // this shows in log self.activeDownload = [NSMutableData data]; // alloc+init and start an NSURLConnection; release on completion/failure NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest: [NSURLRequest requestWithURL: [NSURL URLWithString:feedRecord.profilePicture]] delegate:self]; self.imageConnection = conn; NSLog(@"%@",conn); // this shows in log [conn release]; } - (void)cancelDownload { [self.imageConnection cancel]; self.imageConnection = nil; self.activeDownload = nil; } #pragma mark - #pragma mark Download support (NSURLConnectionDelegate) - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { NSLog(@"%@ %@",@"Got data for", feedRecord.profilePicture); [self.activeDownload appendData:data]; } - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { NSLog(@"%@",@"Fail!"); // Clear the activeDownload property to allow later attempts self.activeDownload = nil; // Release the connection now that it's finished self.imageConnection = nil; } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { NSLog(@"%@ %@",@"Done", feedRecord.profilePicture); // Set appIcon and clear temporary data/image UIImage *image = [[UIImage alloc] initWithData:self.activeDownload]; self.feedRecord.image = image; self.activeDownload = nil; [image release]; // Release the connection now that it's finished self.imageConnection = nil; NSLog(@"%@ %@",@"Our delegate is",delegate); // call our delegate and tell it that our icon is ready for display [delegate feedImageDidLoad:self.indexPathInTableView]; } @end Has anyone else experienced anything like this or can identify an issue with my code? Thanks!

    Read the article

  • App is crashing as soon as UITableView gets reloaded

    - by OhhMee
    Hello, I'm developing an app where TableView needs to reload as soon as the login process gets completed. The app crashes with error EXC_BAD_ACCESS when the table data gets reloaded. It doesn't crash when I remove all case instances except case 0: What could be the reason behind it? Here's the code: - (void)viewDidLoad { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginDone:) name:@"loginDone" object:nil]; statTableView.backgroundColor = [UIColor clearColor]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger) section { return 6; } - (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]; } // Configure the cell. switch (indexPath.row) { case 0 : cell.textLabel.text = @"Foo:"; NSLog(@"%@", data7); UILabel *myLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 20, 30)]; myLabel2.text = (@"%@", data7); myLabel2.textColor = [UIColor blackColor]; myLabel2.backgroundColor = [UIColor whiteColor]; myLabel2.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel2]; break; case 1: cell.textLabel.text = @"Foo: "; UILabel *myLabel4 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 20, 30)]; myLabel4.text = (@"%@", data11); myLabel4.textColor = [UIColor blackColor]; myLabel4.backgroundColor = [UIColor whiteColor]; myLabel4.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel4]; break; case 2: cell.textLabel.text = @"Foo: "; UILabel *myLabel8 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 20, 30)]; myLabel8.text = (@"%@", data3); myLabel8.textColor = [UIColor blackColor]; myLabel8.backgroundColor = [UIColor whiteColor]; myLabel8.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel8]; break; case 3: cell.textLabel.text = @"Foo: "; UILabel *myLabel10 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 20, 30)]; myLabel10.text = [NSString stringWithFormat:@"%@", data4]; if ([data4 isEqualToString:@"0"]) { myLabel10.text = @"None"; } myLabel10.textColor = [UIColor blackColor]; myLabel10.backgroundColor = [UIColor whiteColor]; myLabel10.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel10]; break; case 4: cell.textLabel.text = @"Foo: "; UILabel *myLabel12 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 20, 30)]; myLabel12.text = [NSString stringWithFormat:@"%@", data5]; myLabel12.textColor = [UIColor blackColor]; if ([data5 isEqualToString:@"Foo"]) { myLabel12.textColor = [UIColor redColor]; myLabel12.text = @"Nil"; } myLabel12.backgroundColor = [UIColor whiteColor]; myLabel12.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel12]; break; case 5: cell.textLabel.text = @"Foo: "; UILabel *myLabel14 = [[UILabel alloc] initWithFrame:CGRectMake(200, 10, 50, 30)]; if ([data6 isEqualToString:@"Foo"]) { myLabel14.textColor = [UIColor colorWithRed:(0/255.f) green:(100/255.f) blue:(0/255.f) alpha:1.0]; myLabel14.text = @"No Dues"; } else { myLabel14.text = [NSString stringWithFormat:@"%@", data6]; myLabel14.textColor = [UIColor redColor]; } myLabel14.backgroundColor = [UIColor whiteColor]; myLabel14.font = [UIFont fontWithName:@"Trebuchet MS" size:14]; [cell.contentView addSubview:myLabel14]; break; /* [myLabel2 release]; [myLabel4 release]; [myLabel8 release]; [myLabel10 release]; [myLabel12 release]; [myLabel14 release]; */ } return cell; }

    Read the article

  • UITableView Core Data reordering

    - by PCWiz
    I know this question has been asked before, and I took a look at the answer to this question. However, I'm still confused as to how to implement reordering with a UITableView in a Core Data project. What I know is that I need to have a "displayOrder" attribute in my Entity to track the order of items, and I need to enumerate through all the objects in the fetched results and set their displayOrder attribute. In the given code in the question I linked to, the table view delegate method calls a method like this [self FF_fetchResults];, and the code for that method is not given so its hard to tell what exactly it is. Is there any sample code that demonstrates this? That would be simpler to look at than sharing large chunks of code. Thanks

    Read the article

  • UITableView Core Data reordering

    - by PCWiz
    I know this question has been asked before, and I took a look at the answer to this question. However, I'm still confused as to how to implement reordering with a UITableView in a Core Data project. What I know is that I need to have a "displayOrder" attribute in my Entity to track the order of items, and I need to enumerate through all the objects in the fetched results and set their displayOrder attribute. In the given code in the question I linked to, the table view delegate method calls a method like this [self FF_fetchResults];, and the code for that method is not given so its hard to tell what exactly it is. Is there any sample code that demonstrates this? That would be simpler to look at than sharing large chunks of code. Thanks

    Read the article

  • Change Default Scrolling Behavior of UITableView Section Header

    - by davidjhinson
    I have a UITableView with two sections. It is a simple table view. I am using viewForHeaderInSection to create custom views for these headers. So far, so good. The default scrolling behavior is that when a section is encountered, the section header stays anchored below the Nav bar, until the next section scrolls into view. My question is this: can I change the default behavior so that the section headers do NOT stay anchored at the top, but rather, scroll under the nav bar with the rest of the section rows? Am I missing something obvious? Thanks.

    Read the article

  • How to scroll to the bottom of a UITableView on the iPhone before the view appears

    - by acqu13sce
    I have a UITableView that is populated with cells of a variable height. I would like the table to scroll to the bottom when the view is pushed into view. I currently have the following function NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[log count]-1 inSection:0]; [self.table scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:NO]; log is a mutable array containing the objects that make up the content of each cell. The above code works fine in viewDidAppear however this has the unfortunate side effect of displaying the top of the table when the view first appears and then jumping to the bottom. I would prefer it if the table view could be scrolled to the bottom before it appears. I tried the scroll in viewWillAppear and viewDidLoad but in both cases the data has not been loaded into the table yet and both throw an exception. Any guidance would be much appreciated, even if it's just a case of telling me what I have is all that is possible.

    Read the article

  • UITableView backgroundColor always gray on iPad

    - by rjobidon
    Hi, When I set the backgroundColor for my UITableView it works fine on iPhone (device and simulator) but NOT on the iPad simulator. Instead I get a light gray background for any color I set including groupTableViewBackgroundColor. Steps to reproduce: Create a new navigation-based project. Open RootViewController.xib and set the table view style to "Grouped". Add this responder to the RootViewController:- (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor blackColor]; } Select Simulator SDK 3.2, build and run. You will get a black background (device and simulator). Select your target in the project tree. Click on Project : Upgrade Current Target for iPad. Build and run. You will get a light gray background. Revert the table view style to Plain and you will get a black background. Thanks for your help!

    Read the article

  • Reference from UITableViewCell to UITableView to UINavigationController

    - by Nick
    If the user taps and holds on a Foo table view cell for 2 seconds, a modal view should be shown. The modal view is also displayed when a new Foo is added to the cell. The modal view's delegate protocol is implemented by the parent UITableView subclass. My tap and hold detection code is in the Foo UITableViewCell class. I'm having difficulty referencing the parent tableview's navigation controller to display the modal view. FooModalViewController *modalController = [[FooModalViewController alloc] initWithNibName:@"FooModalViewController" bundle:nil]; FooTableViewController *tableView = (FooTableViewController *) self.superview; foo.delegate = tableView; Seems OK but I'm having problems referencing the navigation controller that contains the tableview.. The code below builds OK but throws an exception - NSOBject DoesNotRecognizeSelector. UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:modalController]; [[tableView.navigationController] presentModalViewController:navigationController animated:YES]; I think that perhaps my design is flawed..?

    Read the article

  • UITableView like Contact App

    - by Matthias
    Hi, I try to create an UITableView similar to the Standard Contact App, when selecting a contact (i.e. grouped style). But how do I get some controls at the top or at the bottom of the cells, which scroll with the rest? In the Contact App you have at the top the picture together with the name and at the bottom three buttons. Are these just special customized Cells? Or can you have controls directly there? Thanks for your help! Regards Matthias

    Read the article

  • UITextField in UITableView to becomeFirstResponder.

    - by f0rz
    Hi ! I have a problem which I dont have a clue how to work around. Maybe anyone of you could help me to the correct directions... Simple I have a UITableView with each cell containing a UITextField. When I´m editing a cell (UITextField) and hit Return Key, a new row is inserted under the current cell. After that I reloadData on the TableView, the new row is showed. Everything is OK here. Now to my problem, I want to [UITextField becomeFirstResponder] on the newest added row. But I could not find anyway to accomplish this. I could post code but didn't find that necessary. Cheers.

    Read the article

  • Edit, select value from UITableView on the iPhone

    - by Anthony D
    I have a UITableView with a list of names, representing server configurations. I want the user to be able to select a server configuration, add a server config, edit a server config, or just cancel out of the view and return to the main view. I'm having a hard time trying to figure out how to achieve all of that functionality in this view. To select, the user should be able to just tap the server config name and a check will appear next to the name then the user is taken back to the main view automatically (or use a save button instead?). To edit the server config, I would also like the user to be able to tap the server config name and be taken to a detail screen where changes can be made. How can I accomplish both since I want both to be done by tapping the server name (row)? Right now the cancel button seems out of place since the screen is accessed via a UINavigationController. Any suggestions?

    Read the article

  • Edite, select value from UITableView on the iPhone

    - by Anthony D
    I have a UITableView with a list of names, representing server configurations. I want the user to be able to select a server configuration, add a server config, edit a server config, or just cancel out of the view and return to the main view. I'm having a hard time trying to figure out how to achieve all of that functionality in this view. To select, the user should be able to just tap the server config name and a check will appear next to the name then the user is taken back to the main view automatically (or use a save button instead?). To edit the server config, I would also like the user to be able to tap the server config name and be taken to a detail screen where changes can be made. How can I accomplish both since I want both to be done by tapping the server name (row)? Right now the cancel button seems out of place since the screen is accessed via a UINavigationController. Any suggestions?

    Read the article

  • UITableView backgroundColor always grey on iPad

    - by rjobidon
    Hi, When I set the backgroundColor for my UITableView it works fine on iPhone (device and simulator) but NOT on the iPad simulator. Instead I get a light grey background for any color I set including groupTableViewBackgroundColor. Steps to reproduce: Create a new navigation-based project. Open RootViewController.xib and set the table view style to "Grouped". Add this responder to the RootViewController:- (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor blackColor]; } Select Simulator SDK 3.2, build and run. You will get a black background (device and simulator). Select your target in the project tree. Click on Project : Upgrade Current Target for iPad. Build and run. You will get a light grey background. Revert the table view style to Plain and you will get a black background. Thanks for your help!

    Read the article

  • UITableview titleForHeaderInSection not displaying correctly

    - by mjdth
    I have some VERY simple code to return the title for a section header: - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { if (section==0) { return @""; } else if (section==1) { return @"Actions"; } else if (section==2) { return @"Attached To"; } return @""; } For some reason when the headers are actually displayed on the simulator, half of the time they're simply the first letter and then ellipses. Scrolling up and down (to refresh the header view most likely) will result in the title showing correctly roughly half the time and showing incorrectly the other half of the time. Do anyone have any idea what could be causing this? I think this is more of a recent development, but it seems to happen in almost all UITableViews in my application. I don't want to say this is a 3.2 issue, but it might have started happening around then, but either way it must be related to the code somehow. Thank you.

    Read the article

  • UITableView titleForHeaderInSection prints headers to console twice then crashes

    - by joec
    In the method below titleForHeaderInSection, for some reason the NSLog prints out the headers twice and then the app crashes in objc_msgSend. I can't understand why this would cause the app to crash? It would seem from research that crashes in objc_msgSend are caused by sending messages to already freed objects, but is that the case here? My sectionNames array is populated in viewDidLoad. - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { NSString *title = nil; title=[sectionNames objectAtIndex:section]; NSLog(title); return title; } Thanks

    Read the article

  • Monotouch UIScrollView/UIPageView with UITableView as panel

    - by cvista
    Hi I'm building an app which is a guide to festivals. In the app I show lineups. You can see the Ui I have built for this on the video here: http://wmcstar.com/download.html The problem I have is that the scrollview/UIPageView - which does the left/right scrolling through the days, sometimes conflicts (i think) with the up/down scrolling of the days lineup UITableView and crashes. It doesn't crash if I disable scrolling - so the only way to switch between days is by selecting the day and programatically scrolling to the day rather than by using touch gestures. Has anyone else seen this behaviour? w://

    Read the article

  • OpenGl es view and uitableview

    - by Mel
    I have written an application using opengl es view. Now I want to add a uitableview to display on the screen. However I am needing some guidance on how opengl es view and the other views play together nice. For example I have read some things that would lead me to think I need to pause the opengl view when the table is displayed. Can anyone point me to a tutorial on how to make these things work together or just point me to the stackoverflow question that I can't find where some guy asked the same exact thing and got an answer :-)

    Read the article

  • iPhone: Having trouble figuring out how to scroll a UITableView with custom UITextField cells automa

    - by Gordon Fontenot
    Ok, I know this seems like a duplicate question, but don't think it is. I actually have this implemented already (thanks to this SO question), but it seems sluggish. I am willing to tweak it a bit, but I ran across a demo app by AboutObjects that seems to have exactly the right functionality with absolutely no code doing it. I have looked through their demo code dozens of times, and I can't figure out what they are doing that I am not. The code to look at is in their iPhone Development Tutorials section, and is called "Editable TableView" (2nd from the bottom). There are a couple of questions on the forums on that site asking how they got the functionality, but there is no answer (other than "It's a built in function"). Does anyone have any clue as to why their UITableView would implement the input scrolling by default (including being able to scroll the view manually when the keyboard pops up, which I cannot get to work)?

    Read the article

  • UILabel background color not updating in UITableView

    - by Joey
    I'm having a perplexing problem with a simple UILabel I put on a cell in a UITableView. I enter a separate view after tapping on a row, like many UITableViews. In there, I update the cell so that when I return to the rows, it should be updated, with this: MyTableViewCell* cell = (MyTableViewCell*) [mTableView cellForRowAtIndexPath: [NSIndexPath indexPathForRow:mActiveRow inSection:0]]; cell.myLabel.text = @"New Value"; // updated text cell.myLabel.backgroundColor = [UIColor greenColor]; // updated color When I return, though, only the text is updated, not the color. When I scroll the row off the screen and return it refreshes properly via another path of code that has exactly the same code. Could there be some trigger to refresh specifically the background color of the UILabel? I'm not sure why the text will refresh but the color won't.

    Read the article

  • Scroll UITableView so that the header isn't visible

    - by DASKAjA
    I've got a UITableView with a UISearchBar as the tableViews.tableHeaderView. Just like the new Mail.app, Notes.app, etc. in 3.0. I want to hide the SearchBar until the user drags it in his sight. My attempt only works when there're a couple of items in the tableView, so that the tableView actually wants to scroll. I call this in loadView: NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; [self._tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:NO]; Nevertheless it seems that Apple handles such a serachbar differently. After draging out the searchbar it doesn't seem to be bounded to the tablecells anymore (in Notes.app, not in Mail.app). But perhaps Apple has a distinct method for that new 3.0 behaviour, and I just can't find it?

    Read the article

  • 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

  • Custom Scrollbar for UITableView

    - by iFloh
    the iTunes song list display is a TableView that has a dotted scrollbar on the right which allows me to jump to a relative position of the list (i.e. if I click the bar at 2/3 down I am scrolled to the 66% position of the list. I want to do the same in my UITableView, but am not sure whether this is standard functionality that I can use (which class?) or whether this is a custom build ... If the latter, has someone got some samplecode that I could use as a template?

    Read the article

  • how to play video files by using UITableView?

    - by srikanth rongali
    Hi, In my iPhone application I need to show a video image in UITableView. Each tableViewCell have video and some labels. I used the MPMoviePlayerController for showing video in full screen when the cell is selected. But, I am getting error that MPMoviePlayerController class is not there. I tried using UIWebView. But, I could not make it. How can I play a video, when the cell is selected. Some say that videos do not play in simulator. They only play when we test in device. Is it right ? Please help me with the solution. Thank You.

    Read the article

  • problem with adding tool bar to UITableView

    - by chnet
    I'm writing a Navigation-Based iPhone app, and I'd like to have a UIToolBar docked at the bottom of my screen, with a UITableView scrolling between the tool bar and the navigation bar. I used [[self navigationController] setToolbarHidden:NO] and - (void)setToolbarItems:(NSArray *)toolbarItems animated:(BOOL)animated to set the UIToolBar. UIToolBar correctly shows in current view. If I drill down into a detail view using the button on navigation bar, i cannot return back to previous view. Before I add the tool bar, it can return back. I am wondering is there anything else should be noted when use UIToolbar?

    Read the article

  • iPhone App Development - UITableView DetailsView

    - by leo
    Hi, I have a UITableView with a list of items such as item1, item2, item3, item4 and so on. If I select on item1, it will go to the detail view of item1 (which is controlled by DetailsViewController). What I am trying to do is to add a button called "Next" on DetailsView. When clicked, the DetailsView will refresh and show item2. When clicked again, it will show item3 and so on. I have been searching high and low for that to implement. But to no avail. Many thanks in advance!!!

    Read the article

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