Search code examples
iosobjective-cstringinstagram-apiformat-string

Add linebreak or newline in Instagram text from objective-c text


I'm using the Instagram API from Xcode but I can not insert a line break in text using \n. Can anyone help me adding a new line in the caption/comment on instagram text from XCode?

    NSString *repostText = [NSString stringWithFormat:@"#Repost %@ com #AppRepost.\r\n                      ・・・                            \r\n", userNameStr];

Solution

  • I Solved the problem.

    After many attempts, I managed to line break in Instagram comments using the Python source code encoding!

    NSString *breakLine = @"\u2029";
    

    This code

    \u2029" - 'PARAGRAPH SEPARATOR'