Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,616
6,145
Has anyone seen this error message before?

error: 'prop.118' has an incomplete type

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?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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?

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]);
 

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,616
6,145
I tried what you suggested...

now it gives the error

error: void value not ignored as it ought to be

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

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,616
6,145
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...

dontSayInstructions is just a space...
that's okay, isn't it?

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

That prints

2008-08-15 10:58:50.546 Say It![13236:20b] (null)

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

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,616
6,145
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.