首页 \ 问答 \ iOS 5.1 UISplitviewcontroller不允许来自RootViewController的presentModalViewController(iOS 5.1 UISplitviewcontroller not allow presentModalViewController from RootViewController)

iOS 5.1 UISplitviewcontroller不允许来自RootViewController的presentModalViewController(iOS 5.1 UISplitviewcontroller not allow presentModalViewController from RootViewController)

我用来使用以下代码从splitviewcontroller的RootViewcontroller中显示一个viewcontroller。 在iOS 5.1纵向模式下它不会显示任何内容。 当横向显示Rootviewcontroller内的控制器时。 它适用于iOS 5.0。

-(void)displayFileInReader:(NSURL *)fileURL    {

    SPDocumentReader *objiPadDocumentReader = [[SPDocumentReader alloc] init];
    objiPadDocumentReader.readerType = ReaderTypeLocalCachedDocument;
    objiPadDocumentReader.url = fileURL;
    UINavigationController *objNavigationController = [[UINavigationController alloc] initWithRootViewController:objiPadDocumentReader];
    objNavigationController.navigationBar.barStyle = UIBarStyleBlack;

    [self presentModalViewController:objNavigationController animated:YES];

    [objNavigationController release];
    objNavigationController = nil;

    [objiPadDocumentReader release];
    objiPadDocumentReader = nil;
}

我使用self.splitviewcontroller并使用detailviewcontroller实例而不是self。

但是在这种情况下,当我们点击o detailview控制器来解除/删除rootviewcontroller它会导致崩溃时说“没有窗口的视图”。

有时在iOS 5.1中,RootView显示方向错误。

提前致谢


I use to show a viewcontroller from RootViewcontroller of a splitviewcontroller using the following code. It will not shown any thing in iOS 5.1 portrait mode. when landscape it shows the controller inside the Rootviewcontroller. Its works fine upto iOS 5.0.

-(void)displayFileInReader:(NSURL *)fileURL    {

    SPDocumentReader *objiPadDocumentReader = [[SPDocumentReader alloc] init];
    objiPadDocumentReader.readerType = ReaderTypeLocalCachedDocument;
    objiPadDocumentReader.url = fileURL;
    UINavigationController *objNavigationController = [[UINavigationController alloc] initWithRootViewController:objiPadDocumentReader];
    objNavigationController.navigationBar.barStyle = UIBarStyleBlack;

    [self presentModalViewController:objNavigationController animated:YES];

    [objNavigationController release];
    objNavigationController = nil;

    [objiPadDocumentReader release];
    objiPadDocumentReader = nil;
}

I use self.splitviewcontroller and use detailviewcontroller instance instead of self.

But it this case when we click o detailview controller to dismiss/remove rootviewcontroller it cause crash saying something like "no window for the view".

Also sometimes in iOS 5.1 the RootView shows in wrong orientation.

thanks in advance


原文:https://stackoverflow.com/questions/9818563
更新时间:2024-03-13 18:03

最满意答案

你可以使用String = Server.HTMLEncode(String)而不是Replace吗?

你能用数据显示你的查询吗? 就在你执行Conn.Execute ? 您可以使用以下方式执行此操作

Response.Write "your query"
Response.End

更多的建议

  1. 在HTML控件中输入最大文本大小

代替

<input type="text" name="txtTitle" placeholder="Titolo">

<input type="text" name="txtTitle" placeholder="Titolo" maxlength="255">
  1. 并且在ASP代码中也控制最大大小

代替

Titolo = Request.Form("txtTitle")

使用

Titolo = Left(Server.HTMLEncode(Request.Form("txtTitle")), 255)

感谢您发布SQL Query。 你有char'(char#39)的问题。 使用TestoSlash = Replace(TestoSlash, "'", "&#39")


Can you use String = Server.HTMLEncode(String) instead of Replace?

Can you show your query with data? Just before you going to execute Conn.Execute ? You could do this by using following way

Response.Write "your query"
Response.End

few more suggestion

  1. in HTML control maximum size of text for input

instead

<input type="text" name="txtTitle" placeholder="Titolo">

write

<input type="text" name="txtTitle" placeholder="Titolo" maxlength="255">
  1. and in ASP code also control maximum size

instead

Titolo = Request.Form("txtTitle")

use

Titolo = Left(Server.HTMLEncode(Request.Form("txtTitle")), 255)

Thanks for posting SQL Query. You have issue with char ' (char #39). Use TestoSlash = Replace(TestoSlash, "'", "&#39")

相关问答

更多
  • 问题是您现在拥有的验证规则不允许您的应用程序获得价值。 您需要的验证规则是: Like "%[A-Z]" Or Like "*[A-Z]" 规则“%[AZ]”将允许应用程序中A到Z之间的字符 和 规则“* [AZ]”允许来自Access The problem is that the validation rule that you are having now doesn't permit value from your application. The validation rule you requ ...
  • 你为什么不尝试SQLite,并且它支持PHP。 这里有一个你可以用作参考的链接。 希望能帮助到你! Why don't you try SQLite, and it supports PHP. Here's a link you can use as reference. Hope it helps!
  • 在Windows机器上安装PostgreSQL ODBC驱动程序 。 创建一个指向PostgreSQL数据库的DSN。 启动Access会话并使用DSN导入PostgreSQL表。 过去我已经做了几次,发现它很快捷。 使用ODBC驱动程序进行访问会将PostgreSQL列数据类型转换为与Access兼容的类型。 这种方法应该适用于简单的表格。 但是,如果您的设计使用高级PostgreSQL功能,则这些功能可能无法很好地(或完全)转换为Access。 但是,由于您尚未创建数据库,我鼓励您容忍Access表设计 ...
  • 我相信你在连接字符串中有错误。 您需要使用它的属性创建Connection对象。 尝试用以下方法替换您的连接: Connection conn = DriverManager.getConnection("jdbc:jstels:mdb:sdcard/2012xp.mdb"); After a long trying i found out that jStels is not compatible with android...
  • 感谢回复,Westie留下的链接引导我到另一条大道,经过谷歌的一些搜索后,我找到了这个帖子 它基本上描述了如何确保我的IIS使用32位驱动程序,而不是。 我使用了第一个选项,现在一切正常。 为你的所有帮助干杯。 莱昂 Thanks for the replies, The link Westie left, lead me to another avenue and after some more searches via Google I found this Thread It basically de ...
  • 你可以使用String = Server.HTMLEncode(String)而不是Replace吗? 你能用数据显示你的查询吗? 就在你执行Conn.Execute ? 您可以使用以下方式执行此操作 Response.Write "your query" Response.End 更多的建议 在HTML控件中输入最大文本大小 代替
    大多数数据库都能够在数据库中完全更有效地完成所有这些工作。 当然,在SQL Server中,我可以将整个事件归结为单个查询。 Access有点不同,因为vbscript是它的过程语言,而不是更像t-sql的东西。 仍然有可能做到这一点,但既然你有所作为,我们至少可以专注于做得更好。 GridViews是可视化构造,会占用额外的内存和资源。 如果Access不会执行真正的INSERT / SELECT,您至少可以直接从先前的结果集读取到插入中。 您还可以通过使用参数并为所有插入重用单个打开连接来显着改善这一点 ...
  • 你可以试试Dapper 。 这是一种对任何实现IDbConnection的方法执行任意SQL的方法,它避免了SQL注入攻击,并且具有漂亮,干净,现代的界面。 如果做不到这一点,只需使用OleDbCommand.Parameters.AddWithValue("fieldname", yourobj); (或OdbcCommand等效。您的查询需要包含问号作为参数占位符。对于Access,您需要以与SQL查询中显示的字段相同的顺序将参数添加到参数集合中,如下所示: 选择 string sql = "selec ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。