Quote:
Originally Posted by Son of a Beach
Show us the code. We can't comment on code we've not seen. Show us the relevant code now that you're adding objects to he array.
|
Code:
- (IBAction)toReviewPressed:(id)sender
{
if (q == nil) {
q = [[NSMutableArray alloc]init];
} if (a == nil) {
a = [[NSMutableArray alloc]init];
}
objq = @"";
obja = @"";
[q addObject:objq];
[a addObject:obja];
i = 1;
}
- (IBAction)inputPressed:(id)sender
{
qText = [[NSString alloc] initWithFormat:qInput.text];
aText = [[NSString alloc] initWithFormat:aInput.text];
[[q objectAtIndex:i]setText:(NSString *) qText];
[[a objectAtIndex:i]setText:(NSString *) aText];
i++;
}
i have objq, obja, q, a, and i declared in the .h file