草庐IT

ViewController3

全部标签

ios - 从 viewcontroller 获取 appdelegate 值

在Appdelegate.h中我在Appdelegate.h和Appdelegate.m文件中导入了playerviewcontroller。@classPlayerViewController;@property(nonatomic)floatvolumeDelegate;在Appdelegate.m中@synthesizevolumeDelegate;-(void)volumeChanged:(NSNotification*)notification{volumeDelegate=1.0PlayerViewController*volumeObject=[[PlayerViewCo

ios - 如何从 Storyboard中的 appdelegate 推送 viewcontroller

我正在使用SWRevealViewController在我的项目中,我想在应用程序收到通知时打开一个特定的Controller。我已经尝试了很多解决方案,但没有任何效果。如何从我的AppDelegate显示特定的ViewController?(void)application:(UIApplication*)applicationdidReceiveRemoteNotification:(NSDictionary*)userInfo{UIApplicationStateappState=UIApplicationStateActive;if([applicationrespondsTo

ios - 从 AppDelegate 启动 ViewController

我有一个自定义URL方案,我想打开某个ViewController,当我转到此URL时,它不是根。我已经能够做到这一点,剩下的就是将ViewController从AppDelegate推送到navigationController中,我在其中处理我的URL,如下所示:-(BOOL)application:(UIApplication*)applicationopenURL:(NSURL*)urlsourceApplication:(NSString*)sourceApplicationannotation:(id)annotation{if([[urlscheme]isEqualToS

iphone - UINavigationController 方向更改中的 ViewController

所以我有以下层次结构:UINavigationController-->RootViewController(UIViewController)-->UITableViewController-->DetailViewController(UIViewController)我只想将RootViewController的方向锁定为纵向,但为其余ViewController保留所有方向。如果我将其放入子类UINavigationController:-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)i

ios - 有没有办法在 Storyboard中将自定义 UIView 设置为 'design',并在不添加到任何特定 Controller 的情况下在多个 ViewController 中使用?

我需要一个自定义的UIView,它可以在多个不同的ViewControllers中使用。通常当我创建一个自定义的UIView时,我将UIView的一个实例拖到Storyboard中的ViewController中,创建一个UIView,并在View的IdentityInspector中指向这个子类。从那里,我会将UI对象作为导出连接到子类的头文件。我现在要制作的View不应该是任何特定Controller的一部分,但应该添加到任何需要它的Controller中。一个流氓UIView。我知道我可以以编程方式创建整个UIView,并且只创建它的一个实例,但我想在我的Storyboard中拥

iOS 7 - Person ViewController,编辑模式

Apple提供了一个很好的综合性小示例“QuickContacts”(developer.apple.com/library/IOs/samplecode/QuickContacts/Introduction/Intro.html),概述了AddressBookUIFramework的基本用法。.-可下载的源代码按照描述工作(一旦您将名为“Appleseed”的人添加到您的地址簿或将第246行(QuickContactsViewController.m)中的人名更改为您的地址簿中已经存在的名称)。问题:我们如何修改-(void)showPersonViewController函数,使A

objective-c - 你的 Application Delegate 设置在哪里,谁初始化它的 window 和 viewController 属性?

我有一个关于IOS应用程序的新手问题...如果我创建一个名为TestForStackOverflow的新的基于View的应用程序,Xcode会自动为TestForStackOverflowAppDelegate.h创建这样的代码:@classTestForStackOverflowViewController;@interfaceTestForStackOverflowAppDelegate:NSObject@property(nonatomic,retain)IBOutletUIWindow*window;@property(nonatomic,retain)IBOutletTest

iphone - 在 iOS 7 中的另一个 ViewController 上显示清晰的彩色 ViewController

这个问题在这里已经有了答案:DisplayclearColorUIViewControlleroverUIViewController(16个答案)关闭8年前。在iOS7之前,根据这个流行的Stackoverflowquestion,显示具有清晰背景的ViewController的方法是在主ViewController中执行以下操作:UIStoryboard*storyboard=[UIStoryboardstoryboardWithName:@"MainStoryboard"bundle:nil];UIViewController*vc=[storyboardinstantiateV

ios - 如何使用 StoryBoard 在 NavigationController 和 ViewController 之间传递值?

我有一个问题,以下是我的StoryBoard,第一个Controller是TabBarController,以及它与A(ViewController)的关系。A是一个ViewController,B是一个NavigationController,A通过modalsegue改变页面到BC是一个ViewController,C会通过push切换到另一个页面,所以我需要一个NavigationController好的,我想将值从A传递给C,现在我可以通过prepareForSegue,将值从A传递到B但是,由于B和C有关系但没有segue,所以我无法通过prepareForSegue将值从B

ios - UIButton 在 iOS7 中的 UIPageViewController 中的 ViewController 中没有突出显示

我在ViewController中有一个UIButton,它嵌入在UIPageViewController中。页面ViewController处于滚动模式(所以没有手势)。当我触摸按钮时,将调用操作方法,但按钮没有发生可见状态更改(突出显示状态)。这意味着按钮看起来没有被触及。仅在iOS7中观察到。有什么解决办法吗?案例1:在NormalViewController中,带有和不带有Tap的Button的行为案例2:在PageViewController的viewController之一中,使用和不使用Tap时Button的行为 最佳答案