草庐IT

myapplication-application-context

全部标签

ios - 安装socket mobile scan api sdk后报"The application bundle does not contain a valid identifier"

通过cocoapod安装SocketMobileScanApiSdk后,我无法再在真实设备上运行。我注意到sdk包含“资源”组。但是即使重命名并删除“资源”组后,我也无法在真实设备上运行该项目。我在Xcode7.3.1上使用“scanapisdk-10-3-412”并尝试在ipadAir2上运行。 最佳答案 我发布答案是为了以防其他人将来遇到同样的问题。正如我在原始问题中评论的那样。此问题已通过删除项目目标名称中的空格来解决(例如,示例项目->示例项目)。我不确定导致问题的真正原因是什么。然而,在我重新命名我的项目目标后,我不再遇到

iphone - CGContextFillRects : invalid context - Objective C

我有这段代码可以为我的图像提供我需要的颜色:-(UIImage*)convertToMask:(UIImage*)image{UIGraphicsBeginImageContextWithOptions(image.size,NO,image.scale);CGRectimageRect=CGRectMake(0.0f,0.0f,image.size.width,image.size.height);CGContextRefctx=UIGraphicsGetCurrentContext();//Drawawhitebackground(forwhitemask)CGContextSet

ios - 在 Xcode 7、iOS 9 "Application windows are expected to have a root view controller at the end of application launch"

我的控制台出现错误并崩溃。“Applicationwindowsareexpectedtohavearootviewcontrollerattheendofapplicationlaunch”下面是我的一段代码,输入返回YES行后会发生崩溃。-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{UIImageView*defaultImage=[[UIImageViewalloc]initWithImage:splashImage]

ios - 供应配置文件不包括 com.apple.security.application-groups 权利

我在配置Xcode配置文件时遇到错误。Provisioningprofile$ProfileNamedoesn'tincludethecom.apple.security.application-groupsentitlement.如何修复它。看来我的配置文件/证书没有某些功能。如何/在何处添加这些功能?更新在标记为重复的帖子中,SharingdatainbetweenappsinIOS发布者要求使用通用方法在应用程序之间共享数据,但在这篇文章中,我要求解决我在组间共享数据时遇到的特定构建错误。 最佳答案 首先,您必须在AppleD

ios - 如何删除 "View Based Application"中的状态栏 - iOS

这是我努力习惯使用XCode4的一部分...好的,所以我在XCode4中创建了一个新项目并使用了ViewBasedApplication模板;我希望构建新的应用程序,因为Apple希望我使用此模板。所以我正在使用从AppDelegate调用的自动创建的ViewController(到目前为止我还没有触及任何东西)。现在,我想删除状态栏。据我所知,我应该做的是转到查看XIB并在AttributesInspector中将StatusBar字段设置为无(到目前为止我就是这样做的),但是当我运行应用程序时,状态栏仍然存在(!)。我还尝试在ma​​inWindow.xib文件上做同样的事情(将S

web-applications - 是否可以从保留的 IP block 接收 Web 客户端请求?

根据https://www.arin.net/knowledge/rfc/rfc1918.txt,我的webapp收到了来自10.18.255.249的请求(但是10.0.0.0/9cidrblock被保留)这怎么可能? 最佳答案 10.0.0.0/8保留给内部专用网络。如果您在公司环境中,会经常在该范围内分发IP地址。虽然他们不应该通过互联网传播,但大公司会让使用该范围的数据包飞遍各地。如果您在托管环境中收到此信息(即您的网络应用面向互联网),则您的托管服务提供商可能正在访问您的页面。我已经看到这种情况发生在为监控服务级别协议(p

xcode - swift 2.0 : Type of expression is ambiguous without more context (Using Parse)

我一直收到错误消息“表达式类型不明确,没有更多上下文”。我的代码如下:funcfetchUnviewedUsers(callback:([User])->()){PFQuery(className:"Action").whereKey("byUser",equalTo:(PFUser.currentUser()?.objectId)!).findObjectsInBackgroundWithBlock{(objects,error)->VoidinletseenIDS=map(objects,{$0.objectForKey("toUser")!})PFUser.query()!.wh

android.content.Context.getPackageName()' 在空对象引用上

我正在使用实现接口(interface)的fragment。publicclassSigninFragmentextendsFragmentimplementsSigninInterfacefragment类中接口(interface)的方法实现如下。@OverridepublicvoidafterSubmitClicked(StringuserId,Bundlebundle){Log.d(TAG,"CallingtimeafterSubmitClickedcalled"+bundle);if(!userId.equals("-1")){//Loggedinsuccessfully//

android.content.Context.getPackageName()' 在空对象引用上

我正在使用实现接口(interface)的fragment。publicclassSigninFragmentextendsFragmentimplementsSigninInterfacefragment类中接口(interface)的方法实现如下。@OverridepublicvoidafterSubmitClicked(StringuserId,Bundlebundle){Log.d(TAG,"CallingtimeafterSubmitClickedcalled"+bundle);if(!userId.equals("-1")){//Loggedinsuccessfully//

ios - swift - NSPredicate 和 Context Save 运行不正常

我有一个检查核心数据的功能。如果不存在,它应该写入其中(但它不是那样工作的)SoundItems是一个包含收藏对象的数组,mainArray是包含真实对象的数组;@IBActionfuncFavori(_sender:Any){//savecoredataletapp=UIApplication.shared.delegateas!AppDelegateletcontext=app.persistentContainer.viewContextletnewSound=NSEntityDescription.entity(forEntityName:"Sounds",in:context