Hi to all of stackoverflow, i'm Italian so, i'm sorry for my bad English... :D
i tried to create a simple tableView for listing a few names and a number... all with core data.
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
Track *track = [[self fetchedResultsController] objectAtIndexPath:indexPath];
if(YES == self.editing) {
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Modifica nome" message:@"Prego, inserire di seguito il nuovo nome:" delegate:self cancelButtonTitle:@"Annulla" otherButtonTitles:@"Salva", nil];
newname = [[alert addTextFieldWithValue:track.name label:@"Nome"] text];
[alert textField].autocorrectionType = UITextAutocorrectionTypeNo;
[alert show];
[alert release];
[selectedTrack release];
} else {
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Aggiungi minchiate" message:@"Sei sicuro di voler aggiungere una michiata a" delegate:self cancelButtonTitle:@"Annulla" otherButtonTitles:@"Salva", nil];
newname = [[alert addTextFieldWithValue:track.trackAbstract label:@"Minchiate"] text];
[alert textField].autocorrectionType = UITextAutocorrectionTypeNo;
[alert show];
[alert release];
[selectedTrack release];
}
}
I want to send the value of the textfield to my attributes that i've created first... Need I put the code in this method?!
- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (buttonIndex != [alertView cancelButtonIndex])
{
//HERE?!
}
}
And how i can set a new value on a core data attribute? ANY help is appreciated... Thanks in advance!