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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:34:41+00:00 2026-06-03T04:34:41+00:00

Am getting a warning for ‘incomplete implementation’, but can’t find out why, having compared

  • 0

Am getting a warning for ‘incomplete implementation’, but can’t find out why, having compared it with source files. Have commented out the warning.

My version of ItemsViewController.m

    #import "ItemsViewController.h"
    #import "BNRItemStore.h"
    #import "BNRItem.h"

    @implementation ItemsViewController //Incomplete implementation

    - (id)init 
    {
      // Call the superclass's designated initializer
      self = [super initWithStyle:UITableViewStyleGrouped];
      if (self) {
        UINavigationItem *n = [self navigationItem];

        [n setTitle:@"Homepwner"];

        // Create a new bar button item that will send
        // addNewItem: to ItemsViewController
        UIBarButtonItem *bbi = [[UIBarButtonItem alloc] 
                                initWithBarButtonSystemItem:UIBarButtonSystemItemAdd 
                                target:self 
                                action:@selector(addNewItem:)];

        // Set this bar button item as the right item in the navigationItem
        [[self navigationItem] setRightBarButtonItem:bbi];

        [[self navigationItem] setLeftBarButtonItem:[self editButtonItem]];
      }
      return self;
    }

    - (IBAction)addNewItem:(id)sender
    {
      // Create a new BNRItem and add it to the store
      BNRItem *newItem = [[BNRItemStore defaultStore] createItem];//No known class method for selector 'defaultStore'
      // Incompatible pointer types initializing 'BNRItem*__strong' with an expression of 'NSArray'

      // Figure out where that item is in the array 
      int lastRow = [[[BNRItemStore defaultStore] allItems] indexOfObject:newItem]; //No known class method for selector 'defaultStore'

      NSIndexPath *ip = [NSIndexPath indexPathForRow:lastRow inSection:0];

      // Insert this new row into the table.
      [[self tableView] insertRowsAtIndexPaths:[NSArray arrayWithObject:ip]
                              withRowAnimation:UITableViewRowAnimationTop];
    } 

    - (id)initWithStyle:(UITableViewStyle)style
    {
      return [self init];
    }

    - (void)viewWillAppear:(BOOL)animated
    {
      [super viewWillAppear:animated];
      [[self tableView] reloadData];
    }

    - (void)tableView:(UITableView *)tableView 
    moveRowAtIndexPath:(NSIndexPath *)fromIndexPath 
          toIndexPath:(NSIndexPath *)toIndexPath 
    {
      [[BNRItemStore defaultStore] moveItemAtIndex:[fromIndexPath row] //No known class method for selector 'defaultStore'
                                           toIndex:[toIndexPath row]];
    }

    - (void)tableView:(UITableView *)aTableView 
    didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
      DetailViewController *detailViewController = [[DetailViewController alloc] init];

      NSArray *items = [[BNRItemStore defaultStore] allItems];//No known class method for selector 'defaultStore'
      BNRItem *selectedItem = [items objectAtIndex:[indexPath row]];

      // Give detail view controller a pointer to the item object in row
      [detailViewController setItem:selectedItem];

      // Push it onto the top of the navigation controller's stack
      [[self navigationController] pushViewController:detailViewController
                                             animated:YES];
    }



    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)io
    {
      if ([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPad) {
        return YES;
      } else {
        return (io==UIInterfaceOrientationPortrait);
      }
    }

    - (void)tableView:(UITableView *)tableView 
    commitEditingStyle:(UITableViewCellEditingStyle)editingStyle 
    forRowAtIndexPath:(NSIndexPath *)indexPath 
    {
      // If the table view is asking to commit a delete command...
      if (editingStyle == UITableViewCellEditingStyleDelete)
      {
        BNRItemStore *ps = [BNRItemStore defaultStore];//No known class method for selector 'defaultStore'
        NSArray *items = [ps allItems];
        BNRItem *p = [items objectAtIndex:[indexPath row]];
        [ps removeItem:p];

        // We also remove that row from the table view with an animation
        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
                         withRowAnimation:UITableViewRowAnimationFade];
      }
    }

    - (NSInteger)tableView:(UITableView *)tableView
     numberOfRowsInSection:(NSInteger)section
    {
      return [[[BNRItemStore defaultStore] allItems] count];//No known class method for selector 'defaultStore'
    }
    - (UITableViewCell *)tableView:(UITableView *)tableView
             cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
      // Create an instance of UITableViewCell, with default appearance
      // Check for a reusable cell first, use that if it exists
      UITableViewCell *cell =
      [tableView dequeueReusableCellWithIdentifier:@"UITableViewCell"];

      // If there is no reusable cell of this type, create a new one
      if (!cell) {
        cell = [[UITableViewCell alloc]
                initWithStyle:UITableViewCellStyleDefault
                reuseIdentifier:@"UITableViewCell"];
      }
      // Set the text on the cell with the description of the item
      // that is at the nth index of items, where n = row this cell
      // will appear in on the tableview
      BNRItem *p = [[[BNRItemStore defaultStore] allItems]//No known class method for selector 'defaultStore'
                    objectAtIndex:[indexPath row]];
      [[cell textLabel] setText:[p description]];
      return cell;
    }

    @end

Original source version of ItemsViewController.m

#import "ItemsViewController.h"
#import "BNRItemStore.h"
#import "BNRItem.h"

@implementation ItemsViewController
- (id)init 
{
    // Call the superclass's designated initializer
    self = [super initWithStyle:UITableViewStyleGrouped];
    if (self) {
        UINavigationItem *n = [self navigationItem];

        [n setTitle:@"Homepwner"];

        // Create a new bar button item that will send
        // addNewItem: to ItemsViewController
        UIBarButtonItem *bbi = [[UIBarButtonItem alloc] 
                        initWithBarButtonSystemItem:UIBarButtonSystemItemAdd 
                                             target:self 
                                             action:@selector(addNewItem:)];

        // Set this bar button item as the right item in the navigationItem
        [[self navigationItem] setRightBarButtonItem:bbi];

        [[self navigationItem] setLeftBarButtonItem:[self editButtonItem]];
    }
    return self;
}
- (IBAction)addNewItem:(id)sender
{
    // Create a new BNRItem and add it to the store
    BNRItem *newItem = [[BNRItemStore defaultStore] createItem];

    // Figure out where that item is in the array 
    int lastRow = [[[BNRItemStore defaultStore] allItems] indexOfObject:newItem];

    NSIndexPath *ip = [NSIndexPath indexPathForRow:lastRow inSection:0];

    // Insert this new row into the table.
    [[self tableView] insertRowsAtIndexPaths:[NSArray arrayWithObject:ip]
                            withRowAnimation:UITableViewRowAnimationTop];
}  
- (id)initWithStyle:(UITableViewStyle)style
{
    return [self init];
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [[self tableView] reloadData];
}


- (void)tableView:(UITableView *)tableView 
    moveRowAtIndexPath:(NSIndexPath *)fromIndexPath 
           toIndexPath:(NSIndexPath *)toIndexPath 
{
    [[BNRItemStore defaultStore] moveItemAtIndex:[fromIndexPath row]
                                         toIndex:[toIndexPath row]];
}

- (void)tableView:(UITableView *)aTableView 
    didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    DetailViewController *detailViewController = [[DetailViewController alloc] init];

    NSArray *items = [[BNRItemStore defaultStore] allItems];
    BNRItem *selectedItem = [items objectAtIndex:[indexPath row]];

    // Give detail view controller a pointer to the item object in row
    [detailViewController setItem:selectedItem];

    // Push it onto the top of the navigation controller's stack
    [[self navigationController] pushViewController:detailViewController
                                           animated:YES];
}

- (void)tableView:(UITableView *)tableView 
    commitEditingStyle:(UITableViewCellEditingStyle)editingStyle 
     forRowAtIndexPath:(NSIndexPath *)indexPath 
{
    // If the table view is asking to commit a delete command...
    if (editingStyle == UITableViewCellEditingStyleDelete)
    {
        BNRItemStore *ps = [BNRItemStore defaultStore];
        NSArray *items = [ps allItems];
        BNRItem *p = [items objectAtIndex:[indexPath row]];
        [ps removeItem:p];

        // We also remove that row from the table view with an animation
        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
                         withRowAnimation:UITableViewRowAnimationFade];
    }
}

- (NSInteger)tableView:(UITableView *)tableView
 numberOfRowsInSection:(NSInteger)section
{
    return [[[BNRItemStore defaultStore] allItems] count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView
         cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Create an instance of UITableViewCell, with default appearance
    // Check for a reusable cell first, use that if it exists
    UITableViewCell *cell =
        [tableView dequeueReusableCellWithIdentifier:@"UITableViewCell"];

    // If there is no reusable cell of this type, create a new one
    if (!cell) {
        cell = [[UITableViewCell alloc]
                    initWithStyle:UITableViewCellStyleDefault
                  reuseIdentifier:@"UITableViewCell"];
    }
    // Set the text on the cell with the description of the item
    // that is at the nth index of items, where n = row this cell
    // will appear in on the tableview
    BNRItem *p = [[[BNRItemStore defaultStore] allItems]
                                    objectAtIndex:[indexPath row]];
    [[cell textLabel] setText:[p description]];
    return cell;
}
@end

ItemsViewController.h

#import <Foundation/Foundation.h>
#import "DetailViewController.h"

@interface ItemsViewController : UITableViewController
{
  IBOutlet UIView *headerView;
}

-(UIView *)headerView;
-(IBAction)addNewItem:(id)sender;
-(IBAction)toggleEditingMode:(id)sender;

@end
  • 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-03T04:34:43+00:00Added an answer on June 3, 2026 at 4:34 am

    You are not implementing two methods in your .m file (if I am not reading it badly):

    -(UIView *)headerView;
    -(IBAction)toggleEditingMode:(id)sender;
    

    That is why you are getting the warning.

    In any case, in your build result window, right where you see the warning with the yellow icon containing a number, you can click on the yellow icon and more information will appear detailing exactly which methods you are missing in your implementation file.

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

Sidebar

Related Questions

I have upgraded my php now i am getting warning messages for eregi_replace Can
Getting two warning when i run this program and i can't figure out how
I'm getting this warning in my Output window (which doesn't affect functionality but I
How can I implement the ContactService interface without getting warning about unchecked conversions from
I am getting a warning on this line in my header, but I am
When doing a post to /:username/about I'm getting WARNING: Can't mass-assign protected attributes: about.
I am getting warning when using the std copy function. I have a byte
I`m doing something wrong here but I can't figure out what it is .
I keep getting 'warning: control reaches end of non-void function' with this code: -
When I am running this program I am getting warning array subscript has type

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.