jjzjj

Appdelegate

全部标签

ios - 以单一名称将多个对象保存到核心数据

我正在使用swift3.0开发一个项目,其中我有一个带有多个选择选项的UITableView(每行都有一个URL)。因此,在UITableView之上,使用可以在UITextfield中输入名称。我的要求是,一旦选择了这些行,数据就应该以键入的名称保存在Coredata中。截至目前,数据已保存为单独的元素,因此我无法以其名称对数据进行聚类。我怎么能做到这一点??。我保存和提取数据的方法如下。保存publicstaticfuncsavePlaylistDetails(audio:AudioDetails,playListName:String){letappDelegate=UIAppl

ios - 从本地通知启动应用程序; VC实例化,但没有出现

我想从本地通知启动我的应用程序,该通知将在主屏幕锁定时或用户在基于类似讨论的另一个应用程序中时显示here和here我的AppDelegate中有以下代码:funcuserNotificationCenter(_:UNUserNotificationCenter,didReceiveresponse:UNNotificationResponse,withCompletionHandlercompletionHandler:@escaping()->Void){switchresponse.actionIdentifier{case"play":varsetAlarmVC=self.wi

ios - 如何为 AppDelegate 中的所有 View Controller 独立更改左右栏按钮项文本属性?

在我的应用程序中,我在UINavigationController中嵌入了许多UIViewControllers,其中包含一个cancelrightBarButtonItem和保存leftBarButtonItem。在每个类中,我都有重复的代码来自定义栏按钮项的属性:navigationItem.leftBarButtonItem?.setTitleTextAttributes([NSAttributedStringKey.font:UIFont(name:fontFuturaMedium,size:fontSize17)!],for:.normal)navigationItem.le

ios - 从 AppDelegate(来自 Universal Link)打开的 View Controller 没有导航 Controller

我为一个应用程序创建了一个通用链接。它很好用。它打开应用程序并转到定义的ViewController,并显示通过通用链接传递的正确信息。问题是ViewController有一个导航Controller。但是当我直接从appdelegate访问时,它没有显示这个导航Controller。我如何在AppDelegate中定义present以显示带有导航Controller的ViewController?ifletcontroller=UIStoryboard(name:"Main",bundle:nil).instantiateViewController(withIdentifier:"

iphone - 从后台操作调用导航 Controller 方法

我正在使用NSOperation运行后台操作,它从我的AppDelegate启动。我想做的是当操作完成时,让它调用RootViewController.m文件中的方法。目前我的AppDelegate中有一个名为navigationController的属性,我一直在尝试像这样设置调用:AppDelegate.m:GetRSSOperation*gro=[[GetRSSOperationalloc]initWithURL:rssURLtarget:selfselector:@selector(dataSourceDidFinishLoadingNewData:)];[queueaddOp

iphone - appdelegate 方法中的 setBrightness?

为什么我不能在applicationDidEnterBackground或applicationWillResignActive中设置屏幕亮度?这是我的代码:-(void)applicationDidEnterBackground:(UIApplication*)application{[[UIScreenmainScreen]setBrightness:1.0];}看不懂...!?它适用于applicationDidEnterForeground等,只是在我使用主页按钮关闭应用程序时不起作用。感谢任何可以提供帮助的人... 最佳答案

objective-c - 从 ViewController 登录到 SplitViewController

我正在编写一个小应用程序来使用网络服务的结果。结果显示在SplitViewController中,左侧是结果,右侧是详细信息。在获得结果之前,我要求用户通过登录屏幕登录,该屏幕会在应用程序启动时首先出现。我在登录成功后通过更改应用程序的RootViewController来管理登录过程:-(void)prepareForSegue:(UIStoryboardSegue*)seguesender:(id)sender{if([[segueidentifier]isEqualToString:@"LoginControllerSeque"]&&[selfdoLogin]){TMAppDel

iphone - UITableView 未刷新

我有一个应用程序,它由一个TabBar和几个TabBarController组成。一个Controller包含一个非常简单的表,它应该显示NSMutableDictionary的内容。当您点击适当的按钮时,词典会在单独的Controller中更新,并且View会切换到UITableViewController,显示新更新的表格。我可以看到词典正在更新。但是TableView从不反射(reflect)更改。事实上,它似乎只在我第一次进入该屏幕时显示更改。我已尝试[selftable.reloadData],当它被调用时,更改不会反射(reflect)到UITableView。有人有什么建

objective-c - 如何从 appdelegate.mm 调用 helloworldlayer.mm 中的方法

我正在使用cocos2d和box2d制作我的第一个iPhone游戏。我刚刚实现了一个暂停按钮。它会在游戏顶部调出一个暂停菜单并暂停CCDirector。只要您留在应用程序中,暂停和取消暂停就可以很好地工作,但是有一个错误。如果您在应用程序暂停时将其最小化并返回,游戏将再次取消暂停,但暂停菜单仍在其前面。原因似乎是AppDelegate.mm中的applicationDidBecomeActive方法如下所示:-(void)applicationDidBecomeActive:(UIApplication*)application{[[CCDirectorsharedDirector]r

ios - 当应用程序处于事件状态时,不会在我的 View Controller 中调用 viewWillAppear

免责声明:我是iOS菜鸟。我使用Xcode的模板创建了一个基于View的应用程序,可以将图片上传到网站。Xcode自动为我创建了AppDelegate.m(&.h)和ViewController.m以及Storyboard。该应用程序是使用URL架构从网站启动的,我在我的ViewController中使用该信息。我有两个问题:1)这是将查询字符串从我的AppDelegate传递到ViewController的好方法吗?我的AppDelegate中有一个名为queryStrings的NSDictionary属性,它存储查询字符串。然后在我的ViewController中的viewWill