Search Results

Search found 1119 results on 45 pages for 'tableview'.

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

  • iphone tableview within detailview

    - by pete
    Hi, im pushing a "detailview" to a navigationcontroller (RootViewController.m) [self.navigationController pushViewController:MyDetailView animated:YES]; "detailview" contains a tableview (DetailViewController.m) - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //push seconddetailview into navigationcontroller - how can i do that? } how do i load the seconddetailView into the main navigationcontroller? thanks pete

    Read the article

  • iPhone Core Data: request for member 'tableView' in something not a structure or union

    - by Nic Hubbard
    I am trying to use CoreData to populate a UITableView. I have been using the developer "Locations" project, and I think I have everything correct. But, now I am getting the following error when I build: request for member 'tableView' in something not a structure or union Why would it be confused about tableView? I am using it many times in the methods. The errors seem to be coming from: [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES]; Ideas?

    Read the article

  • iPhone: UITextField inside TableView cell?

    - by Nic Hubbard
    I am trying to programatically add a UITextFiled inside one of my tableview cells. How would I do this? Assuming it is in the following method, what code would I use? - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease]; cell.editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator; // Don't let the user click when not in editing mode cell.selectionStyle = UITableViewCellSelectionStyleNone; } switch (indexPath.row) { case 0: cell.textLabel.text = @"Title"; // This is where I want to add a text field cell.detailTextLabel.text = @"test"; cell.editing = YES; break; } return cell; }

    Read the article

  • How can I create a transparent tableview with each cells being transparent instead of showing white

    - by wolverine
    I tried all this inside - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 1.tableView.backgroundColor = [UIColor clearColor]; 2.cell.backgroundColor = [UIColor clearColor]; 3.cell.contentView.backgroundColor = [UIColor clearColor]; It only responds to the 1st line and makes the background a translucent kind of black. What should I do to get 100% transparency?

    Read the article

  • Crazy TableView (Or more likely me being just a jerk) ;-)

    - by Miky Mike
    Hi guy, I'm going crazy with all that objective C. I went to bed at 1.30 pm today, spending the night on my app but I love it... Well that's not the point anyway... My question is .... I have a table view which evaluates a statement when it displays its data : it goes like this : - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CustomCell"; cell = ((MainCell *)[self.tableView dequeueReusableCellWithIdentifier:CellIdentifier]); if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"MainCell" owner:self options:nil]; } Entry *entry = [fetchedResultsController objectAtIndexPath:indexPath]; cell.topLabel.text = [@"* " stringByAppendingString: entry.entryname]; cell.bottomLabel.text = entry.textbody; if ([entry.active boolValue] == YES) { cell.cellImageView.image = [UIImage imageNamed:@"check.png"]; } else { cell.cellImageView.image = nil; cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; } return cell; } The problem is that the first time it displays the data, the conditions are met when I scroll down the tableview but when I scroll up, sometimes, I get my "check.png" image and the accessory as well, which is not possible normally. Am I going crazy or is it the tableview ? Could you help me with that please, I can't figure out why it doesn't work... :-(( Thanks a lot in advance. Mike

    Read the article

  • Update a tableView with a plist took from another table

    - by Pheel
    Background: I have a tab bar application, which has a tableView as the "heart" of the app. It loads data from a plist and, through a button that checks if there are any updates on the remote plist file, updates the local plist with the remote contents. Then, i have another tableView, that should display only those plist items that have a bool value set to YES. Now i want to add a button to the second table that reloads the plist took from the first table. Expected: When i update the local plist from the first table and when i press the button on the second table, the 2nd table is supposed to update and show the cells with that bool value set to YES. (Note: I set YES as default to some items on plist). What happens: The first table updates its content from remote. The second table shows the old items with the value set to YES. When i press the button to refresh data, it reads the plist fine (by logging it, it has the same contents of the first table -only those set to YES-),but it doesn't update data even if i have [self.tableView reloadData];. When i close the app and open it again, the second table is filled with the right items. :\ Code i'm using: //Reading Plist { NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); NSString *plistPath = [[documentPaths lastObject] stringByAppendingPathComponent:@"myPlist.plist"]; NSFileManager *fMgr = [NSFileManager defaultManager]; if (![fMgr fileExistsAtPath:plistPath]) { plistPath = [[NSBundle mainBundle] pathForResource:@"myPlist" ofType:@"plist"]; } NSMutableArray *returnArr = [NSMutableArray arrayWithContentsOfFile:plistPath]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"isFav == YES"]; for (NSDictionary *sect in returnArr) { NSArray *arr = [sect objectForKey:@"Rows"]; [sect setValue:[arr filteredArrayUsingPredicate:predicate] forKey:@"Rows"]; } [self.tableView reloadData]; } //Refresh data button - (void) refreshTable:(id)sender { NSLog(@"plist read"); [self readPlist]; NSLog(@"refreshed plist:%@",[self readPlist]); [self.tableView reloadData]; } Does anyone know why the table is not updating?

    Read the article

  • UIsearch bar not returning data to table

    - by Insane_Poyo
    Edited code - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell==nil) cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; if (isFiltered) { int rowCount=indexPath.row; Aves *filtrada=[filteredTableData objectAtIndex:rowCount]; cell.textLabel.text=filtrada.name; NSLog(@"mostrando: "); }else { int rowCounter=indexPath.row; Aves *author=[theauthors objectAtIndex:rowCounter]; cell.textLabel.text=author.name; } NSLog(@"mostrando: "); return cell; } -(void)searchBar:(UISearchBar*)searchBar textDidChange:(NSString*)text { if(text.length == 0) { isFiltered = FALSE; } else { isFiltered = true; int i; [filteredTableData removeAllObjects]; for(i=0;[theauthors count]>i;i++) { Aves *name=[theauthors objectAtIndex:i]; //NSLog(name.name); NSRange nameRange = [[name.name lowercaseString] rangeOfString:[text lowercaseString]]; if(nameRange.length>0) { [filteredTableData addObject:name]; NSLog(name.name); } } [self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } } Edit: After working on it a while I solved some problems.Just updated my code, the problem is the repaint of the tableView, every thing else go ok. Check it and give any ideas you have plz ^^ Thx again for your time.

    Read the article

  • identifying Button selection of each row in Tableview?

    - by senthilmuthu
    hi,i coded like - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame = CGRectMake(230.0f, 4.0f, 60.0f, 36.0f); [btn setTitle:@"OK" forState:UIControlStateNormal]; [btn setTitle:@"OK" forState:UIControlStateSelected]; [btn addTarget:self action:@selector(onClickRename:) forControlEvents:UIControlEventTouchUpInside]; [cell addSubview:btn]; return cell; } but if the user selects the button on particular row, i can change that image through onClickRename...but can i get inwhich row's image has been touched through (void)tableView:(UITableView )tableView didSelectRowAtIndexPath:(NSIndexPath)indexPath ?

    Read the article

  • TableView Background image going over cell textLabel

    - by Alex Trott
    Currently my tableview looks like this: as you can see, cell.textLabel and cell.detailTextLable both load this background, and i can't work out how to get them to stop loading the background, and for it only to be the backing on the cell. Here's my current code to change the cell: - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { [cell setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"tableCell.png"]]]; } How can i get round this problem? Thanks in advance.

    Read the article

  • Problem: scrolling a tableview and then select the searchbar (iphone)

    - by Samui
    Hello everyone, I've been stuck with this problem for hours and I can't see the light. Please give me a hand with this: I have a tableview and a searchbar. The searchbar is situated in the navigationbar. When I do a fast scroll of the tableview, if I select the searchbar while the tableview is still decelerating, a exception raises: Terminating app due to uncaught exception 'NSRangeException', reason: ' -[NSMutableArray objectAtIndex:]: index 31 beyond bounds for empty array' How can I stop programmatically the deceleration of the tableview? Thanks for your time!

    Read the article

  • UITableView not reloading data on [self.tableView reloadData]

    - by donnib
    I have following code : - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row = [indexPath row]; static NSString *RowListCellIdentifier = @"RowListCellIdentifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:RowListCellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:RowListCellIdentifier]autorelease]; } NSMutableString *rowString = [[NSMutableString alloc] init]; [rowString appendString:[[[rows objectAtIndex:row] firstNumber]stringValue]]; [rowString appendString:@" : "]; [rowString appendString:[[[rows objectAtIndex:row] secondNumber]stringValue]]; [rowString appendString:@" : "]; [[cell textLabel] setText:rowString]; [rowString release]; return cell; } - (void)viewWillAppear:(BOOL)animated { [self.tableView reloadData]; [super viewWillAppear:animated]; } My problem is that the textLabel does not get reloaded with new data. If i log the rowString i see the correct value so data is good but in the UI it's the old data. I can see the cellForRowAtIndexPath beeing called so i know the reloadDatacall goes thru. What am i doing wrong ?

    Read the article

  • uitableview reloadData issue

    - by CocoaNewBee
    I've been debugging my iphone app and found something interesting. I have a UIViewControllers with TabBarcontroller( 6 tabs). each tab is a UIViewController and it has a UITtableview. The viewDidLoad works and brings the initial data. On of the UITableView has a search bar. After the user touchs presses search some magic happens and I get an array with data. I cant see the new data in the tableview and the [tableView reloadData] has no effect outside viewDidLoad (first time). I can see the array holding the data and the dataSource is set to self. Yet, no displaying of data! so I 've tried [self.tableView reloadData] & [self.tableView setNeedsDisplay] Funny enough, the new data is not being displayed. However if I move the table up or down the cellForRowAtIndexPath is being fired and the first row shows data. can anyone shed some light on this mystery??? if there a [self.view refreshscreen] ??

    Read the article

  • coredate data not show at tableView

    - by pengwang
    hello,i used coredate at the tableView,when i enter the viewControl i will call: dispatch_queue_t downloadQueue = dispatch_queue_create("socket login", NULL); dispatch_async(downloadQueue, ^{ NSManagedObjectContext *managedObjectContext =[self getManagedObjectContext]; noticListArr=[[CoreDataManager sharedInstance] readEvent:@"NotificationEntity" SortDescriptor:nil managedObjectContext:managedObjectContext]; NSLog(@"refreshData.count:%d ",noticListArr.count); for(int i=0;i<noticListArr.count;i++){ NotificationEntity *notificationEntity=[noticListArr objectAtIndex:i]; NSLog(@"notificationEntity.name:%@ ",notificationEntity.name); NSLog(@"notificationEntity.describeString:%@ ",notificationEntity.describeString); NSLog(@"notificationEntity.source:%@", notificationEntity.source); } }); dispatch_async(dispatch_get_main_queue(), ^{ [self.tableView1 reloadData]; }); dispatch_release(downloadQueue); all log have value but when i used - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"NotificationViewCell"; NotificationViewCell *cell = (NotificationViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; NotificationEntity *notificationEntity=(NotificationEntity *)[noticListArr objectAtIndex:indexPath.row]; NSLog(@"tableViewnoticListArr.count:%d ",noticListArr.count); NSLog(@"indexPath.row:%d ",indexPath.row); NSLog(@"notificationTable.avatarsmall:%@", notificationEntity.avatarsmall); NSLog(@"notificationTable.source:%@", notificationEntity.source); NSLog(@"notificationTable.name:%@", notificationEntity.name); NSLog(@"notificationTable.describeString:%@ ",notificationEntity.describeString); } only NSLog(@"tableViewnoticListArr.count:%d ",noticListArr.count); NSLog(@"indexPath.row:%d ",indexPath.row); can give me correct result.but all notificationEntity.name notificationEntity.describeString is null.i donot know why at the tabelview cell all value of notificationEntity is null.

    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

  • Can anybody help me in designing my UITableView into MVC Pattern ?

    - by user2877880
    I have written a ViewController in which i get data from the internet and display it in a UItableview using a json parser which uses object for key to identify its objects. What i would like your help in is to convert it into MVC pattern to make it less clumsy instead of including everything in the same controller class. Please try explaining it to me in terms of my code. THANKS IN ADVANCE. The code is as given below #import "ViewController.h" #import "AFNetworking.h" #import "ModelTableArray.h" @implementation ViewController @synthesize tableView = _tableView, activityIndicatorView = _activityIndicatorView, movies = _movies; - (void)viewDidLoad { [super viewDidLoad]; // Setting Up Table View self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0.0, 0.0, self.view.bounds.size.width, self.view.bounds.size.height) style:UITableViewStylePlain]; self.tableView.dataSource = self; self.tableView.delegate = self; self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.tableView.hidden = YES; [self.view addSubview:self.tableView]; // Setting Up Activity Indicator View self.activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; self.activityIndicatorView.hidesWhenStopped = YES; self.activityIndicatorView.center = self.view.center; [self.view addSubview:self.activityIndicatorView]; [self.activityIndicatorView startAnimating]; // Initializing Data Source self.movies = [[NSArray alloc] init]; NSURL *url = [[NSURL alloc] initWithString:@"http://itunes.apple.com/search?term=rocky&country=us&entity=movie"]; NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url]; UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged]; [self.tableView addSubview:refreshControl]; [refreshControl endRefreshing]; AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { self.movies = [JSON objectForKey:@"results"]; [self.activityIndicatorView stopAnimating]; [self.tableView setHidden:NO]; [self.tableView reloadData]; } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) { NSLog(@"Request Failed with Error: %@, %@", error, error.userInfo); }]; [operation start]; } - (void)refresh:(UIRefreshControl *)sender { NSURL *url = [[NSURL alloc] initWithString:@"http://itunes.apple.com/search?term=rambo&country=us&entity=movie"]; NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url]; AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { self.movies = [JSON objectForKey:@"results"]; [self.activityIndicatorView stopAnimating]; [self.tableView setHidden:NO]; [self.tableView reloadData]; } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) { NSLog(@"Request Failed with Error: %@, %@", error, error.userInfo); }]; [operation start]; [sender endRefreshing]; } - (void)viewDidUnload { [super viewDidUnload]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } // Table View Data Source Methods - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (self.movies && self.movies.count) { return self.movies.count; } else { return 0; } } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellID = @"Cell Identifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; if (!cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID]; } NSDictionary *movie = [self.movies objectAtIndex:indexPath.row]; cell.textLabel.text = [movie objectForKey:@"trackName"]; cell.detailTextLabel.text = [movie objectForKey:@"artistName"]; NSURL *url = [[NSURL alloc] initWithString:[movie objectForKey:@"artworkUrl100"]]; [cell.imageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placeholder"]]; return cell; } @end

    Read the article

  • Tableview reload data problem iphone sdk

    - by neha
    Hi all, I have a class A which is a subclass of uitableviewcontroller and one more class B which actually displays my tableview with its content is a subclass of A. There's an xml parser which parses my xml and stores the content in an nsmutablearray of application delegate. Now, I fetch this delegate array into a local nsmutablearray in class B to minimise the communication between the two classes i.e. delegate and class B and display that. After certain condition is met in class A, I'm calling xml parser to refill the delegate array and I'm calling class B's tableview reload method. The problem is when I call the tableview's reload data, class B's delegate methods are called. But before that I need to grab this delegate array in local array in class B. How shall I do that? Can anybody please help? Thanx in advance.

    Read the article

  • iphone tableview multilevel

    - by Anonymous
    Hi, I 'm a iphone programming newbie. I m trying to implement an app with multi-level tableviews. The idea is if someone selects something on the first screen say then a new view opens(tableview) car make> list of models Honda > Acura, S2000,accord ... My challenge is to show the list of models in a new tableview & secondly change the size of hte list depending on the car selected. I have programmed so that when i select 'Honda' a new tableview opens. How do i populate data for the second table?? Any suggestions on how to proceed? thanks

    Read the article

  • tableview - unrecognized selector sent to instance

    - by ct2k7
    Hi, I'v just got this error in my app. 2010-04-06 03:58:55.463 EasyPay DPS[6530:207] WARNING: Using legacy cell layout due to delegate implementation of tableView:accessoryTypeForRowWithIndexPath: in <NTItems: 0x397af90>. Please remove your implementation of this method and set the cell properties accessoryType and/or editingAccessoryType to move to the new cell layout behavior. This method will no longer be called in a future release. 2010-04-06 03:58:55.505 EasyPay DPS[6530:207] *** -[NTItems tableView]: unrecognized selector sent to instance 0x397af90 2010-04-06 03:58:55.515 EasyPay DPS[6530:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NTItems tableView]: unrecognized selector sent to instance 0x397af90' This error is extremely unuseful - where do I start in my code?

    Read the article

  • Scroll UITableViewCell above keyboard for small tableview

    - by JK
    I have a tableview which is added to a UIViewController as the tableview only fills the bottom 3/4 of the screen.The rows contain editable UITextFields. When a field is tapped, the keyboard appears but the table does not scroll upwards as would normally be the case. Consequently, the keyboard obscures the field being edited. I have tried calling [tableView scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated] but this has no effect if the table contains only a few rows. How can I get the table to scroll a specific cell above the keyboard? Thank you

    Read the article

  • iphone using 2 tableview

    - by Anonymous
    Hi, I 'm a iphone programming newbie. I m trying to implement an app with multi-level tableviews. The idea is if someone selects something on the first screen say then a new view opens(tableview) car make> list of models Honda > Acura, S2000,accord ... My challenge is to show the list of models in a new tableview & secondly change the size of hte list depending on the car selected. I have programmed so that when i select 'Honda' a new tableview opens. How do i populate data for the second table?? Any suggestions on how to proceed? thanks

    Read the article

  • iphone tableview & webservice

    - by Anonymous
    Hi, I have a tableview, when the user selects a row i call a webservice depending on which row is selected. my problem is i can connect to the webservice but i dont get any response from the webservice. I used soap client to test if webservice is working correctly or not. //rootviewcontroller.m - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {.... //call to webservice [self connectToWebService]; } On debugging i found that my code does not go to any of the following methods -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *) response{} -(void) connection:(NSURLConnection *) connection didReceiveData:(NSData *) data {} -(void) connection:(NSURLConnection *) connection didFailWithError:(NSError *) error{} -(void) connectionDidFinishLoading:(NSURLConnection *) connection {} any suggestions where am i going wrong??? thanks

    Read the article

  • iPhone TableView Data Into 2 Sections

    - by MrPink
    Hello, I am trying to get a tableview to split data i have in an array into sections... I'm pretty new to this but below is my code snippet - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if(section == 0) { contentArray = [[NSArray arrayWithObjects:@"Send SMS", @"Reports", nil] retain]; } if(section == 1) { contentArray = [[NSArray arrayWithObjects:@"Accounts", nil] retain]; } return [contentArray count]; } I have split the data successfully into the 2 sections but when populating the rows It just repeats the first content array in both sections. Can any one help... Thanks

    Read the article

  • Delete NSManageObject at the event tableView:commiteEditingStyle:forRowAtIndexPath:

    - by David.Chu.ca
    I got exception when I tried to delete one NSManageObject at the event of tableView:commiteEditingStyle:forRowAtIndexPath:. Here is the part of my codes: - (void)tableView:(..)tableView commitEditingStyle:(..)editingStyle forRowAtIndexPath:(..)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { [managedObjectContext deleteObject: [fetchedResultController objectAtIndexPath:indexPath]]; ... } } The exception was thrown at the line of deleteObject:(method of my local NSManagedObjectContext). This is the exception message: uncaught exception 'NSObjectInaccessibleException', reason: 'The NSManagedObject with ID:0x3d07a30 <x-coredata://0D2CC9CB-042B-496D-B3FE-5F1ED64EAB97/paymentType/p2> has been invalidated.' I tried to get entity object first and then to delete it. The entity looks OK but still the exception was at delete: NSManagedObject *entityToDelete = [fetchedResultsController objectAtIndexPath:indexPath]; [mangedObjectContext deleteObject:entityToDelete]; // Exception again. I am not sure if the entity object retrieved from the fetchedResultsController(NSFetchedResultsController type) cannot be deleted? If so, is there any other way to get the entity object for deleting?

    Read the article

  • Why does this TableView code work?

    - by nevan
    I made a typo when creating a UITableViewCell with this code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CellIdentifier"; UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { NSLog(@"Creating cell"); cell = [[[UITableViewCell alloc] initWithStyle:UITableViewStylePlain reuseIdentifier:CellIdentifier] autorelease]; } cell.textLabel.text = @"Hello"; return cell; } The typo is in using UITableViewStylePlain instead of UITableViewCellStyleDefault. The code worked fine, creating new cells. Why?

    Read the article

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