首页 \ 问答 \ iPhone SDK:自定义后退按钮标题(iPhone SDK: Customizing back button title)

iPhone SDK:自定义后退按钮标题(iPhone SDK: Customizing back button title)

在XCode 5.我想在pushViewController调用函数后更改所有后退按钮标题是“Back” 。 我不想添加新的导航栏按钮。 有可用的简单代码吗?


In XCode 5. I want to change all back button title is "Back" after pushViewController call function. I do not want to add new navigation bar button. Is there available simple code?


原文:https://stackoverflow.com/questions/22145906
更新时间:2022-12-02 14:12

最满意答案

$dtDiffStart=$dtStart->diff($dtStGoogle);
$dtDiffEnd=$dtEnd->diff($dtEndGoogle);

是DateInterval的2个实例,所以它总是被认为是真的。

if ($dtStart!=$dtEndGoogle)

在你的情况下,它总是会返回true,因为你的两个DateTime实例是不同的(不同的时区)

如果您只想检查$ dtStart和$ dtEndGoogle是否不同,请执行以下操作:

($dtStart->format('U') != $dtEndGoogle->format('U'))

'U'用于获取unix时间戳。 您可以根据需要更改格式。


$dtDiffStart=$dtStart->diff($dtStGoogle);
$dtDiffEnd=$dtEnd->diff($dtEndGoogle);

Are 2 instances of DateInterval, so it'll always be considered as true.

if ($dtStart!=$dtEndGoogle)

In your case it will always return true, as your two DateTime instances are different (different timezone)

If you just want to check if $dtStart and $dtEndGoogle are different, just do:

($dtStart->format('U') != $dtEndGoogle->format('U'))

'U' is used to get the unix timestamp. You can change the format depending on your needs.

相关问答

更多
  • 以下内容似乎确认DateTime类有比较运算符: dev:~# php $d2); var_dump($d1 < $d2); ?> bool(false) bool ...
  • MSDN文档非常清楚, DateTimeKind没有考虑到使用Equality运算符。 Equality运算符通过比较它们的滴答数来确定两个DateTime值是否相等。 在比较DateTime对象之前,请确保对象代表同一时区中的时间。 你可以通过比较Kind属性的值来做到这一点 。 MSDN - DateTime.Equality运算符 您可以编写自己的扩展方法来包含DateTimeKind比较: public static bool EqualsWithKind(this DateTime time, D ...
  • >>> datetime.datetime.now().utcoffset() is None True now函数确实返回了一个天真的对象。 它包含根据区域设置填充的日期和时间的字段值。 这就是提供单独的utcnow原因; 总是给你UTC字段值(虽然它仍然是天真的)。 >>> datetime.datetime.now().utcoffset() is None True The now function does indeed return a naive object. It contains f ...
  • 有一个很好的库来处理DateTime相关的问题.. https://github.com/briannesbitt/Carbon 。 如果上面提到的案例并不是你处理DateTime的唯一地方,那么我会考虑用Carbon投资一段时间。 There is an excellent library to handle DateTime related issues .. https://github.com/briannesbitt/Carbon . If the above mentioned case is ...
  • 我假设pub_date是一个django.db.models.DateField ,这意味着你可以把它当作一个datetime.date对象。 如果将它们转换为相同类型( datetime.datetime或datetime.date )并从另一个类型中减去一个,则会得到datetime.timedelta一个实例。 当你使用datetime.datetime.now() ,如果你的pub_date只是一个日期而不是日期时间,你可以使用ds = datetime.date.today()来代替: >>> d ...
  • $dtDiffStart=$dtStart->diff($dtStGoogle); $dtDiffEnd=$dtEnd->diff($dtEndGoogle); 是DateInterval的2个实例,所以它总是被认为是真的。 if ($dtStart!=$dtEndGoogle) 在你的情况下,它总是会返回true,因为你的两个DateTime实例是不同的(不同的时区) 如果您只想检查$ dtStart和$ dtEndGoogle是否不同,请执行以下操作: ($dtStart->format('U') ...
  • 您查询状态: WHERE scheduledFrom < :tomorrow AND scheduledFrom > :yesterday 明天和昨天都是约会时间。 时间设置为00:00:00,因此结果将包括19/02/2016的日期,其中时间大于00:00:00。 也许您的查询应该被重写为使用日期对象而不是日期时间对象(取决于您的模型定义)。 或者你需要将它改写成这样的东西: records = db.GqlQuery("SELECT * FROM ProgrammeQueue" " ...
  • 根据MSDN和MSDN2比较两个DateTime值: 备注若要确定当前实例与value的关系,CompareTo方法将比较当前实例的Ticks属性和值,但忽略其Kind属性。 在比较DateTime对象之前,请确保对象表示同一时区中的时间。 您可以通过比较其Kind属性的值来完成此操作。 备注Equality运算符通过比较它们的刻度数来确定两个DateTime值是否相等。 在比较DateTime对象之前,请确保对象表示同一时区中的时间。 您可以通过比较Kind属性的值来完成此操作。 所以这是正确的。 链接到 ...
  • 在DateTimeComparator的javadoc中: public static DateTimeComparator getInstance(DateTimeFieldType lowerLimit, DateTimeFieldType upperLimit) Returns a DateTimeComparator with a lower and upper limit. Fields of a magni ...
  • > , <和==运算符可以与DateTime对象一起使用。 The >, < and == operators can be reliably used with DateTime objects.

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)