Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Xcode's "Incomplete implementation" help

So the "incomplete Implementation shows up and I have barely touched the file, Whats wrong and what should i do. Please explain so a newbie can understand. :)
#import "ViewController2.h"
#import "ViewController.h"

@interface ViewController2 ()

@end

@implementation ViewController2

-(IBAction)switchview:(id)sender {

ViewController *second = [[ViewController alloc]initWithNibName:nil bundle:nil]; [self presentViewController:second animated:YES completion:nil];

}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

@end
Tagged:

Replies

  • Duncan CDuncan C Posts: 9,114Tutorial Authors, Registered Users @ @ @ @ @ @ @
    The incomplete implementation warning usually means that you have declared a method in your header file but not provided an implementation of that method in your .m file. If you still can't figure it out, post both your .h file and the specific error you are getting. it should tell you which method body/bodies are missing.
    Regards,
    Duncan C
    WareTo

    widehead.gif
    Animated GIF created with Face Dancer, available for free in the app store.

    I'm available for one-on-one help at CodeMentor
  • EmilioGainesEmilioGaines Posts: 30New Users
    #import

    @interface ViewController : UIViewController {

    IBOutlet UITextField *textField1;
    IBOutlet UITextField *textField2;
    IBOutlet UITextField *textField3;
    IBOutlet UILabel *label;

    }

    -(IBAction)calculate;
    -(IBAction)clear;
    -(IBAction)switchback;




    @end
  • EmilioGainesEmilioGaines Posts: 30New Users
    Viewcontroller is already there...
  • EmilioGainesEmilioGaines Posts: 30New Users
    next to import it says UIKit/UIKit.h with those arrows but those can't show here.
  • SundialSoftSundialSoft Posts: 307Registered Users @ @
    Emilio, you have 3 functions in the interface section, calculate, clear & switchback. These need to exist in the implementation section. If the actual code is not there you will get this kind of warning.

    eg: if you define it in interface you need to add it in to implementation something like

    -(IBAction)calculate
    {
    int a = b + c;
    }

    The other thing that causes this warning (for the future) is if you include delegate references after UIViewController. Say for instance you add address book stuff like this
    @interface ViewController: UIViewController
    but you don't include the methods those delegates can talk to, then you will see the same kind of error.

    For now I think it's just your definitions for the 3 functions you have in interface.
  • Duncan CDuncan C Posts: 9,114Tutorial Authors, Registered Users @ @ @ @ @ @ @

    #import

    @interface ViewController : UIViewController {

    IBOutlet UITextField *textField1;
    IBOutlet UITextField *textField2;
    IBOutlet UITextField *textField3;
    IBOutlet UILabel *label;

    }

    -(IBAction)calculate;
    -(IBAction)clear;
    -(IBAction)switchback;




    @end
    You should put your code inside code tags, as explained in the post "How To Make Your Code Look Nice" at the top of this board. Then you will be able to show any code you need to show without the forum software trying to parse it as HTML.

    You posted the implementation of ViewController2, but the header for ViewController. You need to post the entire .h file and the entire .m file (in code tags) of the file that is throwing the warning.

    You also did not provide the full warning message that you are getting. It should tell you which method implementations are missing. That information is needed in order to know what's wrong.
    Regards,
    Duncan C
    WareTo

    widehead.gif
    Animated GIF created with Face Dancer, available for free in the app store.

    I'm available for one-on-one help at CodeMentor
  • SundialSoftSundialSoft Posts: 307Registered Users @ @
    Can't the people who provide this forum sort our the code posting so that it works like the old forum did? The current one is rubbish & that's why people have trouble formatting code. Make it easy & people will be happy to post code which looks correct.
  • RhadeRhade Posts: 661Registered Users @ @ @

    Can't the people who provide this forum sort our the code posting so that it works like the old forum did? The current one is rubbish & that's why people have trouble formatting code. Make it easy & people will be happy to post code which looks correct.

    It is quite easy. You hit the C button when posting, and you get something that is better than no formatting at all, and usually you get something that looks good. There is also a handy post at the top of the forum that explains what is required, and it still isn't that hard. People simply don't read it.

    Even then, many - MANY - people screwed it up with the old forum quite frequently, too.

    In this particular case, the poster used blockquote for his own unknown reasons, which is why it doesn't look right. There is nothing on this board directing him to do so, he made that choice himself. There's nothing I or anyone can do about that.

    But to answer your specific question, the authors of this forum software elected to go in an HTML route rather than a BB Code route like what vBulletin used. Considering how slowly they have moved on other much higher priority requests that we have made, my guess is that what you currently have is what it will be for quite a while.

    With vBulletin, you had to either hit a button or know what code to type in. Here, you either have to hit a button, or know what code to type in. The only difference is the specific code required, so we're not talking about life-altering differences here.
    Do not quote questionable posts.
    Do not post moderator requests in public. Send a PM.
    vvvvv ---- Use the flag button to report spam.
Sign In or Register to comment.