objective c - Loading data once the data is in array -


[array addobject:textdata.text];          nsuserdefaults *save = [nsuserdefaults standarduserdefaults];  [save setobject:array forkey:@"success" ];  [save synchronize];  -(void) viewdidload  nsuserdefaults *viewdata1 = [nsuserdefaults standarduserdefaults];  [viewdata1 objectforkey:@"success"];  [viewdata1 synchronize];  [tabledata reloaddata]; 

once data saved in array, how upload once app runs again? want data load in table once.

the first step retrieve user defaults. second step not drop on floor.

[viewdata1 objectforkey:@"success"]; 

this one, not other: retrieve it, drop on floor.

you need store object value of property (which means need declare property purpose), then, in table view's data source, return count of array number of rows , objects in array (or properties of objects) row values.

also, shouldn't need call synchronize, after retrieving value.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -