tags:

views:

35

answers:

1

i am getting error: cannot convert to pointer type

NSMutableDictonary *mydictonary;
[mydictionary setValue: [mySlider.value UTF8String] forKey: @"BR"];
+1  A: 

mySlider.value is a float, which does not respond to UTF8String selector.

Try this:

[mydictionary setValue:[[[NSNumber numberWithFloat:mySlider.value] stringValue] UTF8String] forKey: @"BR"];
JoeGaggler
warning: passing argument 1 of 'setValue:forKey:' from incompatible pointer type
coure06
If you just need an NSString stored in your dictionary, take out the "UTF8String" selector and just use "stringValue".
JoeGaggler
You shouldn't use `UTF8String`. Dictionary values must be objects, while `-[NSString UTF8String]` returns a `char*`.
Chuck