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 8810599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:09:29+00:00 2026-06-14T03:09:29+00:00

Sorry I’m new to iOS. I intend to make an UITableView inside UIAlertView .

  • 0

Sorry I’m new to iOS. I intend to make an UITableView inside UIAlertView. Finally i have gotten this tutorial

I have implemented UIAlertTableView class this way

UIAlertTableView *alert = [[UIAlertTableView alloc] initWithTitle:@"Choose a number"
                                                          message:nil
                                                         delegate:self
                                                cancelButtonTitle:@"Cancel"
                                                otherButtonTitles:nil, nil];
alert.tableDelegate = self;
alert.dataSource = self;
alert.tableHeight = 120;
[alert show];

However after testing, i got the UIAlert displayed a blank list, with no items appear inside. Previously i have an NSMUtableArray that i want to use as data source. From the tutorial above, seems that assigning data source is done using alert.dataSource = self. Yet i’m still wondering how to use my NSMutableArray as the data source and how it relates to alert.dataSource?

  • 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-14T03:09:30+00:00Added an answer on June 14, 2026 at 3:09 am

    I’ll suggest you need to create a new file as your alertView’s table datasource and delegate.
    Implement the:

    @interface MyTableSource: UIViewController <UITableViewDataSource, UITableViewDelegate>
    @end
    
    @implementation MyTableSource
    
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
    
    return 7;
    
    }
    
    - (UITableViewCell *)tableView:(UITableView *)tableViews cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
    
        static NSString *CellIdentifier = @"MyIdentifier";
    
    
        UITableViewCell *cell = [tableViews dequeueReusableCellWithIdentifier:CellIdentifier];
    
        if (cell == nil)
        {
    
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        }
        cell.textLabel.text = @"M";
        return cell;
    
    }
    
    @end
    

    Create the alert like:

    UIAlertTableView *alert = [[UIAlertTableView alloc] initWithTitle:@"Choose a number"
                                                              message:nil
                                                             delegate:self
                                                    cancelButtonTitle:@"Cancel"
                                                    otherButtonTitles:nil, nil];
    MyTableSource *data = [[MyTableSource alloc] init];
    alert.tableDelegate = data;
    alert.dataSource = data;
    alert.tableHeight = 120;
    [alert show];
    

    Note:
    I implemented that alertView for testing, there are alot of issues.
    You need to call:

    [self layoutAnimated:YES]; instead of [self setNeedsLayout]; in the alertView class.

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

Sidebar

Related Questions

Sorry if this is stupid question, but I'm new to MATLAB. I have a
Sorry if this question is confusing. I have a public static class inside my
Sorry this is basic, but I'm new to Python and Django. I have a
Sorry I am very new to open graph and have been having difficulty to
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Sorry, I'm sure this is a stupid question. I have successfully installed python 2.6
Sorry, I'm new to SVN and I looked around a little for this. How
Sorry if this sounds like a really stupid question, but I need to make
Sorry, but I can't solve this issue by myself.. For example, I have a
Sorry for this simple question, but I can't solve it... There is an example:

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.