Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8145767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:46:03+00:00 2026-06-06T13:46:03+00:00

I have a UIButton called as UploadButton . I am using the following lines

  • 0

I have a UIButton called as UploadButton. I am using the following lines of code which takes care of the action which should happen on clicking it ::

-(IBAction)UploadButtonPressed:(id)sender{  

self.Upload = [[UploadSpaceTableViewController alloc] 
                         initWithStyle:UITableViewStylePlain];
self.UploadTableViewPopover = [[UIPopoverController alloc] 
                                initWithContentViewController:Upload];               

[self.UploadTableViewPopover presentPopoverFromBarButtonItem:sender 
                                permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}

Here, UploadSpaceTableViewController is a separate class which I have made. It has the following functions in it ::

- (void)viewDidLoad
{
[super viewDidLoad];


self.clearsSelectionOnViewWillAppear = NO;
self.contentSizeForViewInPopover = CGSizeMake(150.0, 140.0);
self.keys1 = [NSMutableArray array];
[keys1 addObject:@"Red"];
[keys1 addObject:@"Green"];
[keys1 addObject:@"Blue"];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [keys1 count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

// Configure the cell...

NSString *key1 = [keys1 objectAtIndex:indexPath.row];
cell.textLabel.text = key1;

return cell;
}

Basically, all I want is to display a UItableView inside a UIPopOverController on the click of my UploadButton.

However, on running the above lines of code I am getting the following erre in gdb ::

splitView[4486:f803] *** Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:6061
2012-06-27 14:05:05.531 splitView[4486:f803] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:

This is the first time that I am trying to display a UITableView inside a UIPopoverController. I have tried a lot of variations in the code but, I am unable to sort it out. Can someone help me out ?? Thanks and regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:46:04+00:00Added an answer on June 6, 2026 at 1:46 pm

    Have you allocated your cell i think by your code it will return nill

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
     static NSString *CellIdentifier = @"Cell";
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
     if(cell == nill){
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];  
    }     
     // Configure the cell...
    
     NSString *key1 = [keys1 objectAtIndex:indexPath.row];
     cell.textLabel.text = key1;
    
     return cell;
    }
    

    may this will help you…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code, and when i press the UIButton, nothing is called,
I'm trying to create a UIButton programmatically. I have a button called addCash (which
I have UIButton instance called card. I have an object called Representer, which has
I have created a custom button called ModuleUIButton which inherits from UIButton . This
I have a viewController called MainViewController, which has a UIButton. When tapped, this button
I have a method that accepts a sender and is called with a UIbutton.
I have a UIButton that performs an Action when it is touched down. I
I have a subclass of UIButton called INMenuCard and I am overriding the initWithFrame
I have a custom UIButton in my viewcontroller that should have either the image
I have the following button in my iPad app: subject = [[UIButton alloc] init];

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.