Trying to work with NSMutable array and having trouble -
here is part of the .h file
@class AllAnswers;
@interface StartDeck : UIViewController {
// Class Object to keep track of the past
AllAnswers *allanswers;
NSMutableArray *allanswersArray;
.....
In the .m file
allanswers = [[AllAnswers alloc] initWithFirst:temp1 initWithSecond:temp2 initWithThird:temp3 initWithFourth:temp4 initWithTop:randomTopValue initWithBottom:randomBottomValue];
[allanswersArray addObject:allanswers];
NSLog(@"temp1 - %i", temp1);
NSLog(@"Array - %i",[[self allanswersArray] temp1]);
NSLog(@"Array Count %i", allanswersArray.count);
The Log Shows
2010-01-09 11:50:22.464 FlashCards[10024:207] temp1 - 18
2010-01-09 11:50:22.465 FlashCards[10024:207] Array - 0
(gdb) continue
Current language: auto; currently objective-c
2010-01-09 11:50:25.625 FlashCards[10024:207] Array Count 0
I would think that the Log in Array - would print out the temp1 variable and the Array Count would return 1.
I set a break point and it seems nothing is in the array set.
Any Help would be appreciated.
Thanks,
Jardim
here is part of the .h file
@class AllAnswers;
@interface StartDeck : UIViewController {
// Class Object to keep track of the past
AllAnswers *allanswers;
NSMutableArray *allanswersArray;
.....
In the .m file
allanswers = [[AllAnswers alloc] initWithFirst:temp1 initWithSecond:temp2 initWithThird:temp3 initWithFourth:temp4 initWithTop:randomTopValue initWithBottom:randomBottomValue];
[allanswersArray addObject:allanswers];
NSLog(@"temp1 - %i", temp1);
NSLog(@"Array - %i",[[self allanswersArray] temp1]);
NSLog(@"Array Count %i", allanswersArray.count);
The Log Shows
2010-01-09 11:50:22.464 FlashCards[10024:207] temp1 - 18
2010-01-09 11:50:22.465 FlashCards[10024:207] Array - 0
(gdb) continue
Current language: auto; currently objective-c
2010-01-09 11:50:25.625 FlashCards[10024:207] Array Count 0
I would think that the Log in Array - would print out the temp1 variable and the Array Count would return 1.
I set a break point and it seems nothing is in the array set.
Any Help would be appreciated.
Thanks,
Jardim