Я ничего не могу найти. Я не хочу использовать отладчик каждый раз. Как получить печатные сообщения на iphone.
Сообщение о всплывающем сообщении Iphone
Ответ 1
Используйте функцию NSLog:
NSLog(@"Your message here.");
// with parameters:
NSString * myParam = @"Some value";
NSLog(@"myParam:%@", myParam);
Сообщения записываются в журнал консоли. Вы можете просмотреть их в симуляторе, запустив Console.app или переключив XCode на представление Debugger/Console (XCode -> Run -> Console)
Если вы действительно хотите сделать всплывающее предупреждение (например, функцию javascript alert()
), вы можете сделать:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Test Message"
message:@"This is a sample"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
Ответ 2
// open a alert with an OK and cancel button UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"UIAlertView" message:@"My message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; [alert show]; [alert release];
Образцы изображений:
Ответ 3
UIAlertView* alert;
alert = [[UIAlertView alloc] initWithTitle:@"Info" message:@"Much more info" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
[alert release];
Ответ 4
Ищите UIAlertView
с помощью Google или Xcode Documentation Viewer.