在目标C中向NSMutableArray添加对象时遇到困难
/////////////////////////////////////////////////////// Inside the header file Class.h@interface MyViewController : UIViewController { NSMutableArray *viewedCardsArray; //snip ...}@property (nonatomic, retain) NSMutableArray *viewedCardsArray;@end/////////////////////////////////////////////////////// Inside the methods file Class.m#import "StudyViewController.h"@implementation StudyViewController@synthesize viewedCardsArray //snip ...- (IBAction)doShowCard { //snip ... NSNumber *cardIdObject = [[NSNumber alloc] initWithInt:(int)[self.currentCard cardId]]; [viewedCardsArray addObject: cardIdObject]; [cardIdObject release];}
aluckdog
扬帆大鱼
慕田峪4524236