iphone-common-codes-ccteam源代码 CCUIViewController.m
//
// CCUIViewController.m
// CCFC
//
// Created by xichen on 11-12-28.
// Copyright 2011 ccteam. All rights reserved.
//
#import "CCUIViewController.h"
@implementation UIViewController(cc)
- (UIBarButtonItem *)addLeftBarButtonItem:aTitle
style:(UIBarButtonItemStyle)style
target:(id)target
action:(SEL)sel
{
UIBarButtonItem *barButtonItem =
[[UIBarButtonItem alloc] initWithTitle:aTitle
style:style
target:target
action:sel];
self.navigationItem.leftBarButtonItem = barButtonItem;
[barButtonItem release];
return barButtonItem;
}
- (UIBarButtonItem *)addRightBarButtonItem:aTitle
style:(UIBarButtonItemStyle)style
target:(id)target
action:(SEL)sel
{
UIBarButtonItem *barButtonItem =
[[UIBarButtonItem alloc] initWithTitle:aTitle
style:style
target:target
action:sel];
self.navigationItem.rightBarButtonItem = barButtonItem;
[barButtonItem release];
return barButtonItem;
}
- (UIView *)setLoadView
{
CGRect rect = [[UIScreen mainScreen] applicationFrame];
UIView *view = [[UIView alloc] initWithFrame:rect];
self.view = view;
return view;
}
@end
可能有更新:
googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCUIViewController.m
github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCUIViewController.m