Rap*_*eta 5 xcode exc-bad-access objective-c nsdictionary ios4
我正在尝试根据数组中的NSDictionary
位置添加数组中的对象NSArray
,但是一旦NSDictionary
分配,应用程序就会崩溃.有什么想法吗?
NSString *venue_title = [venues objectAtIndex:[actionSheet tag]];
NSString *venue_address = [venues_full_address objectAtIndex:[actionSheet tag]];
NSString *venue_lat = [venues_lat objectAtIndex:[actionSheet tag]];
NSString *venue_lng = [venues_lng objectAtIndex:[actionSheet tag]];
NSLog(@"%@, %@, %@, %@", venue_title, venue_address, venue_lat, venue_lng);
NSDictionary *venue_details_dict = [[NSDictionary alloc] initWithObjects:[NSArray arrayWithObjects:venue_title, venue_address, venue_lat, venue_lng, nil] forKeys:[NSArray arrayWithObjects:@"name", @"address", @"lat", "lng", nil]];
Run Code Online (Sandbox Code Playgroud)
我在NSLog对象时看到所有正确的值,但NSDictionary使应用程序崩溃并出现EXC_BAD_ACCESS
错误.我NSZombies
启用了,但是当它像经常显示的那样崩溃时没有显示任何内容.关于这里发生了什么的任何想法?提前致谢!
bbu*_*bum 12
NSDictionary *venue_details_dict = [[NSDictionary alloc] initWithObjects:
[NSArray arrayWithObjects:venue_title, venue_address, venue_lat, venue_lng, nil]
forKeys:
[NSArray arrayWithObjects:@"name", @"address", @"lat", "lng", nil]];
Run Code Online (Sandbox Code Playgroud)
你忘了@
的"lng"
.繁荣.
归档时间: |
|
查看次数: |
2544 次 |
最近记录: |