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.categoryis 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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -