save - Saving a text from UIAlertView -
i have written uialertview
code textfield
, want write code store whatever typed user pushable detail list. how can that?
- (ibaction)newreference:(id)sender { uialertview *newreference = [[uialertview alloc] initwithtitle:@"new reference" message:@"enter name" delegate:self cancelbuttontitle:@"cancel" otherbuttontitles: @"done",nil]; newreference.alertviewstyle = uialertviewstyleplaintextinput; [newreference textfieldatindex:0].delegate = self; [newreference show]; }
here go sir. per comment above, if want store data nsuserdefaults here how it:
nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; nsstring* savedata = [[newreference textfieldatindex:0] text]; [defaults setobject:savedata forkey:@"whatever key want here"]; [defaults synchronize];
then invoke or call it:
nsstring* recalldata = [defaults objectforkey:@"whatever key named above"];
happy coding -
Comments
Post a Comment