草庐IT

NSDateFormatterMediumStyle

全部标签

iphone - 如何从 NSFetchedResultsSectionInfo 格式化日期?

我希望能够在我的表格的部分标题中清晰地格式化我的日期。这是我的代码:-(NSString*)tableView:(UITableView*)tableViewtitleForHeaderInSection:(NSInteger)section{idsectionInfo=[[self.fetchedResultsControllersections]objectAtIndex:section];NSDateFormatter*dateFormatter=[[NSDateFormatteralloc]init];[dateFormattersetDateStyle:NSDateForma

iphone - 类似于 Monotouch 的 NSDateFormatterMediumStyle 的日期格式?

我正在尝试按照iOS日历应用程序中显示的日期格式设置日期。格式是NSDateFormatterMediumStyle并显示日期,例如“2011年11月27日”。Documentation但是这种格式在.NETFramework日期格式中不可用,所以我必须使用NSDateFormatter来格式化日期。Documentation我遇到的问题是,在Monotouch中,我无法在NSDateFormatter中找到格式化日期的方法。在Apple示例中有一个[dateFormatterstringFromDate:date];方法,但是看起来Monotouch中缺少此方法还是有替代方法?