Muju Muju - 1 year ago 53
iOS Question

Why I am Getting value of NSString like 0xb000000000000033 in Objective C

I am new to

and I have written code like this

NSString *Mobilenumber =[firstObj valueForKey:@"MobilNo"];
NSLog(@"Mobile Number is =%@",Mobilenumber);
NSString *Employeeid=[firstObj valueForKey:@"EmpId"];
NSLog(@"Employee ID is =%@",Employeeid);

Mobile Number gives me correct value while
give me value like this 0xb000000000000033. But when I
the Employeeid it shows value as 3.

But when I compair it with the value of another text

if ([EmployeeStr isEqual:techString])

it doesn't go to
condition but both the string contain the same value. How to solve this type of value 0xb000000000000033.

Answer Source

// i think you getting NSNumber object for that key "EmpId" just try like this, i hope it will work for you.

 NSString *Employeeid = [NSString stringWithFormat:@"%@", [firstObj valueForKey:@"EmpId"]]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download