草庐IT

APPDELEGATE

全部标签

ios - React Native AppDelegate.m 没有地方改localhost

我刚刚初始化了一个ReactNative项目并想在我的iOS设备上运行,但是当我进入Xcode时,我找不到应该在哪里设置我的开发计算机的IP。[[RCTBundleURLProvidersharedSettings]setDefaults];jsCodeLocation=[[RCTBundleURLProvidersharedSettings]jsBundleURLForBundleRoot:@"index.ios"fallbackResource:nil]; 最佳答案 从react-native0.44.0开始:您需要创建一个名为

iphone - motionEnded 未在 appDelegate 中调用

我想在整个应用程序中集成震动功能。所以我在appDelegate中做所有事情。我需要插入一个viewController,我能够插入motionBegan,但我想这样做motionEnded。是的,运动结束确实在ViewController中工作,但在应用程序委托(delegate)中它没有被调用。做为-(void)applicationDidBecomeActive:(UIApplication*)application{[selfbecomeFirstResponder];}-(BOOL)canBecomeFirstResponder{returnYES;}motionEnded未

ios - 处理在 AppDelegate 中打开多个 URL

我有以下代码:-(BOOL)application:(UIApplication*)applicationopenURL:(NSURL*)urlsourceApplication:(NSString*)sourceApplicationannotation:(id)annotation{return[BraintreehandleOpenURL:urlsourceApplication:sourceApplication];}但FacebookSDK集成要求我这样做:-(BOOL)application:(UIApplication*)applicationopenURL:(NSURL

iphone - AppDelegate UIWindow addSubView 在不同的 viewController

我正在尝试从UIViewController在AppDelegate的UIWindow中添加一个UILabel。我就是这样做的:AppDelegate代码:-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{self.window=[[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]]autorelease];//Overridepointforcustomizat

iphone - 将坐标从 appDelegate 中的 locationManager 传递到 viewController

我试图在viewController出现时获取用户的坐标。我需要几个viewController中的位置,所以我将locationManager放在appDelegate中。我的问题是,在第一个viewDidAppear上,尚未找到坐标。我应该如何改变这个?谢谢大家!!!我的AppDelegate有这个:-(NSString*)getUserCoordinates{NSString*userCoordinates=[NSStringstringWithFormat:@"latitude:%flongitude:%f",locationManager.location.coordinat

iphone - 核心数据 : UIManagedDocument or AppDelegate to setup core data stack?

我对在哪里设置我的核心数据堆栈有点困惑。在Appdelegate中或使用UIManagedDocument的共享实例,在此处描述?:http://adevelopingstory.com/blog/2012/03/core-data-with-a-single-shared-uimanageddocument.html现在我在我的AppDelegate中设置了核心数据堆栈,我正在ViewController之间传递我的MOC。但是迁移到UIManagedDocument并创建一个共享实例会更好吗,这样我就不必一直传递MOC了?还因为它较新? 最佳答案

ios - performSegueWithIdentifier 可以与 AppDelegate 一起使用吗?

我正在开发一个在启动时检查有效登录凭据的应用程序,如果找到并且未过期,则会显示主SplitViewController,如果没有,则应显示登录屏幕。每个部分单独运行良好,但我在启动时努力寻找最佳方式来选择要显示的正确View。我已经尝试从RootViewController设置一个模态转场,并在我的应用程序中:didFinishLaunchingWithOptions:AppDelegate中的函数,调用它://Seguetotheloginviewcontroller...if(loginNeeded){[self.window.rootViewControllerperformSe

iphone - 在 XCode 4.2 空应用程序模板中使用 Interface Builder 将 tabbarcontroller 添加到 AppDelegate 的步骤

当我卡住时atthisquestion我找不到将UITabBarController添加到AppDelegate的正确步骤(不是以编程方式),但是通过使用“空应用程序”模板的界面生成器,我尝试添加一个新的空xib文件,然后将uitabbarcontroller放入其中,但是没有将它(从IB)链接到AppDelegate的方法!!即,当我将蓝线从tabbarcontroller对象(在文档大纲中)移动到文件所有者时,界面构建器仅在显示的列表中显示“委托(delegate)”选项,因此其中没有IBOutlet选项。那么,添加tabbarcontroller并使用界面生成器方式将其连接到ap

ios - 可以将大部分逻辑和模型放在 appDelegate 中吗?

对于我的大多数应用程序,我已将所有逻辑放在类中,每个ViewController都会获得类的引用,或者创建/释放对象本身。我刚开始读一本关于IOS的书,作者似乎喜欢将应用程序逻辑放在appDelegate中,而viewcontrollers只是将操作转发给执行实际工作的appDelegate方法。作者这样做只是因为它们是简单的示例,还是我应该学习并在我的应用程序中开始这样做? 最佳答案 首先,请参阅WhatdescribestheApplicationDelegatebest?Howdoesitfitintothewholeconc

ios - 根据 Core Spotlight 搜索词显示来自 AppDelegate 的可重载 View

我在我的应用程序中设置了CoreSpotlight。我导航到导航Controller中的特定ViewController,该Controller根据标题显示webview网页。例如:-(BOOL)application:(UIApplication*)applicationcontinueUserActivity:(NSUserActivity*)userActivityrestorationHandler:(void(^)(NSArray*restorableObjects))restorationHandler{if([[userActivityactivityType]isEqu