I have a program tha开发者_如何转开发t gets cookies. One param of this cookie is an NSNumber. So I save it to database as
sqlite3_bind_int(addStmt, 2, HEREisNSNUMBER);
Saving this value as:
cookieObj.created = [paramsDictionary valueForKey:@"Created"];
then I create and object of class, and get this parameter into NSNumber; after that, I have a wrong value. For example: In cookie I have a 329822675 after saving this changes to 79931776. How can I correctly save that number?
Please try
sqlite3_bind_int(addStmt, 2, [HEREisNSNUMBER intValue]);
You are trying to get the int-value of an NSNumber. That's where it goes wrong.
Use this instead:
sqlite3_bind_int  (addStmt, 2, [HEREisNSNUMBER intValue]);
`
NSNumber is a reference type. You should not assign it as a int value directly. You should get the intValue of NSNumber and bind it to sqlite3 statement.
sqlite3_bind_int(addStmt, 2, [HEREisNSNUMBER intValue]);
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论