我試過在從我的UITableView中選擇一個單元格時使用振動。爲什麼我的iPhone不振動?
在我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不振動。 Soo爲什麼? 有人可以幫助我嗎?
嗨Aleksejs Mjaliks ....這是真的......振動在我的聲音設置中關閉。非常感謝。 – WalterFantauzzi 2012-03-02 07:22:48
感謝Aleksejs現在的工作! – WalterFantauzzi 2012-03-02 08:34:48
@RyoSeaba不要忘記接受正確的答案! :) – 2012-03-02 09:24:02