store data in nsdictionary from uitableview

Mihir Oza

I have a custom editable UITableview, and my question is how to store it's value in NSDictionary when I tapped on submit button. My table is like a simple registration form.

BooRanger

Expanding on my comment:

If I understand you, you want to get data from a UItableViewCell back into the viewController with the tableView and dictionary.

There are two main ways of doing this, you can create a delegate for the cell or create a block on the cell. So once the textfilds are finished being edited call the delegate/block with the new data. Then have the vc save it

Using a block:

MyTableViewCell.h

@interface MyTableViewCell : UITableViewCell

@property (nonatomic, copy) void (^nameChangedBlock)(NSString *name);

@end

MyTableViewCell.m

In something like textfield didFinishEditing:

 - (void)textFieldDidFinishEditing:(UITextField *)textField {

   if (textField == self.nameTextfield) {

         self.nameChangedBlock(textField.text)

   } 
}

In the ViewController with the TableView, in the datasource method cellforRow

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

 // Do your standard stuff create the cell and set data;
 // dequeueReusableCellWithIdentifier: blah blah

   cell.nameChangedBlock = ^{
        // Alex j thank you 
        [yourNSMutableDictionary setObject:yourobject forKey:yourkey];
   };

    return cell
 }

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to get the data from the first cell in a UITableView?

분류에서Dev

nsdictionary에서 uitableview 채우기

분류에서Dev

NSDictionary를 UITableView로 변환

분류에서Dev

NSDictionary data shared between classes

분류에서Dev

Store/ Display Data Inputs from Arrays

분류에서Dev

Store data from asynchronous call to a variable in AngularJS

분류에서Dev

uitableview에서 nsdictionary에 데이터 저장

분류에서Dev

how to store data to local device from server with titanium?

분류에서Dev

How store data in an associative array from an input field?

분류에서Dev

Fetch NSarray from the NSDictionary of NSArray using objectForKey

분류에서Dev

Get object from array with NSDictionary objects

분류에서Dev

Get float value out from NSDictionary

분류에서Dev

이 nsdictionary 데이터를 uitableview에 채우는 방법

분류에서Dev

UITableView custom cell not displaying data

분류에서Dev

How to read and store data from a text file in which the first line are titles, and the other lines are related data

분류에서Dev

Does the terminal store data?

분류에서Dev

Efficient way to store data

분류에서Dev

Coherence client - not store data

분류에서Dev

Send HTTP Post parameters from an NSDictionary to a web service

분류에서Dev

NSArray가있는 UITableview에는 NSDictionary가 포함되어 있고 NSDictionary에는 다른 NSDictionary가 포함되어 있습니다.

분류에서Dev

uitableview swift 3.0에 모든 키에 대한 nsdictionary 값을 삽입하는 방법

분류에서Dev

how to store data from excel sheet into mysql database using jdbc connection

분류에서Dev

UITableView data displays multiple times when scrolling

분류에서Dev

Xcode Swift change data uitableview on sidemenu

분류에서Dev

store data ordered by a row in mysql?

분류에서Dev

Store css data in django db

분류에서Dev

Store tree data structure in database

분류에서Dev

Store data to different Object but overwritten

분류에서Dev

How to store a data table in database?

Related 관련 기사

  1. 1

    How to get the data from the first cell in a UITableView?

  2. 2

    nsdictionary에서 uitableview 채우기

  3. 3

    NSDictionary를 UITableView로 변환

  4. 4

    NSDictionary data shared between classes

  5. 5

    Store/ Display Data Inputs from Arrays

  6. 6

    Store data from asynchronous call to a variable in AngularJS

  7. 7

    uitableview에서 nsdictionary에 데이터 저장

  8. 8

    how to store data to local device from server with titanium?

  9. 9

    How store data in an associative array from an input field?

  10. 10

    Fetch NSarray from the NSDictionary of NSArray using objectForKey

  11. 11

    Get object from array with NSDictionary objects

  12. 12

    Get float value out from NSDictionary

  13. 13

    이 nsdictionary 데이터를 uitableview에 채우는 방법

  14. 14

    UITableView custom cell not displaying data

  15. 15

    How to read and store data from a text file in which the first line are titles, and the other lines are related data

  16. 16

    Does the terminal store data?

  17. 17

    Efficient way to store data

  18. 18

    Coherence client - not store data

  19. 19

    Send HTTP Post parameters from an NSDictionary to a web service

  20. 20

    NSArray가있는 UITableview에는 NSDictionary가 포함되어 있고 NSDictionary에는 다른 NSDictionary가 포함되어 있습니다.

  21. 21

    uitableview swift 3.0에 모든 키에 대한 nsdictionary 값을 삽입하는 방법

  22. 22

    how to store data from excel sheet into mysql database using jdbc connection

  23. 23

    UITableView data displays multiple times when scrolling

  24. 24

    Xcode Swift change data uitableview on sidemenu

  25. 25

    store data ordered by a row in mysql?

  26. 26

    Store css data in django db

  27. 27

    Store tree data structure in database

  28. 28

    Store data to different Object but overwritten

  29. 29

    How to store a data table in database?

뜨겁다태그

보관