0

раньше я формировал строки таким для AlertView

NSString *alertForGuessWin1 = [[NSString alloc]initWithFormat:@"You guess number %d ",i_2];
NSString *alertForGuessWin2 = [[NSString alloc]initWithFormat:@"for: %d step" , count_step];
NSString *alertForGuessWin3 = [alertForGuessWin1 stringByAppendingString:alertForGuessWin2];

UIAlertView *alertGuessWin =[[UIAlertView alloc]initWithTitle:@"Congratulation"
                                                     message:alertForGuessWin3
    delegate:self cancelButtonTitle:@"New Game" otherButtonTitles:nil, nil];
[alertGuessWin show];

Возникли вопросы, как формировать строку прям в message (c использыванием переменных и текста) чтоб в одну строку уложиться.

И Самое главное, как сделать перенос строки ( в c++ было чтото типа /n )

1 ответ 1

0

Утро вечера мудренее:

UIAlertView *alertGuessWin =[[UIAlertView alloc]initWithTitle:@"Congratulation"                                                    message:[[NSString alloc]initWithFormat:@"You guess number %d \n for: %d step",i_2,count_step]
                                                         delegate:self cancelButtonTitle:@"New Game" otherButtonTitles:nil, nil];
    [alertGuessWin show];

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.