Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 18, 2010, 11:41 AM   #1
mikezang
macrumors 6502a
 
Join Date: May 2010
Location: Tokyo, Japan
Can I use array for IBOutlet?

I have a table view with more than ten cells in row, it is not easy to set data as below
Code:
//  CustomCell.h
#import <UIKit/UIKit.h>
@interface CustomCell : UITableViewCell {
	UILabel *labelStartDate;
	UILabel *labelEndDate;
	UILabel *labelTradeType;
	UILabel *labelAccount;
	UILabel *labelCode;
	UILabel *labelName;
	UILabel *labelAmount;
	UILabel *labelStartPrice;
	UILabel *labelEndPrice;
	UILabel *labelValue;
	UILabel *labelProfitLoss;
	UILabel *labelProfitLossRate;
}
@property (nonatomic, retain) IBOutlet UILabel *labelStartDate;
@property (nonatomic, retain) IBOutlet UILabel *labelEndDate;
@property (nonatomic, retain) IBOutlet UILabel *labelTradeType;
@property (nonatomic, retain) IBOutlet UILabel *labelAccount;
@property (nonatomic, retain) IBOutlet UILabel *labelCode;
@property (nonatomic, retain) IBOutlet UILabel *labelName;
@property (nonatomic, retain) IBOutlet UILabel *labelAmount;
@property (nonatomic, retain) IBOutlet UILabel *labelStartPrice;
@property (nonatomic, retain) IBOutlet UILabel *labelEndPrice;
@property (nonatomic, retain) IBOutlet UILabel *labelValue;
@property (nonatomic, retain) IBOutlet UILabel *labelProfitLoss;
@property (nonatomic, retain) IBOutlet UILabel *labelProfitLossRate;
@end
Can I use as below?
Code:
//  CustomCell.h
#import <UIKit/UIKit.h>
@interface CustomCell : UITableViewCell {
	UILabel *label[10];
}
@property (nonatomic, retain) IBOutlet UILabel *label[10];
@end
__________________
iPad Mini 32GB, iPhone 4S 16GB, iPad1 32GB, Mac mini 2.53GHz 4GB 320GB, ThinkPad T60
MyApp: Market Event v1.9.2
mikezang is offline   0 Reply With Quote
Old Jul 18, 2010, 12:01 PM   #2
PhoneyDeveloper
macrumors 68030
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
No that won't work. Amusing idea though.

You could set tags for these views in IB and recover the labels with viewWithTag: if you find that more convenient.
PhoneyDeveloper is offline   0 Reply With Quote
Old Jul 18, 2010, 12:09 PM   #3
mikezang
Thread Starter
macrumors 6502a
 
Join Date: May 2010
Location: Tokyo, Japan
That is too sad
__________________
iPad Mini 32GB, iPhone 4S 16GB, iPad1 32GB, Mac mini 2.53GHz 4GB 320GB, ThinkPad T60
MyApp: Market Event v1.9.2
mikezang is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
IBOutlet won't link to button whitedragon101 iPhone/iPad Programming 3 Mar 11, 2013 01:05 PM
Array Containing Dictionaries ahan.tm iPhone/iPad Programming 2 Nov 18, 2012 10:31 AM
Can't move a IBOutlet UILabel position hontrok iPhone/iPad Programming 6 Nov 14, 2012 06:41 AM
NSMutable Array Help AnonymousInUse iPhone/iPad Programming 12 Oct 11, 2012 03:46 PM
RAID Array help Lord Adama Mac Pro 3 Jun 5, 2012 10:27 PM

Forum Jump

All times are GMT -5. The time now is 01:31 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC