Search code examples
iosobjective-cfacebookstringwithformat

stringWithFormat Issue


I am having a small issue in my application. I have it to where when the user presses the facebook button the SLComposeViewController pops up with text in it that I have preset. That is where my problem comes in. I would like it to say I just climbed and then at the end, whatever climb that they pressed into. Example: I just climbed Mount Everest. The I just climbed part I can get to show up, but when I try and use stringWithFormat it gives me an error which I will post below, along with my code. The climb title is set a a label in my DVC with this line self.titleLabel.text = self.climbTitle;

Line with problem:

[mySLComposerSheet setInitialText:NSString stringWithFormat:@"%@Climbed", [_climbTitle];

Error:

DetailViewController.m:79:39: Unexpected interface name 'NSString': expected expression

I hope I have worded this question appropriately and have given enough context for everyone to understand my issue, if I haven't, please inform me and I will correct it.

Thanks


Solution

  • It should be [NSString stringWithFormat:@"%@Climbed", _climbTitle];