在目标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];}
海绵宝宝撒
肥皂起泡泡
慕盖茨4494581
叮当猫咪
随时随地看视频慕课网APP
相关分类