error: 'prop.118' has an incomplete type

Discussion in 'iOS Programming' started by ArtOfWarfare, Aug 15, 2008.

  1. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #1
    Has anyone seen this error message before?

    I just tried building and I got that error... it's actually listed twice in a row... here's the section of code:

    Code:
    instructionsView.text = [welcomeInstructions appendString: dontSayInstructions];
    [color=red]		error: 'prop.118' has an incomplete type
    		error: 'prop.118' has an incomplete type[/color]
    welcomeInstructions and dontSayInstructions are both NSMutableString.
    instructionsView is a UITextView.

    based on the options that are picked, the different sections of instructions could be different. So when a player picks "Show Instructions", I want it to generate the instructions by appending a bunch of different strings together.

    Edit: Wait... the text property of instructionsView says
    @property(nonatomic, copy) NSString *text

    Does that mean I have to use NSString rather than NSMutableString? Is there a way for me to modify the property so it'll accept NSMutableString?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    A NSMutableString is a NSString so that should work. You can always cast to NSString * and see if that works:

    Code:
    instructionsView.text = ((NSString *) [welcomeInstructions appendString: dontSayInstructions]);
    
     
  3. ArtOfWarfare thread starter macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #3
    I tried what you suggested...

    now it gives the error

    So... let me think about that...

    I want it to return the string... but it's supposed to return void? So does append string do...

    wait... I think I can fix this on my own. Give me a second to think about it.

    Edit: OK... so now it compiles without errors... but it still isn't doing what it should be doing.

    Either it's not showing the instructions or the instructions are completely empty.

    here's my code now...

    Code:
    - (IBAction) toggleInstructions: (id) sender
    {
    	if (instructionsView.hidden == TRUE)
    	{
    		[self hideOptions];
    		[fullInstructions setString: welcomeInstructions];
    		[fullInstructions appendString: dontSayInstructions];
    		instructionsView.text = fullInstructions;
    		instructionsView.hidden = FALSE;
    		[toggleInstructions setTitle: @"Show Options" forState: toggleInstructions.state];
    	}
    	else
    	{
    		[self showOptions];
    		instructionsView.hidden = TRUE;
    		[toggleInstructions setTitle: @"Show Instructions" forState: toggleInstructions.state];
    	}
    }
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    You are getting that error at compile time? Or run time? I think one of welcomeInstructions or dontSayInstructions is nil or has a different type...
     
  5. ArtOfWarfare thread starter macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #5
    dontSayInstructions is just a space...
    that's okay, isn't it?

    Code:
    NSLog (@"%s", dontSayInstructions);
    That prints

    I think %s might not be the one I want though... %s is for a C string, not NSString. %@ also prints the same thing.
     
  6. ArtOfWarfare thread starter macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #6
    While I'm still curious as to why it's not working... someone else suggested a much better idea.

    Rather than change the instructions based on options, how about I just write all the instructions? It would make it a lot less confusing. For example, they might end up reading the instructions for one mode, then go back and change one thing, and then start the game and then they're confused about why the instructions didn't explain to them what was going to happen.

    So now I just have three sections... I've got
    "General Instructions", which tells you about everything all the different versions have in common, "Single Team Instructions", which says how playing with one team is different from playing with two or more, and then "Multi-Team Instructions", which explains how playing with multiple teams is different from playing with one. Periodically I have things like "(By default the target score is 50 points, but you can change it in the options.)"

    So...

    all that is left to do is make the game work, lol.
     

Share This Page