我有一個導入到控制器的自定義UI表格單元代碼。在控制器內,我正在尋找一些改變(改變邊界,顏色等)。我在XIB中連接了ref插座,但是當我嘗試在Controller中進行更改時,沒有任何反應。這裏是我的Controller.m或者:從控制器類自定義UIButton自定義表格單元
@synthesize btnExpDate;
- (void)viewDidLoad
{
[super viewDidLoad];
//detect iOS 7
NSString *ver = [[UIDevice currentDevice] systemVersion];
float ver_float = [ver floatValue];
if (ver_float >= 7.0) {
// adds border to borderless button for iOS 7
btnExpDate.layer.BorderWidth = 1;
btnExpDate.layer.CornerRadius = 4;
btnExpDate.layer.borderColor = [UIColor colorWithRed:230.0/255.0 green:230.0/255.0 blue:230.0/255.0 alpha:1.0].CGColor;
}
或者Controller.h
#import <UIKit/UIKit.h>
@class PullInventoryAddLotsTableCell;
@interface PullInventoryAddLotController : JCBaseController {
NSMutableArray* _newlyAddedLots;
}
@property (nonatomic, retain) IBOutlet UIButton* btnExpDate;
@end
當您鍵入NSLog(@「%@」,self.btnExpDate)時會顯示什麼內容。在viewDidLoad()中? – klefevre