NSMutableArray加載項(xiàng)不影響計(jì)數(shù)?有人能告訴我為什么即使我在日志中添加對象,日志記錄(Sel.giftiescount)仍然返回0嗎?標(biāo)題:#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 回答

叮當(dāng)貓咪
TA貢獻(xiàn)1776條經(jīng)驗(yàn) 獲得超12個(gè)贊

精慕HU
TA貢獻(xiàn)1845條經(jīng)驗(yàn) 獲得超8個(gè)贊
- 2 回答
- 0 關(guān)注
- 462 瀏覽
添加回答
舉報(bào)
0/150
提交
取消