1
我無法使用字符串值從數組中保存所選項目。任何想法有什麼不對?比較id對象和NSString
它我比較代碼:
if(self.detailItem){
[WebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:[self.detailItem description] ofType:@"html"]isDirectory:NO]]];
NSString *value = (NSString *)self.detailItem;
NSString *value1 = (NSString *)@"DecideVectorVPiramidi";
value=[NSString stringWithFormat:@"%@", value];
value1=[NSString stringWithFormat:@"%@", value1];
if (value == value1) {
WebView.scalesPageToFit=YES;
}
這是陣列碼:
類型的detailItem
case 1:
switch (self.nomberInSection) {
case 0:
self.detailViewController.detailItem =[NSString stringWithFormat:@"%@", [DecideOfZakusPath objectAtIndex:indexPath.row]];
break;
}
break;
是id
。
的錯誤,我查