草庐IT

STATUS_ACCESS_VIOLATION

全部标签

objective-c - 主程序中的 EXC_BAD_ACCESS()

我在main()中得到了一个EXC_BAD_ACCESS,这是我的代码:intmain(intargc,char*argv[]){NSAutoreleasePool*pool=[[NSAutoreleasePoolalloc]init];intretVal=UIApplicationMain(argc,argv,nil,@"TestBedAppDelegate");[poolrelease];returnretVal;}@interfaceTestBedAppDelegate:NSObject@end@implementationTestBedAppDelegate-(void)app

iphone - 插入 subview 时出现 EXC_BAD_ACCESS? (iPhone)

当我在我的iPhone上使用insertSubview:atIndex:方法时,程序无法运行,main.m文件中有EXC_BAD_ACCESS。但是,当我使用presentModalViewController时,程序运行完美。此外,方法switchToView在第一次使用时有效,但在不同的to和from中,但第二次则不然。出了什么问题?这是我的代码:-(void)tableView:(UITableView*)tableViewdidSelectRowAtIndexPath:(NSIndexPath*)indexPath{ShowBookDetails*sbd=[[ShowBookD

iphone - 显示 UIAlertView 会导致 EXC_BAD_ACCESS

这个问题在这里已经有了答案:UIAlertViewfailstoshowandresultsin“EXC_BAD_ACCESS”error(6个答案)关闭9年前。我正在使用AFNetworking发出网络请求。Web请求完成后。我想要显示一个UIAlertView。我正在使用ARC,代码似乎可以在设备上运行。如果我使用模拟器,我会得到一个错误:EXC_BAD_ACCESS我做错了什么?UIAlertView*postSubmitAlertView=[[UIAlertViewalloc]init];postSubmitAlertView.delegate=self;[postSubmit

C或C++报错:ld returned 1 exit status报错的原因

        C或C++报错:ldreturned1exitstatus(ld返回1,退出状态)可能是以下原因:        1)程序正在运行,无法编译,上次运行的窗口未关闭。程序窗口重复运行没有及时关闭,存在多个打开窗口,得一个个都关闭了再编译。                2)一个项目中有多个xx.c文件,将多余的xx.c文件改成头文件即可。        3)有函数拼写错误,如:printf拼写成prntf。scanf()写成scan()等。        4)main()函数拼写错误,如写成mian绵羊        如果检查了以上情况都无法解决,那一般是自定义函数出错     

subprocess.CalledProcessError: Command ‘(‘lsb_release‘, ‘-a‘)‘ returned non-zero exit status 1.

ERROR:Exception:Traceback(mostrecentcalllast): File"/usr/local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py",line180,in_main  status=self.run(options,args) File"/usr/local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py",line204,inwrapper  returnfunc(self,options,args) 

ios - EXC_BAD_ACCESS 扩展 CLPlacemark 时——在定义范围之外访问的变量

我有一个问题,我已经找到了解决方法,但我想了解为什么它不起作用——因为它对我来说毫无意义。这是一个演示我的问题的最小示例:importXCTestimportCoreLocationclassExampleTests:XCTestCase{varokay:ext!//thistestworksfinefunctestOkay(){okay=ext()XCTAssertNotNil(okay)}//thistestcrasheswithEXC_BAD_ACCESS(code=1,address=0x10)functestNotOkay(){letnotOkay:extnotOkay=ex

ios - 获取错误线程 1 : EXC_BAD_ACCESS (code=EXC_I386_GPFLT) when loading AVPlayer

当我选择一个collectionViewCell时,我试图加载一个AVPlayer,这是我在didSelectItem中的代码:funccollectionView(_collectionView:UICollectionView,didSelectItemAtindexPath:IndexPath){ifletitem=items?[indexPath.item]{showPlayer(item:item)}}funcshowPlayer(item:Item){letplayerLauncher=PlayerLauncher()playerLauncher.showVideoPlay

ios - 关闭 View Controller 时的 Exc_bad_access

有一段时间我一直在努力寻找解决方案,我搜索了google、stackoverflow但无法解决这个问题。我有2个ViewController(我们称它们为VC1和VC2),我可以毫无问题地在它们之间切换。为了展示VC2,我使用:UIStoryboard*storyboard=[UIStoryboardstoryboardWithName:@"MainStoryboard"bundle:nil];UINavigationController*ctrl=[storyboardinstantiateViewControllerWithIdentifier:@"histListID"];[se

ios - EXC_BAD_ACCESS 尝试返回 uint64_t 数字时

当我尝试记录此函数的结果时,我一直收到EXC_BAD_ACCESS吗?我做错了什么?-(uint64_t)rand64bitNum{uint32_tleft=arc4random();uint32_tright=arc4random();uint64_trandNum=0;memcpy(&randNum,&left,sizeof(left));uint16_toffset=sizeof(left);memcpy(&randNum+offset,&right,sizeof(right));returnrandNum;} 最佳答案 &r

iphone - [indexPath 行] 中的 EXC_BAD_ACCESS

我正在自定义我的表格单元格。我有这段代码(简化),它在尝试访问[indexPathrow]时给我一个EXC_BAD_ACCESS-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{staticNSString*CellIdentifier=@"WCFPictureCell";staticNSString*CellNib=@"WCFPictureCell";WCFPictureCell*cell=(WCFPictureCell*)[tableVi