Possible Duplicate:
What is the right way to check for a null string in Objective-C?
if my url is null i should assign the url variable with empty..i ve tried but still not getting entered in my IF statement.i even tried this if([url isEqualToString:@""])
but its in vain
below is the code
-(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;
Did you try that :
nil is the Objective-C for NULL, and nil doesn’t means empty.
This answer might be what you’re looking for : What is the right way to check for a null string in Objective-C?