Question: I am working on a legacy C application that is currently single user. I want to modify it so that it is multi user.

The current application makes uses user permissions to load relevant data (for the current user), into shared memory. I want to implement a dictionary like structure in shared memory so that relevant data is stored using a unique user key - however, a naive dictionary structure will result in the data held in the dictionary being duplicated, as all users share the same data, but are only allowed restricted 'views' of the data, based on their role/permission.

Can someone suggest a data structure thst provides the 'look up' behaviour of a dictionary, yet avoids duplicity of data that a 'naive' dictionary would inevitably result in?

Note: My application is in C, so I cannot use classes, I will need a data structure that can be implemented in C, and stored in shared memory.

Answer: 
Try this

```
 - (void)viewDidLoad
{
[super viewDidLoad];

 [[NSNotificationCenter defaultCenter]
 addObserver:self
 selector:@selector(textFieldTextDidChangeOneCI:)
 name:UITextFieldTextDidChangeNotification
 object:textfield];
 }

```

Also modify your method

```
 -(void)textFieldTextDidChangeOneCI:(NSNotification *)notification
 {
UITextField *textfield=[notification object];
NSLog(@"%@",textfield.text);

 }

```
Try to use this one 

```
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
   [self textFieldTextDidChangeOneCI:textField];
    return YES;
}

```