草庐IT

gHomeHeaderArray_AppDelegate

全部标签

ios - 在 URL Scheme OpenURL 之后从 AppDelegate 调用 ViewController 方法

我正在尝试从AppDelegate.m调用ViewController.m中的函数LoadWebpage。我已使用URLScheme启用我的应用程序,以便Safari中的“urlscheme://?querystring”链接打开我的应用程序。我正在AppDelegate中捕获url方案(我可以通过日志记录知道这是有效的)并且想用查询字符串填充全局变量然后调用我的LoadWebPage方法以便ViewController可以使用全局变量并在WebView控件中打开请求的网站。我正在关注thistutorial.这是AppDelegate.m:-(BOOL)application:(UI

ios - 如何控制 appdelegate 中的 View Controller ?

我真的是为简单的问题构造结构。我只是使用以下代码从一个ViewController移动到另一个ViewController。homescreen*home;home=[self.storyboardinstantiateViewControllerWithIdentifier:@"home"];[selfpresentViewController:homeanimated:YEScompletion:nil];尝试在AppDelegate方法中使用相同的代码。UIStoryboard*storyboard;sur=[storyboardinstantiateViewController

iphone - 如何折叠/折叠 UITableView 的部分?

我希望在点击红色按钮时折叠tableviewcell-(NSInteger)tableView:(UITableView*)tableViewnumberOfRowsInSection:(NSInteger)section{if([[appDelegate.gHomeHeaderArray_AppDelegateobjectAtIndex:section]getIsFolded]==true){return0;}else{return1;}}-(NSInteger)tableView:(UITableView*)tableViewnumberOfRowsInSection:(NSInt

objective-c - AppDelegate.m 类中的@interface 错误

应该是我缺少的一个简单解决方案。我有一个选项卡ViewController驱动的应用程序,我想在用户启动或打开该应用程序时对其进行密码保护。我在IB中创建了一个密码类和ViewController。我正在尝试通过以下代码使用AppDelegate.m类applicationDidLoadInForeground方法:-(void)applicationWillEnterForeground:(UIApplication*)application{NSUserDefaults*submissionDefaults=[NSUserDefaultsstandardUserDefaults];

ios - [FIRA_AppDelegate- 消息传递 :didRefreshRegistrationToken:]: unrecognized selector sent to instance - firebase crash issue

我在重新安装iOS应用程序时发现了一个新问题。在重新安装应用程序之前工作正常。在重新安装之前,我更新了cocoasdkrepo,并将Firebase和FirebaseDatabase版本从3.15.0更新到4.0.0版。下面是崩溃日志:-[FIRA_AppDelegate-1495465837867messaging:didRefreshRegistrationToken:]:unrecognizedselectorsenttoinstance0x174661b402017-05-2223:10:58.550969+0800moodfriends[1716:245390]***Term

ios - UIInterfaceOrientation 总是在 AppDelegate iPad 中返回 Portrait?

我想在iPad应用程序中显示启动画面。在此之前,我想获取当前设备方向的横向或纵向模式。我用过,UIInterfaceOrientationorientation=[[UIApplicationsharedApplication]statusBarOrientation];if(orientation==UIInterfaceOrientationLandscapeRight||orientation==UIInterfaceOrientationLandscapeLeft){splachview=[[UIImageViewalloc]initWithFrame:CGRectMake(0

iphone - iOS - 从 appDelegate 访问 Storyboard上的 viewControllers

我有一个使用CoreData的应用程序,我在应用程序委托(delegate)中创建了一个managedObjectContext。我想将managedObjectContext传递到我的Storyboard上的两个ViewController,以便它们使用相同的managedObjectContext来保存和获取。我可以访问第一个ViewController:self.window.rootViewController但是我想访问的第二个ViewController是在第一个ViewController的segue之后,并且没有从它返回任何引用。我试过:instantiateViewC

ios - 架构 armv7 的 undefined symbol : "_OBJC_CLASS_$_Crashlytics", 从 : objc-class-ref in AppDelegate. o 引用

架构armv7的undefinedsymbol:“_OBJC_CLASS_$_Crashlytics”,引用自:AppDelegate.o中的objc-class-ref我尝试更新Crashlytics(3.3.4)并且还必须更新Fabric,但最新更新存在一些问题。我不知道这里发生了什么。 最佳答案 https://groups.google.com/forum/#!topic/cocoapods/-Rsf5IXN0aM我使用了URL中提到的更改并降级了框架版本,瞧,它工作正常,但需要了解最新版本。

ios - 将数据从 AppDelegate 传递到 iOS 中的 View

我正在尝试在启动期间获取JSON并希望将JSON用作资源。我在didFinishLaunchingWithOptions中发出请求,请求看起来像:NSString*urlAsString=@"myurl";NSURL*url=[NSURLURLWithString:urlAsString];NSURLRequest*urlRequest=[NSURLRequestrequestWithURL:url];NSURLResponse*response=nil;NSError*error=nil;NSData*data=[NSURLConnectionsendSynchronousReque

iphone - 我可以在我的 AppDelegate 中接收摇动事件吗?

应用程序委托(delegate)是UIResponder子类(自Xcode4.2起),因此它应该能够接收触摸和运动事件。我在我的AppDelegate类中添加了它,但它不起作用:-(BOOL)canBecomeFirstResponder{returnYES;}-(void)motionEnded:(UIEventSubtype)motionwithEvent:(UIEvent*)event{if(motion==UIEventSubtypeMotionShake){NSLog(@"shake");}}它当然在ViewController中有效,但我想检测应用程序范围内的抖动。