我創建了一個iPad應用程序,其中我從URL中獲取數據, 當我寫這篇文章的代碼就說明我這個警告initWithContentsOfURL is deprecated
警告在Xcode 4.2目標C
這裏是代碼片段,
NSString *mainstr;
NSURL *urlr=[NSURL URLWithString:@"http://abc.com/default.aspx?id=G"];
NSURLRequest *reqr=[NSURLRequest requestWithURL:urlr];
[webViewq loadRequest:reqr];
mainstr=[[NSMutableString alloc]initWithContentsOfURL:urlr];
還的tableView它讓我看到這個警告,initWithFrame:reuseIdentifier: is deprecated
這裏是代碼片段,在我創造的每一行內一個標籤
static NSString *[email protected]"Cell";
if(cell == nil){
cell=[[[UITableViewCell alloc]initWithFrame:CGRectZero reuseIdentifier:CellIdentifier]autorelease];
CGRect frame;
frame.origin.x = 0;
frame.origin.y = 0;
frame.size.height = 40;
frame.size.width = 180;
UILabel *capitalLabelI = [[UILabel alloc] initWithFrame:frame];
capitalLabelI.tag = CapitalTag;
capitalLabelI.font=[UIFont systemFontOfSize:16.0];
}
capitalLabelI.text=[@" " stringByAppendingString:[a objectAtIndex:indexPath.row]];
return cell;
,當我調用多個參數化的方法,它讓我看到這個警告,
方法名稱:
-(void)recentquote:(NSString *)sym:(int)i
調用了Syntex:
[self recentquote:l3:i];
警告:
Instance method '-recentquote::' not found (return type default to 'id')'
幫幫我吧!
在此先感謝!
如果你給定的URL是現場,然後請刪除它,並把演示網址... – Maulik