textvalue are: item name, the number of claims; paper towels, 2; pencil, 2; ballpoint pen, 2;
NSUInteger length = [textValue length];
while ([textValue length]! = 0) {
NSMutableDictionary * sheetDict = [[NSMutableDictionary alloc] initWithCapacity: 10];
. NSInteger locoal = [textValue rangeOfString: @ ","] location;
NSString * name = [textValue substringToIndex: locoal];
NSLog (@ "name0% @", name) ;/ / print name is in this: Item Name
[SheetDict setObject: name forKey: @ "name"];
NSString * temp = [textValue substringFromIndex: locoal +1];
textValue = temp;
length = [textValue length];
locoal =. [textValue rangeOfString: @ ";"] location;
NSString * value = [textValue substringToIndex: locoal];
NSLog (@ "value0% @", value) ;/ / print the value here is: the number of applications
[SheetDict setObject: (NSString *) value forKey: @ "value"];
NSLog (@ "sheetDict00 =% @", sheetDict);
/ / Here print data dictionary appeared
{
name = "\ U7269 \ U54c1 \ U540d \ U79f0";
value = "\ U7533 \ U9886 \ U6570 \ U91cf";
},
I do not know why, heroes guidance. Thank you.
temp = [textValue substringFromIndex: locoal +1];
textValue = temp;
NSLog (@ "textvalue length =% d", [textValue length]);
[SheetArray addObject: sheetDict];
[SheetDict release];
NSLog (@ "sheetDict0 =% @", sheetDict);
NSLog (@ "sheetArray0% @", sheetArray);
}
Reply:
Chinese dictionary is one such store that you like this print out is correct:
NSLog (@ "% @", [newDic valueForKey: @ "value"]);
Reply:
The Chinese character display needs to in
uilabelNSString * name = [dic objectForKey: @ "name"];
NSString * value = [dic objectForKey: @ "value"];
UILabel * detailLabel1 = (UILabel *) [cell.contentView viewWithTag: (i * 2)];
UILabel * detailLabel2 = (UILabel *) [cell.contentView viewWithTag: (i * 2 + 1)];
detailLabel1.text = name ;/ / Because here the name and value is {
name = "\ U7269 \ U54c1 \ U540d \ U79f0";
value = "\ U7533 \ U9886 \ U6570 \ U91cf";
}, So here's text label is wrong, cause detailLabel1.text not properly set. May I ask why? Thank you.
detailLabel2.text = value;
Reply:
NSString * name = @ "Item Name";
NSMutableDictionary * newDic = [[NSMutableDictionary alloc] initWithCapacity: 10];
[NewDic setObject: name forKey: @ "value"];
lblTitle.text = [newDic objectForKey: @ "value"];
NSLog (@ "% @", [newDic objectForKey: @ "value"]);
There will be a problem? I am doing normal ah
Reply:
Reply:
Thank you, the problem has been resolved.
No comments:
Post a Comment