我正在用 Objective-C iOS6 ARC 编写应用程序。这是一段代码:
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.
问题是什么?此致