草庐IT

DATE_ADD

全部标签

ios - UITextView 中的链接 : add and custom

1)我想添加一个指向UITextView的链接。我知道如果我把一个像http://stackoverflow.com这样的url在我的文本中,它会自动被识别为一个链接。但是有没有办法为一个词建立一个链接,而不仅仅是一个url?就像在HTML中一样:stackoverflow2)我想自定义这个链接,尤其是它的颜色、字体类型等。有没有办法只为链接添加一个属性?如果这一切都很复杂,您有没有更好的方法轻松完成?谢谢! 最佳答案 试试这个:self.myTextView.dataDetectorTypes=UIDataDetectorType

iphone - Date from String 的奇怪问题

一个奇怪的问题:我正在通过以下代码将字符串转换为日期:NSString*dateStr=@"02/10/201212:00:13PM";NSDateFormatter*dtF=[[NSDateFormatteralloc]init];[dtFsetDateFormat:@"MM/dd/yyyyHH:mm:ssa"];NSDate*d=[dtFdateFromString:dateStr];NSDateFormatter*dateFormatStr=[[NSDateFormatteralloc]init];[dateFormatStrsetDateFormat:@"MMMMdd,yyyy

objective-c - 在 UIWebView 中如何集成 "Add bookmark "功能

我想像一样在iphone中集成像safari一样的添加书签这里是从iPhone添加safari浏览器书签功能的快照我想添加类似的功能我该怎么做? 最佳答案 http://xcode4all.wordpress.com/2011/05/25/web-browser-or-how-to-use-the-uiwebview-part-33/会有帮助 关于objective-c-在UIWebView中如何集成"Addbookmark"功能,我们在StackOverflow上找到一个类似的问题:

ios - NSDateFormatter stringFromDate : returns incorrect date on December 31st

根据unixtimestamp.com-2013年12月31日午夜,时间戳为1388448000。那么为什么会这样呢?在ViewController.m中:NSDateFormatter*titleFormatter=[[NSDateFormatteralloc]init];_titleFormatter=titleFormatter;在LLDB中:(lldb)po[NSDatedateWithTimeIntervalSince1970:1388448000]2013-12-3100:00:00+0000(lldb)p[NSDatedateWithTimeIntervalSince19

ios - 编译日期 (__DATE__) 返回昨天的日期

为了显示构建日期,我使用了这些代码:NSString*compileDate=[NSStringstringWithUTF8String:__DATE__];NSDateFormatter*df=[[NSDateFormatteralloc]init];[dfsetDateFormat:@"MMMdyyyy"];NSLocale*usLocale=[[NSLocalealloc]initWithLocaleIdentifier:@"en_US"];[dfsetLocale:usLocale];NSDate*date=[dfdateFromString:compileDate];[dfs

iphone - iOS : Date conversion results in wrong date

我以前用几种格式做过几次。无法理解在这里俯瞰的是什么!日期转换不会那么难!:)但似乎太麻烦了。我得到这样的字符串:2013年8月9日06:44:01:950AM我正在尝试使用此代码将其转换为日期:[Date_ConvertergetDateFromString:datewithFormat:@"MMMddYYYYHH:mm:ss:SSSa"]并且在DateConverter.m+(NSDate*)getDateFromString:(NSString*)strDatewithFormat:(NSString*)format{NSDateFormatter*formatter=[[NSD

ios - 如何让导航栏上的 "Add"按钮执行某些操作?

自从我上次iPhone编程冒险以来,我已经休息了几年,而且我显然已经忘记了上次学到的大部分内容。另外XCode看起来完全不同,所以我也必须重新学习它。我已经使用Storyboard功能来布置我下一个项目的基本UI。主屏幕嵌入在导航Controller中,主屏幕上有四个按钮。按任何按钮都会加载subview;我还没有通过subview。因此,总而言之,我现在拥有的是一个主/主屏幕,以及四个独立的subview,每个subview都可以通过点击主/主屏幕上的按钮来访问。到目前为止,这一切都很好。所以。在我的第一个subview上——称之为“人物”屏幕——我有一个带有“添加”功能([+])的

ios - 以编程方式更改导航栏标题 : Add a symbol and change its color

我想在我的导航Controller的UINavigationBar的标题中添加一个字符符号(例如,一个空白字符后跟一个项目符号“•”)。根据我的应用程序的状态,我想更改项目符号的前景色。我想过使用属性字符串来改变颜色。但是,我没有找到直接访问标题并为其分配属性字符串的方法。如果要将字符符号添加到UINavigationBar并能够更改其颜色,您会推荐什么解决方案?谢谢! 最佳答案 如果您的ViewController包含在导航Controller中,设置标题属性就足够了:self.title=@"Something•";Xcode和

ios - @IBInspectable : wrong bounds and frames at runtime when I add subviews

这是我的@IBInspectable:代码:@IBDesignableclassPBOView:UIView{@IBInspectablevarborderRightColor:UIColor?{didSet{letborderRightView=UIView(frame:CGRectMake(frame.size.width-10,0,10,frame.size.height))borderRightView.backgroundColor=borderRightColoraddSubview(borderRightView)}}}这是Storyboard中的结果:UIView的宽度

iOS 路线-我 : Add User Location Marker

我一直在尝试将以下内容添加到Route-Me应用中。在起始位置添加标记将map移动到用户位置将标记移动到新位置我使用的是MapBoxios示例中的基本示例,因为我的map来自离线mbtiles商店。这是我的头文件:#import#import"RMMapView.h"#import"RMMarker.h"#import"RMMapViewDelegate.h"#import"RMMarkerManager.h"#import"CoreLocation/CoreLocation.h"@interfaceMBTiles_ExampleViewController:UIViewControl