gpt4 book ai didi

objective-c - 为什么我的iPhone不振动?

转载 作者:行者123 更新时间:2023-12-01 18:01:14 25 4
gpt4 key购买 nike

当我从UITableView中选择一个单元格时,我尝试使用“振动”。

在我的didselectedRowAtIndexPath中,我输入了以下代码:

    #pragma mark - DidselectRow

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

//SPINNER
[spinner startAnimating];


//[self performSelector:@selector(pushDetailView:) withObject:tableView afterDelay:0.1];

int *riga = indexPath.row;
[NSThread detachNewThreadSelector:@selector(pushDetailView) toTarget:self withObject:riga];

////////////////////////////////////////////////////////////////////////////////
// VIBRATION ALLERT //
////////////////////////////////////////////////////////////////////////////////

// Issue vibrate
//AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
NSLog(@"Vibra?");
////////////////////////////////////////////////////////////////////////////////
// VIBRATION ALLERT FIN //
////////////////////////////////////////////////////////////////////////////////



NSLog(@"Seleziono l'immagine: %@", [photoTitles objectAtIndex:indexPath.row]);

//creo un'istanza di DettaglioView
DettaglioView *dettaglioImmagine = [[DettaglioView alloc] initWithNibName:@"DettaglioView" bundle:nil];



//Inseirsco il titolo nella Navigation BAR della vista
dettaglioImmagine.titoloSource = [photoTitles objectAtIndex:indexPath.row];

dettaglioImmagine.imageCoverSource = [photoURLsLargeImage objectAtIndex:indexPath.row];
NSLog(@"imageCoverSource: %@", dettaglioImmagine.imageCoverSource);


//passo alla vista del DettaglioView con l'animazione usando il pushViewController
[self.navigationController pushViewController:dettaglioImmagine animated:YES];


//pulisco lo style della cella selezionata togliendo il fondino blu
[tableView deselectRowAtIndexPath:indexPath animated:YES];



}

但是,当我单击手机时,iPhone不会振动。
Why为什么?
有人可以帮助我吗?

最佳答案

检查您的iPhone声音设置。如果在“设置”中禁用了振动,则iPhone根本不会振动,即使振动是由应用程序引起的。

关于objective-c - 为什么我的iPhone不振动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9513279/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com