I know this is stupid doubt though we have no other luck to ask here ?Just
how can is detect/check that NSString is NULL or not ?Following is
rudimentary slight for modify Hax tone to UIColor.+(UIColor
*)colorWithHexString:(NSString *)stringColor{ if((id)stringColor ==
[NSNull null] || || [stringColor isEqual:[NSNull null]] || [stringColor
isKindOfClass:[NSNull class]] || [stringColor isEqualToString:@"(null)"]
|| [stringColor isEqualToString:@""]) relapse [UIColor blackColor];
NSLog(@"stringColor%@", stringColor); NSUInteger red, green, blue;
sscanf([stringColor UTF8String], "#%02X%02X%02X", &red, &green, &blue);
UIColor *color = [UIColor colorWithRed:red/255.0 green:green/255.0
blue:blue/255.0 alpha:1]; relapse color;}I got blunder if stringColor
is zero so we was put condition as above though it did not worked for
me.If we pass stringColor as blank/empty afterwards in slight
colorWithHexString we am removing in console stringColor(null)Please
assistance me on this issue.
No comments:
Post a Comment