我有 1 个文本字段和一个静态数组。我有数组中的项目,例如;12345-分支名称。但我只想从文本字段发送 12345 到肥皂电话。我能怎么做?
。H
-(IBAction)Send:(UIButton *)sender;
@property (strong, nonatomic) NSArray *branches;
@property (unsafe_unretained,nonatomic) IBOutlet UITextField *BranchextField;
.m
-(IBAction)Send:(UIButton *)sender{
NSString *mensagemSOAP= [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n"
"<soap:Body>\n"
"<UrunToplamiGetir xmlns=\"http://tempuri.org/\">\n"
"<BranchCode>%@</BranchCode>\n"
"</UrunToplamiGetir>\n"
"</soap:Body>\n"
"</soap:Envelope>\n"_BranchextField.text];
}
我的阿拉斯在这里
- (NSArray *)allbranches
{
if(!self.branches){
NSArray *branchNames = [self allCountries];
NSMutableArray *mutablebranch = [NSMutableArray new];
for(NSString *branchName in branchNames){
DEMOCustomAutoCompleteObject *branch = [[DEMOCustomAutoCompleteObject alloc]
initWithBranch:branchName];
[mutableBranches addObject:branch];
}
[self setBranchObjects:[NSArray arrayWithArray:mutableBranch]];
}
return self.branches;
}
- (NSArray *)allBranches
{
NSArray *branches =
@[
@"12345-NAME OF BRANCH",
@"67853-BRANCH 2",
@"43223-BRANHC 3",
@"66532-BRANCH 4",
@"76733-BRANCH 99",
];
return countries;
}