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

  • Home
  • SEARCH
  • 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 6156633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:38:39+00:00 2026-05-23T20:38:39+00:00

I have a view with button. When i press a button, uisplitview should show.

  • 0

I have a view with button. When i press a button, uisplitview should show. The problem is that with the tableview (splitview’s left=master view). The detail view (right) is displayed correctly. Left one is empty because cellForRowAtIndexPath is not called.
My .h file extends UISplitViewController, and in the .m file’s viewDidLoad i do this:

Left *l = [[Left alloc] initWithNibName:@"Left" bundle:nil];
Right *d = [[Right alloc] initWithNibName:@"Right" bundle:nil];
// Update the split view controller's view controllers array.
NSArray *viewControllers = [[NSArray alloc] initWithObjects:l, d, nil];
self.viewControllers = viewControllers;
[viewControllers release];

My left.h:

@interface Left : UIViewController  <UITableViewDataSource, UITableViewDelegate> {

NSMutableArray *tableData;
UITableView *table;
}

@property (nonatomic, retain) NSMutableArray *tableData;
@property (nonatomic, retain) IBOutlet UITableView *table;

My left.m:

    #import "Left.h"


   @implementation Left

   @synthesize tableData,table;

    - (id)initWithStyle:(UITableViewStyle)style
  {
self = [super initWithStyle:style];
if (self) {
    // Custom initialization
}
return self;
}

- (void)dealloc
{
[super dealloc];
}

- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc that aren't in use.
 }

#pragma mark - View lifecycle

 - (void)viewDidLoad
 {

[super viewDidLoad];
table = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] style:UITableViewStylePlain]; 
table.delegate = self; 
table.dataSource = self; 

table.autoresizesSubviews = YES; 
tableData=[[NSMutableArray alloc] initWithObjects:@"bazinga",@"buzz", nil];

//NSLog(@"velikost : %d", [tableData count]);
[self.view addSubview:table];
}

 - (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  {

// Return the number of sections.
return 0;
}

 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
 {

// Return the number of rows in the section.
NSLog(@"size: %d", [tableData count]);
return [tableData count];
  }

 - (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];
}

// Configure the cell...
cell.textLabel.text=[tableData objectAtIndex:indexPath.row];

return cell;
 }


   }

  @end

How can i fill my master view’s table with data?

  • 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-05-23T20:38:39+00:00Added an answer on May 23, 2026 at 8:38 pm

    u have to

    replace this

        table = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] style:UITableViewStylePlain]; 
    

    to

       self.table = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] style:UITableViewStylePlain]; 
    

    becuase i have used to call with self is u have synthesized the table.

    so we have to like this

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

Sidebar

Related Questions

I have vendors/show view with button Add new item button. When i press Add
We have place a button on a view. When we press it, nothing happens.
I have view a that has a table cell and a save button. If
I Have a view with a button. I want to press the button and
Ok, I have a button that, when pressed, should animate/play a png image sequence.
I have a view, and a button in this view. When I press this
I want to have a View that initially is invisible and when I press
I have two view controllers. I'm on first, and when I press the button,
I have a button that shows or hides a view. When button get pressed
I have a view with a button at the bottom of the portrait screen,

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.