小编For*_*est的帖子

为什么我得到一个EXC_BAD_ACCES

嘿.我一直在研究Twitter应用程序,并且已经在EXC_ BAD_ ACCESS错误上停留了很长时间.我知道EXC_ BAD_ ACCESS是一个内存问题,但我无法确定问题所在.这是我的代码示例:

- (void)viewDidLoad {
   [super viewDidLoad];

   NSString *path = @"/Volumes/Schools/BHS/Student/740827/Documents/Forrest McIntyre CS193P/Presence2";
   NSArray *propList = [NSArray arrayWithContentsOfFile:[NSBundle pathForResource:@"TwitterUsers" ofType:@"plist" inDirectory:path]];

   people = [[NSMutableArray alloc]init];

   for (NSString *name in propList) {
     Person *p = [[Person alloc] initWithUserName: name];
     [people addObject: p];
     [p release];
   }
   // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
   // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
Run Code Online (Sandbox Code Playgroud)

注释后的最后一个大括号抛出异常.我相信它确实被扔进了某个地方的for循环中,但只是出现了.

这是Person的实现文件:

@implementation Person
@synthesize image;
@synthesize username;
@synthesize displayName; …
Run Code Online (Sandbox Code Playgroud)

iphone twitter objective-c

0
推荐指数
1
解决办法
725
查看次数

标签 统计

iphone ×1

objective-c ×1

twitter ×1