草庐IT

gHomeHeaderArray_AppDelegate

全部标签

iOS 以编程方式更改 AppDelegate 中的 View

我正在尝试在收到特定推送通知时更改View,但收效甚微。(使用带有推送通知的解析,满足应用程序打开和关闭的时间)。我的Storyboard看起来像这样,我正在尝试将AppDelegate中的View更改为DetailViewController。现在我可以通过更改根Controller来更改View,但我只能附加我的选项卡View或导航,而不能同时附加两者。UIStoryboard*mainStoryboard=[UIStoryboardstoryboardWithName:@"MainStoryboard_iPhone"bundle:nil];DetailViewController

objective-c - 从 AppDelegate 更改选项卡和推送 View

我的AppDelegate中有一个名为handleLocalNotification的方法,它会在我的应用收到通知时触发。我需要它切换到包含UITableview的UITabBarController中的选项卡0。然后我需要它推送到tableview的正确行以显示通知发送的记录。所有Controller都在Storyboard中创建,因此我在AppDelegate中没有对它们的引用。我已经添加到我的AppDelegate.h中:@classMyListViewController;@interfaceiS2MAppDelegate:UIResponder{MyListViewContr

iOS - 如何将 AppDelegate 的 ManagedObjectContext 传递给来自 NavigationView 的 UIViewController

我在核心数据概念上苦苦挣扎,我需要一些澄清。我正在使用Storyboard,并且有2个View。第一个View嵌入在导航Controller中,第二个View只是一个来自模态转场的UIViewController。在AppDelegate中,我使用以下代码将managedObjectContext传递给第一个View:UINavigationController*nav=(UINavigationController*)self.window.rootViewController;JobListTableViewController*jltvc=(JobListTableViewCon

ios - 从 appdelegate 设置 UIViewController 委托(delegate)

我正在尝试从我的应用委托(delegate)中设置ViewController的委托(delegate)。但它不起作用。AppDelegate.m:UIStoryboard*sb=[UIStoryboardstoryboardWithName:@"MainStoryboard"bundle:nil];SFLoginViewController*LoginVC=(SFLoginViewController*)[sbinstantiateViewControllerWithIdentifier:@"Login"];LoginVC.delegate=self;SFLoginViewContr

objective-c - IOS 我可以在 appDelegate 上使用 AVAudioPlayer 吗?

我有一个带有两个选项卡的TabBarController,我想在两个选项卡上播放音乐。现在我在主appDelegate上有我的代码NSURL*url=[NSURLfileURLWithPath:[[NSBundlemainBundle]pathForResource:@"MySong"ofType:@"m4a"]];//MySong.m4aNSError*error;self.audioPlayer=[[AVAudioPlayeralloc]initWithContentsOfURL:urlerror:&error];if(error){NSLog(@"ErrorinaudioPlay

ios AppDelegate 属性声明

在网上阅读了一些教程后,我看到了两种不同的声明属性的方法。我想知道一个是否比另一个更正确:选项1:#import@interfaceAppDelegate:NSObject@property(strong,nonatomic)UIWindow*window;@property(strong,nonatomic)UITabBarController*mytabs;@end选项2:#import@interfaceAppDelegate:NSObject{UIWindow*window;UITabBarController*mytabs;}@property(nonatomic,retai

ios - 从 appDelegate 更新另一个 View Controller 中的标签

我想通过appDelegate更新我的一个ViewController中的标签。ViewController中的标签都在IB中链接起来并设置了属性。在AppDelegate.h中我正在为ViewController创建一个ivar,这样我就可以像这样从委托(delegate)访问ViewController上的标签。someViewController*myView;在AppDelegate.m文件中myView.theLabel.text=@"Whatever";我也尝试过myView.theLabelsetText:@"whatever";我还尝试将myView设为属性并对其进行合

iphone - appdelegate 中的 clickedButtonAtIndex 未被调用

我在MyapplicationAppDelegate.m文件中使用2个按钮“取消”和“确定”调用UIAlert,调用警报但点击“取消”或“确定”按钮-(void)alertView:(UIAlertView*)alertViewclickedButtonAtIndex:(NSInteger)buttonIndex方法未被调用。我在MyapplicationAppDelegate.h文件中添加了UIAlertViewDelegate,如下所示#importUIKit/UIKit.h@interfaceMyapplicationAppDelegate:NSObjectUIApplicati

ios - 如何在导航 Controller 内的 Storyboard 中从appdelegate推送viewcontroller

我在我的项目中使用SWRevealViewController,我想在应用收到通知时打开一个特定的Controller。我已经尝试了很多解决方案,但没有任何效果。我关注这个http://www.appcoda.com/ios-programming-sidebar-navigation-menu/通过使用Storyboard。我的Storyboard设计如下:当应用程序收到通知时,我想在其导航Controller中加载照片ViewController。我尝试在AppDelegate中使用以下代码:UIStoryboard*st=[UIStoryboardstoryboardWithNa

ios - 警报 View :(UIAlertView *) alertView method not working in Appdelegate

我在AppDelegate.m文件中设置了UIAlertView。但是当我在警报View上选择按钮时。-(void)alertView:(UIAlertView*)alertViewclickedButtonAtIndex:(NSInteger)buttonIndex没有工作。我在AppDelegate.h文件中设置了UIAlertViewDelegate。和我的AppDelegate.m-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOpt