执行搜索后,tableview中的值会更改

时间:2017-03-31 12:34:19

标签: ios objective-c uitableview uisearchbar uisearchdisplaycontroller

我在加载页面后收到了正确的数据,如此屏幕enter image description here

所示

即使在执行此图像搜索后也能获得正确的数据 enter image description here

但搜索被取消后我得到了错误的数据(标签应该是ph:+和传真:+但它显示为传真:+像这样enter image description here

使用此代码

@interface StaffDirectoryModel : NSObject
@property (nonatomic,retain) NSString*name;
@property (nonatomic,retain) NSString*occupation;
@property (nonatomic,retain) NSString*phlabel;
@property (nonatomic,retain) NSString*phonelabel;
@property (nonatomic,retain) NSString*fxlabel;
@property (nonatomic,retain) NSString*faxlabel;
@property (nonatomic,retain) NSString*department;

和 staffdirectory模型类

@interface Staffcustom : UITableViewCell
@property (strong, nonatomic) IBOutlet UILabel *fxlabel;

@property (weak, nonatomic) IBOutlet UILabel *namelabel;
@property (weak, nonatomic) IBOutlet UILabel *occupationlabel;
@property (weak, nonatomic) IBOutlet UILabel *phlabel;
@property (weak, nonatomic) IBOutlet UILabel *faxlabel;
@property (weak, nonatomic) IBOutlet UILabel *phonelabel;
@property (weak, nonatomic) IBOutlet UILabel *faxnumlabel;
@property (nonatomic,retain) IBOutlet UILabel *Depart;
@end

staffcustom.h

Person teacher = new Teacher();

0 个答案:

没有答案