How can I escape slashes and quotes in Objective-C?

前端 未结 1 1640
不思量自难忘°
不思量自难忘° 2021-01-28 17:45

I would like to do the following

[controller setMessageBody:[NSString stringWithFormat:@\"%@ 

%@
<
1条回答
  •  生来不讨喜
    2021-01-28 18:34

    Just use

    @"....Hello..."
    

    if you put it in the format, or use

    @"Hello"
    

    if you include it using %@ in the format string. The %@ is only interpreted in the first argument of the stringWithFormat: method here.

    0 讨论(0)
提交回复
热议问题