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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -