NSMutableArray加载项不影响计数?有人能告诉我为什么即使我在日志中添加对象,日志记录(Sel.giftiescount)仍然返回0吗?标题:#import <UIKit/UIKit.h>@interface Test2AppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
NSMutableArray *giftees;}@property (nonatomic, retain) UIWindow *window;@property (nonatomic, retain) NSMutableArray *giftees;@end电话:- (void)bootstrapGiftees{
NSArray *gifteeNames = [NSArray arrayWithObjects:@"Jesse",,nil];
for (NSString *gifteeName in gifteeNames)
{
GifteeModel *g = [[GifteeModel alloc] init];
g.name = gifteeName;
[self.giftees addObject:g];
NSLog(@"giftees count = %d", [self.giftees count]);
[g release];}}
- 2 回答
- 0 关注
- 353 浏览
添加回答
举报
0/150
提交
取消