【发布时间】:2013-01-23 01:33:25
【问题描述】:
我正在使用 Objective-C iOS6 ARC 编写应用程序。 这是一段sn-p代码:
header file:
@interface Chapter : NSObject
-(void) addPageCount:(int) pCount;
-(int)getPageCount;
@end
//implementation
#import "Chapter.h"
@interface Chapter()
{
int pageCount;
}
@end
-(void)addPageCount:(int) pCount
{
pageCount = pCount;
}
//testing
NSLog(@"%d", [chapter getPageCount]);
Returns -1073750816 once I pass 100.
问题是什么? 最好的问候
【问题讨论】:
标签: ios6 integer automatic-ref-counting instance-variables nslog