Question: I'm trying to hide my UITextField in my app. 
I first tried to do it with a UIButton.. 

Therefor I made this: 

```
-(IBAction)hide:(id)sender {

_textField.hidden = !_textField.hidden;

}

```

This worked but now I'm trying to do it automatically after editing so I wrote this code: 

```
 -(void)textFieldDidEndEditing:(UITextField *)textField {

 textField.hidden = YES;

 }

```

In the .h I put this code: 

```
-(void)textFieldDidEndEditing:(UITextField *)textField;

```

Could anyone tell me why this isn't working? 

Is it possible to hide it with an animation? 
I tried this which wasn't working:

```
[UIView animateWithDuration:2.0 animations:^
{ code.. }
]

```

Thanks for helping me!

Answer: 
What you want is a style of a "COLUMN BASED" memory access

You can easily implement it using `std::vector` as your column type or create your own "column" type with your own underlying memory management - but `std::vector` should work just fine

Now once you have your column type you create your "TABLE" type.

In a way your table cab be just a vector of vectors. You can of course wrap it up in order to get better looking accessors (If you want to access by row (object) first and column (property) after.

This is I think the best general approach.

Even In your specific case - since you want to save memory using bit length flags, as mentioned by Bart van Ingen Schenau you can use a `vector<bool>` so the general approach stands
Not sure that understood correctly the question. It looks like you are trying to allocate data in a sequential array of bytes. Why?
but in any case you could do it simply by using arrays:

```
class Cell {
   std::bitset<64> flags;
   int order;
   double coordinates[2];
}

int main() {
   const int maxNoCells = 10000;
   Cell cells[maxNoCells];

   for(int i = 0; i < maxNoCells; i++) {
       cells[i].flags = ...;
       cells[i].coordinates[0] = i;
       cells[i].coordinates[1] = -i;
       cells[i].order=2;
   }
}

```

and then cast it to (char \*)cells if needed. Your classes will be allocated in a segmented fashion in a contiguous memory strip. You could use it for read/write/net. The only issue is that you have to take care of 32/64 bit alignments in particular if it is
shared between different architectures.

Here is another version which would be a bit better for caching if you insist on using different fields in separate loops:

```
template<int size>
class CellAccessor {
    std::bitset<64> flags[size];
    int order[size];
    double coordinates[size][2];
 public:
    std::bitset<64> &getFlags(int id) {
        return flags[id];
    }
    int &getOrder(int id) {
        return order[id];
    }
    ...
 }

main() {

    CellAccessor<10000> ca;

    for(...i++) {
        ca.getOrder(i) = 2;
        ca.getCoordinates(i)[0] = i;
        ...
    }
 }

```