草庐IT

BugTest_ViewController

全部标签

ios - "-(id) init"使用 Storyboard 时不在 ViewController 中触发

我注意到在使用Storyboard时,ViewController中的“-(id)init”没有执行。是否有任何其他方法可以替代init,或者是否有办法强制触发init。 最佳答案 尝试使用-(id)initWithCoder:(NSCoder*)aDecoder{if(self=[superinitWithCoder:aDecoder]){//Dosomething}returnself;} 关于ios-"-(id)init"使用Storyboard时不在ViewController中

ios - 从另一个 ViewController 呈现 Storyboard ViewController

我的iOS应用程序的Storyboard中有多个UIViewController。我想从另一个UIViewController打开其中一个UIViewController(在Storyboard中)。我已经尝试了下面的代码,但即使我在iOS5之前使用它并且它工作正常,它也没有工作。-(IBAction)addNotes:(id)sender{NotesViewController*notesView=[[NotesViewControlleralloc]initWithNibName:@"NotesViewController"bundle:nil];[selfpresentModal

ios - 从另一个 ViewController 呈现 Storyboard ViewController

我的iOS应用程序的Storyboard中有多个UIViewController。我想从另一个UIViewController打开其中一个UIViewController(在Storyboard中)。我已经尝试了下面的代码,但即使我在iOS5之前使用它并且它工作正常,它也没有工作。-(IBAction)addNotes:(id)sender{NotesViewController*notesView=[[NotesViewControlleralloc]initWithNibName:@"NotesViewController"bundle:nil];[selfpresentModal

ios - 除了从 appDelegate 获取之外,如何获取 viewController 的 managedObjectContext?

最近我了解到“您真的不应该调用AppDelegate来获取托管对象上下文”。Apple也已将此建议放入其文档中here.它是这样的:Aviewcontrollertypicallyshouldn’tretrievethecontextfromaglobalobjectsuchastheapplicationdelegate—thismakestheapplicationarchitecturerigid.Neithershouldaviewcontrollercreateacontextforitsownuse(unlessit’sanestedcontext).Thismaymean

ios - 除了从 appDelegate 获取之外,如何获取 viewController 的 managedObjectContext?

最近我了解到“您真的不应该调用AppDelegate来获取托管对象上下文”。Apple也已将此建议放入其文档中here.它是这样的:Aviewcontrollertypicallyshouldn’tretrievethecontextfromaglobalobjectsuchastheapplicationdelegate—thismakestheapplicationarchitecturerigid.Neithershouldaviewcontrollercreateacontextforitsownuse(unlessit’sanestedcontext).Thismaymean

ios - Xcode 6 : can't connect any IBOutlet to ViewController

升级到Xcode6后,我打开了一个旧项目(包含一个子项目,所以它有很多目标)我注意到从我的StoryboardViewContoller到相关对象的链接没有作用。例如,我有一个ViewController,里面有一个TableView,现在我不能用它做任何事情,因为连接丢失了,我什至不能在VC中重新定义一个新的IBOutlet,因为Storyboard中的箭头来自VC不会连接到任何东西。更清楚:类是在CustomClass部分定义的,所以找不到问题我该怎么办?顺便说一句,我使用的不是swift的obj-c,我找到了一些相关的答案,但都是关于swift的。 最

ios - Xcode 6 : can't connect any IBOutlet to ViewController

升级到Xcode6后,我打开了一个旧项目(包含一个子项目,所以它有很多目标)我注意到从我的StoryboardViewContoller到相关对象的链接没有作用。例如,我有一个ViewController,里面有一个TableView,现在我不能用它做任何事情,因为连接丢失了,我什至不能在VC中重新定义一个新的IBOutlet,因为Storyboard中的箭头来自VC不会连接到任何东西。更清楚:类是在CustomClass部分定义的,所以找不到问题我该怎么办?顺便说一句,我使用的不是swift的obj-c,我找到了一些相关的答案,但都是关于swift的。 最

ios - 在 iOS 6 中呈现 Modal ViewController

在我的应用程序代码中,我仍然使用presentModalViewController以模态方式呈现ViewController。这在iOS6中已弃用。这是否意味着此方法对运行iOS6的设备没有影响?如果是,我如何让我的应用程序在iOS6上以模态方式呈现ViewController?我的Xcode版本不支持iOS6,所以我无法使用iOS6中的所有新方法。 最佳答案 如果你有[selfpresentModalViewController:aControlleranimated:YES];改成[selfpresentViewControl

ios - 在 iOS 6 中呈现 Modal ViewController

在我的应用程序代码中,我仍然使用presentModalViewController以模态方式呈现ViewController。这在iOS6中已弃用。这是否意味着此方法对运行iOS6的设备没有影响?如果是,我如何让我的应用程序在iOS6上以模态方式呈现ViewController?我的Xcode版本不支持iOS6,所以我无法使用iOS6中的所有新方法。 最佳答案 如果你有[selfpresentModalViewController:aControlleranimated:YES];改成[selfpresentViewControl

ios - 启动特定的 viewController 以响应远程推送通知

我正在创建一个Storyboard流程如下图所示的应用:当用户从“SysalertViewController”登录时,他们被带到“MessageListViewController”,我在其中执行NSURLConnection以将一些JSON加载到表中。当用户点击表格中的一行时,他们将进入“消息详细信息”,其中显示该消息的更多详细信息。当用户通过推送通知启动应用程序时,无论启动前应用程序的状态如何,我都希望应用程序从我的服务器加载“消息列表”数据,然后向他们显示刚刚推送的消息到设备。我知道我需要使用didFinishLaunchingWithOptions告诉应用程序对推送通知使用r