顯示具有 Obj-c 標籤的文章。 顯示所有文章
顯示具有 Obj-c 標籤的文章。 顯示所有文章

2011年10月26日 星期三

[Obj-c] UNIX Timestamp 轉換成 NSDATE

Code

NSDateFormatter*dateFormat = [[NSDateFormatter alloc] init];

[dateFormat setDateFormat:@"YYYY-MM-dd HH:mm:ss"];

unsigned long long timestamp = [[[messages objectAtIndex:indexPath.row] objectForKey:@"timestamp"] longLongValue];
NSDate *date = [NSDate dateWithTimeIntervalSince1970:timestamp];
NSString *dateStr = [dateFormat stringFromDate:date];

2011年10月15日 星期六

[Obj-c] [TableView] Cell Options

  • Disable Cell HighLighting
    • [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
    • cell.setSelectionStyle =  UITableViewCellSelectionStyleNone;
    • Choose one method do you like.

[Obj-c] [UIImage] UIImage Load Image From URL(影像載入)

無法查看此摘要。請 按這裡查看文章。

2011年10月13日 星期四

[Obj-C] [TabBar] Display TabBarController on second view

Delegate.h

@interface AppDelegate : NSObject 
{
    UITabBarController *tabBarController;
}

@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;

Delegate.m

@synthesize tabBarController;

- (void)showTabBar
{
    [loginController.view removeFromSuperview];
    [self.window addSubview:tabBarController.view];
}

TestController.m

#import "Delegate.h"

- (IBAction)showTabBar
{
  UIApplication *app = [UIApplication sharedApplication];
  [(FindSoneAppDelegate *)app.delegate showTabBar];
}