iphone - How to correctly set a UISwitch ON state using a NSManagedObject boolean attribute type? -


Let's say that I have the following setup:

  .... UISchit GPS ; / / Type in the object given below Boolean has a GPSigned property - default NO NSManagedObject * typeObject; ....   

How exactly are I right about calling:

  self.gpsSwitch.on = [self. Type object recognition: @ "GPSAnited"];   

It always warns: One of the 'setOn:' argues: An integer without an artist makes an integer. does not work

I have tried:

  (BOOL) [self Type object value forekki: @ "GPSAnited"]; (NSInteger) [auto. Type object value forekki: @ "GPSAnited"];   

And none of these seems constipated? What is the fix? :)

[self.typeObject valueForKey: @ "gpsEnabled"] returns And the NSNumber object.

[[self.typeObject valueForKey: @ "gpsEnabled"] boolValue] returns a BOOL.

self.gpsSwitch A BOOL is required on

Regardless of what you set up in Boolean or Int or your original data model, they are always recovered / set as NSN, some misleading. Want to make an entry into your NSManaged object subclass which transforms for me.

Comments