-2

I have an entity called "People" with 2 attributes, I need to add an entity to full Array

Something like:

self.personaDetail.nombre = self.textNombre.text; [self._personas addObject: self.personaDetail.nombre];

Can you help?

Thank you, greetings.

  • self.personaDetail.nombre=self.textNombre.text; self.personaDetail.precio=self.textprecio.text; [_personas addObject:personaDetail]; self.viewResumen.text=[_personas objectAtIndex:0]; me an exception occurs: 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil' Thank you, greetings. – user3666332 May 22 '14 at 19:26

1 Answers1

0

If you want to add an instance of People into a NSMutableArray just do this:

NSMutableArray *peopleArray = [[NSMutableArray alloc] init];
[peopleArray addObject:person1];

Or if you want to add just "his" name do this:

[peopleArray addObject:person1.nombre];

Or:

[peopleArray addObject:[person1 nombre]];