草庐IT

Out-Null

全部标签

ios - 如何以编程方式模拟 "pinch out"手势?

我正在开发iOS应用。我添加了一个UIPinchGestureRecognizer来监听双指张开Action。[[selfview]addGestureRecognizer:[[UIPinchGestureRecognizeralloc]initWithTarget:selfaction:@selector(handlePinchOutGesture:)]];-(void)handlePinchOutGesture:(UIPinchGestureRecognizer*)recognizer{if(recognizer.state==UIGestureRecognizerStateBeg

Android 解决Connection timed out: connect或者部分第三方库下载超时问题

之前比较老的项目重新打开,因为AndroidStudio版本已经升级,导致原来部分的第三方库需要重新下载,但是因为墙或者其他原因,一直下载超时。后续解决了此问题,在此记录一下。新版本的AndroidStudio在项目目录下的settings.gradle文件中添加如下代码:pluginManagement{repositories{maven{url'https://maven.aliyun.com/repository/public/'}maven{url'https://maven.aliyun.com/repository/google/'}maven{url'https://maven

ios - MvxViewModelRequest 在 ViewDidLoad 中为 null

我在iPad项目中使用MvvmCross3.0.12。目前,我在MvxViewControllerExtensionMethods.LoadViewModel中得到一个NPE,因为touchView.Request为空。这只发生在继承自MvxTableViewController的ViewController中;从MvxViewController继承的ViewController加载和显示都很好。我在MvxTouchViewsContainer.CreateView->MyTableViewController.Ctor->MvxBaseTouchViewPresenter.Show

ios - AVAudioPlayer 始终为 null,其 isPlaying 属性始终为 false。播放时文件混合

过去三天我一直在拔头发来解决这个问题。我检查了很多示例代码,阅读了很多教程,在stackoverflow上搜索和检查了很多问题和答案,但我仍然无法解决问题。有几个类似的问题,如this或this但他们也没有任何解决方案。关于我的项目:我有一个NIKMasterViewController和一个NIKDetailViewController。在第一个中,我在表格View中有一个音频文件列表;选择一行,它会导航到NIKDetailViewController,用户可以在其中查看有关文件的一些信息并播放音频文件。我在NIKMasterViewController中定义了一个AVAudioPl

GitHub 异常 - 无法连接22端口 Connection timed out

GitHub异常-无法连接22端口Connectiontimedout问题描述错误信息:今天突然用ssh方式pullGitHub的项目报:ssh:connecttohostxx.xx.xx.xxport22:Connectiontimedout表明SSH连接在尝试通过22端口连接到远程服务器时超时。这可能是由于网络环境、防火墙设置或代理配置等原因导致的(很可能端口22被防火墙或提供商阻止了)。GitHub允许使用443端口为了解决此问题,我们可以尝试将SSH连接切换到443端口。~/.ssh/config文件中添加以下内容:Hostgithub.comHostnamessh.github.co

已解决java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 异常的正确解决方法,亲测有效!!!

已解决java.lang.ArrayIndexOutOfBoundsException:Index0outofboundsforlength0异常的正确解决方法,亲测有效!!!文章目录报错问题解决思路解决方法交流报错问题java.lang.ArrayIndexOutOfBoundsException:Index0outofboundsforlength0解决思路这个错误通常是由于访问了一个空数组或者超出了数组长度范围导致的。下滑查看解决方法解决方法要解决这个问题,你可以按照以下几个步骤进行:检查数组是否为空:在访问数组之前,确保数组已经被正确初始化并且不是空的。你可以使用array.lengt

ios - Facebook Developer API iOS,age_range 返回 NULL

这是我的代码,我在这里做错了什么?请记住,我使用的是FBLoginView,其他字符串返回实际有效结果,而不是年龄范围。提前致谢,-丹尼尔-(void)loginViewFetchedUserInfo:(FBLoginView*)loginViewuser:(id)user{NSString*userID=[NSStringstringWithFormat:@"%@",user.objectID];//objectIDinstead?NSLog(@"userID=%@",userID);NSString*nameFull=[NSStringstringWithFormat:@"%@",

ios - NSFetchedResultsController 尝试将第 1 行插入第 0 节,但在使用 userInfo(null)更新后第 0 节中只有 0 行

我将NSFetchedResultsController与UITableViewController一起使用。我成功地将新对象添加到分离View中的核心数据,ParseStarterProjectAppDelegate*appDelegate=[[UIApplicationsharedApplication]delegate];NSManagedObjectContext*context=[appDelegatemanagedObjectContext];NSManagedObject*newWorkout;newWorkout=[NSEntityDescriptioninsertNe

android - Social.localUser.Image 在 Unity3d 中返回 null

我想在Android和IOS中访问玩家头像,我可以使用SocialClass获取用户ID和用户名,但图像总是返回null!!if(Social.localUser.authenticated&&Social.localUser.image!=null){Materialm=newMaterial(Shader.Find("Unlit/TransparentColored"));m.mainTexture=Social.localUser.image;AvatarImage.material=m;}任何想法。 最佳答案 SocialA

ios - 当单元格不可见时,UITableView indexPathForCell 返回 null

我有一个UITableView,其中有很多高行(一次只有2-3行适合屏幕),当特定View已添加到UITableViewCell层次结构时,我有一些代码以编程方式滚动到特定行。如果目标行在屏幕上可见,则indexPathForCell返回正确的NSIndexPath。如果用户必须向下滚动才能看到目标行,则返回的NSIndexPath为空。代码如下:-(void)scrollToLastSelection{if((firstLabel)&&(secondLabel)){UITableViewCell*targetCell=[selfgetTableViewCellFromSubview: