【发布时间】:2012-07-19 15:43:02
【问题描述】:
可能重复:
What is the right way to check for a null string in Objective-C?
如果我的 url 为空,我应该将 url 变量分配为空..我已经尝试过但仍然没有在我的 IF 语句中输入。我什至尝试过这个if([url isEqualToString:@""])
但它是徒劳的
下面是代码
-(void)newView:(NSString *)title Description:(NSString *)desc URL:(NSString *)url{
self.tblTwitter.userInteractionEnabled=NO;
self.tblFacebook.userInteractionEnabled=NO;
if (![url isEqualToString:@""])
{
//
NSLog(@"the perfect Value:%@",url);
// url=@"boom";
}
webView =[[UIWebView alloc]initWithFrame:CGRectMake(15, 25, 190, 190)];
webView.backgroundColor=[UIColor clearColor];
webView.delegate=self;
webView.opaque = NO;
【问题讨论】:
标签: objective-c xcode