0

With a NSMutableString, how would I insert a "-" sign at the index "0" for an NSMutableString called "a". Right now my code looks like this:

a = [insertString: @"-" atIndex: 0];

Xcode throws an error saying that 'insertString' is undeclared. Something looks very wrong with my code. Please give me guidance.

1
  • To expand on what @jop said, its [receiver message (possibly arguments here, arguments are indicated by a : colon)]. In this case, the correct format is [a /*receiver*/ insertString: /*message*/ @"-" atIndex: 0 */arguments*/] Commented Oct 12, 2013 at 14:05

1 Answer 1

6

put the object inside the brackets:

[a insertString: @"-" atIndex: 0];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.