ios - How can I pass the value of picker to select my Entity -
i learning core data creating expenses tracker app. have 2 entities , category , transaction. category can hold many transactions , model created correctly.
i have picker selecting category addtransactionviewcontroller. use following code save transaction when save button pressed
_savedtransaction.type = [_pickercategories objectatindex:[_picker selectedrowincomponent:0]]; _savedtransaction.timestamp = [nsdate date]; _savedtransaction.amount = transactionamount.text _savedtransaction.category = _transactioncategory;
i sure doing stupid save because _savedtransaction.category
is returning null
when log it. other parameters log correctly, transaction saved... how can store transactioncategory value set picker?
you have pass value of picker view category
_savedtransaction.category = [_pickercategories objectatindex:[_picker selectedrowincomponent:0]];
Comments
Post a Comment