mysql-cocoa-users Mailing List for MySQL Objective C API for Cocoa (Page 6)
Brought to you by:
sergecohen
You can subscribe to this list here.
2002 |
Jan
(2) |
Feb
|
Mar
(14) |
Apr
(5) |
May
(23) |
Jun
(8) |
Jul
(13) |
Aug
(5) |
Sep
|
Oct
(1) |
Nov
(11) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(9) |
Feb
(6) |
Mar
(13) |
Apr
(2) |
May
(3) |
Jun
|
Jul
(5) |
Aug
(11) |
Sep
(18) |
Oct
(1) |
Nov
(15) |
Dec
(2) |
2004 |
Jan
(3) |
Feb
(3) |
Mar
(8) |
Apr
(1) |
May
(2) |
Jun
(3) |
Jul
(15) |
Aug
(36) |
Sep
(5) |
Oct
|
Nov
(6) |
Dec
(2) |
2005 |
Jan
(1) |
Feb
(11) |
Mar
(1) |
Apr
(6) |
May
|
Jun
(7) |
Jul
(3) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2006 |
Jan
(9) |
Feb
(5) |
Mar
(2) |
Apr
(1) |
May
(9) |
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
|
Oct
(1) |
Nov
|
Dec
(2) |
2007 |
Jan
(23) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2008 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Camille GOUREAU-S. <ca...@lu...> - 2004-08-13 21:37:42
|
Hi, I've created (part of) a classe I called MCPQuery. It provides me query (NSString*) when feeded with information. Has one of you already worked on such a thing ? Is it a non sense ? Is there a better way to avoid re-writing the sames lines of code ? Here are the functions I implemented : + (NSString*) selectQueryWithSelect: (NSDictionary*) fields andWhere: (NSString*) where ; // returns a "select from xhere" string with the fields extracted from fields and the from also + (NSString*) fromStringWithFields: (NSDictionary*) fields ; + (NSString*) queryEmptyInsertInTable: (NSString*) table ; + (NSString*) queryShowColumnsFromTable: (NSString*) table ; + (NSString*) queryUpdateFields: (NSDictionary*) fields inTable: (NSString*) table where: (NSString*) where ; + (NSString*) queryInsertFields: (NSDictionary*) fields inTable: (NSString*) table ; |
From: Serge C. <ser...@us...> - 2004-08-13 19:51:15
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi;=0D =0D thanks for pointing the problem (together with th solution) to me!=0D I'll implement what you propose as soon as I'm finished with my current =0D= development (which is some kind of enterprise layer on top of SMySQL), =0D= though it might take a couple of weeks, hence I forward your message to =0D= the mailing list, so people get the info.=0D =0D Thanks again for using the framework, and even more to provide feedback.=0D= =0D Serge.=0D =0D Le 13 ao=FBt 04, =E0 13:38, Chad Cunningham a =E9crit :=0D =0D >=0D > Hi,=0D >=0D > Have you considered making up a version of this with MySQL 4.1+ client = =0D > libraries? They changed the password algorithm in 4.1 and clients =0D > using your framework are unable to authenticate to the server. I've =0D= > rebuilt it with an updated library, but I figure some people may =0D > download this (or an application that uses it) and not know what's =0D > wrong. The 4.1 client library should be backwards compatible so it =0D > would work with almost any mysql server out there.=0D >=0D >=0D >=0D *******************************************=0D Serge Cohen=0D =0D GPG Key ID: 9CBB58FB=0D *******************************************=0D =0D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFBHRuq5EPeG5y7WPsRAuYBAKCu2IY82yIGvLdbfMM+qRMWxxcVowCg4kNW 0kHIkheSOsOeVMCfsld7sgY=3D =3DAv9F -----END PGP SIGNATURE----- |
From: Aaron J. <aj...@ed...> - 2004-08-10 19:07:51
|
This has been covered on the list before: http://sourceforge.net/mailarchive/forum.php? thread_id=5094134&forum_id=2800 Aaron On Aug 10, 2004, at 1:54 PM, John Spicer wrote: > I want to show a sheet when an update fails. > > I have found that result = 0x00 on a good or bad update so I can't use > that. How do I test for an error? > > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > Mysql-cocoa-users mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users |
From: John S. <joh...@hw...> - 2004-08-10 18:55:03
|
I want to show a sheet when an update fails. I have found that result = 0x00 on a good or bad update so I can't use that. How do I test for an error? |
From: Camille GOUREAU-S. <ca...@lu...> - 2004-08-09 20:13:04
|
I'll try it ASAP. Many thanks for your work. Camille Le 9 ao=FBt 04, =E0 20:28, Aaron Jacobs a =E9crit : > I'd just like to say that I really appreciate the new -quoteObject:=20 > method in SMySQL. I've been having to write a ton of repeated code to=20= > support this (especially with NULL objects), and now I don't have to=20= > anymore. Thanks, Serge! > > Aaron |
From: Aaron J. <aj...@ed...> - 2004-08-09 18:29:05
|
I'd just like to say that I really appreciate the new -quoteObject: method in SMySQL. I've been having to write a ton of repeated code to support this (especially with NULL objects), and now I don't have to anymore. Thanks, Serge! Aaron |
From: Serge C. <ser...@us...> - 2004-08-09 16:54:50
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi there; A short mail to announce the new release : 2.3.1 Mostly it add support for : - - unsigned integer (up to UNSIGNED BIGGINT, included). - - retrieve TEXT columns as NSString (not NSData anymore). - - a new method quoteObject (from MCPConnection), quoting object into a suitable way for use with MySQL (deciding the type of quoting from the class of the object). Note : the unsigned integers support required I subclass NSNumber so that the retrieved object knows it's unsigned and will perform accordingly when : - - printend out - - compared to other NSNumbers. Hope you'll appreciate these few new features... Serge. ******************************************* Serge Cohen GPG Key ID: 9CBB58FB ******************************************* -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFBF6xS5EPeG5y7WPsRAkB/AJ9ekCuqij8KMC8uqdPWEXQNI7IiNQCaAzpV FDz8ljJjJVhwHtF+7smctrU= =iJBk -----END PGP SIGNATURE----- |
From: Aaron J. <aj...@ed...> - 2004-08-09 13:33:31
|
This is not so much an SMySQL question as it is a general Cocoa question, but what you want is NSMutableString's -replaceOccurrencesOfString:withString:options:range: method. Look at the class documentation for more information. On Aug 9, 2004, at 7:47 AM, Patel, Nilesh M wrote: > I guess poor choice of words on my part. I just need a char (e.g +) > that will automatically occur everytime it sees a +. > > so if user enters cat + dog > > I need a method that will display the string as: cat ++ dog. I need > that extra char > > -----Original Message----- > From: Aaron Jacobs [mailto:aj...@ed...] > Sent: Friday, August 06, 2004 10:07 AM > To: Patel, Nilesh M > Cc: mys...@li... > Subject: Re: [Mysql-cocoa-users] find replace strings > > > What do you mean by 'invoke a character'? The word 'invoke' is usually > used for calling functions or methods; it doesn't really make sense to > invoke a character. > > > On Aug 6, 2004, at 9:03 AM, Patel, Nilesh M wrote: > >> I have a string going into mysql database and I need away to invoke a >> specific character for example a plus sign (+) everytime a user enters >> a + character. Having even number of (+) would not crash my app. Does >> anyone know a method that I can implement that will allow me to invoke >> an extra charcter (+) everytime it is entered. >> Assumption: (+) is not alwasy entered. >> >> Thanks. > > > > ======================================================================= > ======= > The contents of this message, together with any attachments, are > intended only for the use of the person(s) to which they are addressed > and may contain confidential and/or privileged information. Further, > any medical information herein is confidential and protected by law. > It is unlawful for unauthorized persons to use, review, copy, > disclose, or disseminate confidential medical information. If you are > not the intended recipient, immediately advise the sender and delete > this message and any attachments. Any distribution, or copying of this > message, or any attachment, is prohibited. > ======================================================================= > ======= > |
From: John S. <joh...@hw...> - 2004-08-07 18:25:12
|
You can ignore that email. It was an error in my own code. On Aug 7, 2004, at 12:20 PM, John Spicer wrote: > I'm using this to clean up strings before they go into the DB. > Example: "The big dog's ear" will have the ' escaped. > This is great. Unfortunately, the data read from the DB later still > has the escape sequence in it. Is there a stock way to unescape this > stuff when it comes out of the DB? > > There does not seem to be a method in the SMySQL docs. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you noticed the changes on > Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, > one more big change to announce. We are now OSTG- Open Source > Technology > Group. Come see the changes on the new OSTG site. www.ostg.com > _______________________________________________ > Mysql-cocoa-users mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users > |
From: John S. <joh...@hw...> - 2004-08-07 17:20:19
|
I'm using this to clean up strings before they go into the DB. Example: "The big dog's ear" will have the ' escaped. This is great. Unfortunately, the data read from the DB later still has the escape sequence in it. Is there a stock way to unescape this stuff when it comes out of the DB? There does not seem to be a method in the SMySQL docs. |
From: Serge C. <ser...@us...> - 2004-08-07 01:32:21
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi there, Indeed for the last two days, the new version (2.3.0) is handling=20 properly TEXT column in that it will return a NSString object and NOT a=20= NSData anymore. If the encoding used by the DB is compatible with one of the encoding=20 supported by Cocoa, the retieve column should be correctly transformed=20= into strings. The other 'imporvement' or 'bug fix' of the 2.3 version (available=20 since the 4th or the 5th) is a better support of unsigned integer=20 types. The current version should support all signed and unsigned=20 integer types up to (and including) BIGINT (64b integers). Serge. Le 6 ao=FBt 04, =E0 19:26, John Guy a =E9crit : > BLOB is easy: > > Since the contents of a BLOB are unknown and up to the implementor=20 > (BINARY Large Object), it can only really be returned as raw data (ie.=20= > NSData) > > TEXT is trickier: > > I think there was some issue earlier on in the dev of the Framework=20 > where it was tricky to treat a TEXT object at all (in fact I am not=20 > sure it is supported in the version of the framework I am using at=20 > all) > > Potentially to do with string encoding? ie. what character set do you=20= > use to convert the TEXT object to when you put it into an NSString. > > I think someone else may be able to shed some light on this issue as I=20= > haven't been using TEXT types in my applications > > JOhn > > > > On 6 Aug 2004, at 17:25, Aaron Jacobs wrote: > >> Can someone explain to me why TEXT and BLOB fields in the database=20 >> are turned into NSData objects by SMySQL? Why not NSString? >> >> Aaron >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by OSTG. Have you noticed the changes=20= >> on >> Linux.com, ITManagersJournal and NewsForge in the past few weeks? = Now, >> one more big change to announce. We are now OSTG- Open Source=20 >> Technology >> Group. Come see the changes on the new OSTG site. www.ostg.com >> _______________________________________________ >> Mysql-cocoa-users mailing list >> Mys...@li... >> https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users >> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you noticed the changes = on > Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, > one more big change to announce. We are now OSTG- Open Source=20 > Technology > Group. Come see the changes on the new OSTG site. www.ostg.com > _______________________________________________ > Mysql-cocoa-users mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users > > ******************************************* Serge Cohen GPG Key ID: 9CBB58FB ******************************************* -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFBFC/H5EPeG5y7WPsRArWMAJ9NKa4R/1OAxQOzNrINHCe1xkr7BwCePGU+ +P2y6AMnUOijmwVcZYEOZdY=3D =3DD6N+ -----END PGP SIGNATURE----- |
From: John G. <jo...@jl...> - 2004-08-06 17:26:05
|
BLOB is easy: Since the contents of a BLOB are unknown and up to the implementor (BINARY Large Object), it can only really be returned as raw data (ie. NSData) TEXT is trickier: I think there was some issue earlier on in the dev of the Framework where it was tricky to treat a TEXT object at all (in fact I am not sure it is supported in the version of the framework I am using at all) Potentially to do with string encoding? ie. what character set do you use to convert the TEXT object to when you put it into an NSString. I think someone else may be able to shed some light on this issue as I haven't been using TEXT types in my applications JOhn On 6 Aug 2004, at 17:25, Aaron Jacobs wrote: > Can someone explain to me why TEXT and BLOB fields in the database are > turned into NSData objects by SMySQL? Why not NSString? > > Aaron > > > > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you noticed the changes on > Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, > one more big change to announce. We are now OSTG- Open Source > Technology > Group. Come see the changes on the new OSTG site. www.ostg.com > _______________________________________________ > Mysql-cocoa-users mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users > |
From: Aaron J. <aj...@ed...> - 2004-08-06 16:25:35
|
Can someone explain to me why TEXT and BLOB fields in the database are turned into NSData objects by SMySQL? Why not NSString? Aaron |
From: Aaron J. <aj...@ed...> - 2004-08-06 14:07:16
|
What do you mean by 'invoke a character'? The word 'invoke' is usually used for calling functions or methods; it doesn't really make sense to invoke a character. On Aug 6, 2004, at 9:03 AM, Patel, Nilesh M wrote: > I have a string going into mysql database and I need away to invoke a > specific character for example a plus sign (+) everytime a user enters > a + character. Having even number of (+) would not crash my app. Does > anyone know a method that I can implement that will allow me to invoke > an extra charcter (+) everytime it is entered. > Assumption: (+) is not alwasy entered. > > Thanks. |
From: Patel, N. M <Nil...@qu...> - 2004-08-06 14:04:33
|
I have a string going into mysql database and I need away to invoke a = specific character for example a plus sign (+) everytime a user enters = a= + character. Having even number of (+) would not crash my app. Does = anyone know a method that I can implement that will allow me to invoke = an extra charcter (+) everytime it is entered.=20 Assumption: (+) is not alwasy entered. =20 Thanks. -----Original Message----- =46rom: mys...@li... [mailto:mys...@li...]On Behalf Of mys...@li... Sent: Monday, August 02, 2004 11:35 PM To: mys...@li... Subject: Mysql-cocoa-users digest, Vol 1 #116 - 2 msgs Send Mysql-cocoa-users mailing list submissions to mys...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users or, via email, send a message with subject or body 'help' to mys...@li... You can reach the person managing the list at mys...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Mysql-cocoa-users digest..." Today's Topics: 1. count(*) (John Spicer) 2. Re: count(*) (Aaron Jacobs) --__--__-- Message: 1 To: mys...@li... =46rom: John Spicer <joh...@hw...> Date: Mon, 2 Aug 2004 14:33:13 -0500 Subject: [Mysql-cocoa-users] count(*) I'd like to use this to get the number of rows in a table. But there=20 does not seem to be an easy way with this API. What are other people doing=3F This is what is returned by the connection (MCPResult): MCPResult: (encoding : 5, dim 1 x 1) count(*) 0 It's that zero that I want! How do I get it=3F --__--__-- Message: 2 =46rom: Aaron Jacobs <aj...@ed...> Subject: Re: [Mysql-cocoa-users] count(*) Date: Mon, 2 Aug 2004 14:35:47 -0500 To: John Spicer <joh...@hw...>, mys...@li... Perhaps make your query something like: SELECT COUNT(*) AS rowCount; Then use something like: NSNumber rowCount =3D [[result fetchRowAsDicitonary]=20 objectForKey:@"rowCount"]; Aaron On Aug 2, 2004, at 2:33 PM, John Spicer wrote: > I'd like to use this to get the number of rows in a table. But there= =20 > does not seem to be an easy way with this API. > > What are other people doing=3F > > This is what is returned by the connection (MCPResult): > > MCPResult: (encoding : 5, dim 1 x 1) > count(*) > 0 > > It's that zero that I want! How do I get it=3F > > > > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you noticed the changes = on > Linux.com, ITManagersJournal and NewsForge in the past few weeks=3F = Now, > one more big change to announce. We are now OSTG- Open Source=20 > Technology > Group. Come see the changes on the new OSTG site. www.ostg.com > _______________________________________________ > Mysql-cocoa-users mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users --__--__-- _______________________________________________ Mysql-cocoa-users mailing list Mys...@li... https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users End of Mysql-cocoa-users Digest =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D The contents of this message, together with any attachments, are = intended only for the use of the person(s) to which they are addressed = and may contain confidential and/or privileged information. Further, an= y= medical information herein is confidential and protected by law. It is= = unlawful for unauthorized persons to use, review, copy, disclose, or = disseminate confidential medical information. If you are not the = intended recipient, immediately advise the sender and delete this = message and any attachments. Any distribution, or copying of this = message, or any attachment, is prohibited. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D |
From: Aaron J. <aj...@ed...> - 2004-08-02 19:35:55
|
Perhaps make your query something like: SELECT COUNT(*) AS rowCount; Then use something like: NSNumber rowCount = [[result fetchRowAsDicitonary] objectForKey:@"rowCount"]; Aaron On Aug 2, 2004, at 2:33 PM, John Spicer wrote: > I'd like to use this to get the number of rows in a table. But there > does not seem to be an easy way with this API. > > What are other people doing? > > This is what is returned by the connection (MCPResult): > > MCPResult: (encoding : 5, dim 1 x 1) > count(*) > 0 > > It's that zero that I want! How do I get it? > > > > ------------------------------------------------------- > This SF.Net email is sponsored by OSTG. Have you noticed the changes on > Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, > one more big change to announce. We are now OSTG- Open Source > Technology > Group. Come see the changes on the new OSTG site. www.ostg.com > _______________________________________________ > Mysql-cocoa-users mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users |
From: John S. <joh...@hw...> - 2004-08-02 19:33:19
|
I'd like to use this to get the number of rows in a table. But there does not seem to be an easy way with this API. What are other people doing? This is what is returned by the connection (MCPResult): MCPResult: (encoding : 5, dim 1 x 1) count(*) 0 It's that zero that I want! How do I get it? |
From: Camille GOUREAU-S. <ca...@lu...> - 2004-08-01 05:12:45
|
Hi, is there a mean with MCPResult to fetch the default value of a field ? Thanks. Camille |
From: John S. <joh...@hw...> - 2004-07-23 22:18:24
|
I have a database table in which one of the columns is a MEDIUMTEXT type since there may be a fair amount of data in it. How do I get the data out? I'm using this code which returns nothing for LONG_DESCRIPTION (the others are ok). while (row = [result fetchRowAsDictionary]) { DataStructure *thisOne = [[DataStructure alloc] init]; [thisOne setSHORT_DESCRIPTION:[row objectForKey:@"SHORT_DESCRIPTION"]]; [thisOne setALIAS:[row objectForKey:@"ALIAS"]]; [thisOne setLONG_DESCRIPTION:[row objectForKey:@"LONG_DESCRIPTION"]]; I've not seen any docs for doing this nor can I find an example. BLOB sample code would be nice as well ;) |
From: Serge C. <ser...@us...> - 2004-07-22 21:11:44
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hash: SHA1=0D =0D Hi there;=0D =0D You can also use the method isNSNull, which I have added as a category =0D= of NSObject (so works on any object):=0D =0D if ([[row objectForKey:@"COMMENT"] isNSNull]) {=0D ... what to do if it's null=0D }=0D else {=0D ... what to do if it a proper object (NOT NULL)=0D }=0D =0D Serge.=0D =0D Le 22 juil. 04, =E0 18:31, John Guy a =E9crit :=0D =0D > This came up a while ago (a long time ago) and I can't exactly =0D > remember the outcome, also I am using an old version of the framework =0D= > at the moment.=0D >=0D > the NSNull is a special Cocoa object to represent Null items.=0D >=0D > you can do something like=0D >=0D > if ([[row objectForKey:@"COMMENT"] isKindOfClass:NSNull])=0D > {=0D > // process the null object properly=0D > }=0D >=0D > I think that should help=0D > (have a look at the Cocoa documentation for NSObject for = isKindOfClass)=0D >=0D > JOhn=0D >=0D >=0D > On 22 Jul 2004, at 17:14, John Spicer wrote:=0D >=0D >> I have some rows in the database table that are nulls.=0D >>=0D >> I am trying to do an assignment like this:=0D >>=0D >> [thisOne setCOMMENT:[row = objectForKey:@"COMMENT"]];=0D >>=0D >>=0D >> but later on in assignments to elements I get an error of=0D >>=0D >> *** -[NSNull length]: selector not recognized=0D >>=0D >> since it's a null and not a string.=0D >>=0D >> How do I test this coming from the db and set it to an empty string?=0D= >>=0D >> I tried this=0D >>=0D >> if ([row objectForKey:@"COMMENT"] !=3D NULL)=0D >>=0D >>=0D >> but it's not a null, it's an object with a name of NSNull which I =0D >> don't know how to deal with!=0D >>=0D >> Help!=0D *******************************************=0D Serge Cohen=0D =0D GPG Key ID: 9CBB58FB=0D *******************************************=0D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFBAC2K5EPeG5y7WPsRAq/pAKDigw9KZ7JJ/MI/1CSOAugaXWaoqwCfbNcZ SyqpV3KU7zo63FQPTfYxOsE=3D =3DPZeV -----END PGP SIGNATURE----- |
From: John G. <jo...@jl...> - 2004-07-22 16:31:15
|
This came up a while ago (a long time ago) and I can't exactly remember the outcome, also I am using an old version of the framework at the moment. the NSNull is a special Cocoa object to represent Null items. you can do something like if ([[row objectForKey:@"COMMENT"] isKindOfClass:NSNull]) { // process the null object properly } I think that should help (have a look at the Cocoa documentation for NSObject for isKindOfClass) JOhn On 22 Jul 2004, at 17:14, John Spicer wrote: > I have some rows in the database table that are nulls. > > I am trying to do an assignment like this: > > [thisOne setCOMMENT:[row objectForKey:@"COMMENT"]]; > > > but later on in assignments to elements I get an error of > > *** -[NSNull length]: selector not recognized > > since it's a null and not a string. > > How do I test this coming from the db and set it to an empty string? > > I tried this > > if ([row objectForKey:@"COMMENT"] != NULL) > > > but it's not a null, it's an object with a name of NSNull which I > don't know how to deal with! > > Help! |
From: Aaron J. <aj...@ed...> - 2004-07-22 16:26:48
|
It its class is NSNull, why not do: if ([[row objectForKey:@"COMMENT"] class] != NSNull) Aaron On Jul 22, 2004, at 11:14 AM, John Spicer wrote: > I have some rows in the database table that are nulls. > > I am trying to do an assignment like this: > > [thisOne setCOMMENT:[row objectForKey:@"COMMENT"]]; > > > but later on in assignments to elements I get an error of > > *** -[NSNull length]: selector not recognized > > since it's a null and not a string. > > How do I test this coming from the db and set it to an empty string? > > I tried this > > if ([row objectForKey:@"COMMENT"] != NULL) > > > but it's not a null, it's an object with a name of NSNull which I > don't know how to deal with! > > Help! |
From: John S. <joh...@hw...> - 2004-07-22 16:14:13
|
I have some rows in the database table that are nulls. I am trying to do an assignment like this: [thisOne setCOMMENT:[row objectForKey:@"COMMENT"]]; but later on in assignments to elements I get an error of *** -[NSNull length]: selector not recognized since it's a null and not a string. How do I test this coming from the db and set it to an empty string? I tried this if ([row objectForKey:@"COMMENT"] != NULL) but it's not a null, it's an object with a name of NSNull which I don't know how to deal with! Help! |
From: John G. <jo...@jl...> - 2004-07-19 22:13:52
|
Just to echo what Aaron says, it does sound like more of a Cocoa question, and there is an absolute ton of useful information on the Cocoa mailing list archives which are really easy to search, you can find these at http://cocoa.mamasam.com/ I don't actually have my documentation to hand but as Aaron suggests you are probably using the wrong notification, Cocoa has a comprehensive set of notifications and delegate methods that you can use to get as much flexibility as you need. I implemented something very similar to what I think you are talking about here a while ago, and it was actually quite straightforward if memory serves correct. A couple of things I had to deal with were: How to cache the data: ie. I kept a local copy of what I was displaying in my table, the decision I had to make was should I reload the entire dataset for the table when I updated the database, or simply update my local copy at the same time as the remote (db update) - in my application I was able to opt for the simpler more efficient latter option, but there are going to be cases when this won't work. How to get reference to the raw data from the table information: I found I needed to keep additional data in a separate array to keep tabs of database row-id so that when I needed to update a specific piece of data I could do it directly. In fact in the long term I actually created a datastore object that was referenced by the table when needed and contained the hidden data I needed for db updates etc. anyway have fun JOhn On 19 Jul 2004, at 22:57, Aaron Jacobs wrote: > This sounds like more of a Cocoa question than an SMySQL question as > it really has nothing to do with the underlying storage. Either way, > it sounds like you are using the wrong notification. Try looking into > NSControlTextDidChangeNotification. > > > On Jul 19, 2004, at 4:01 PM, John Spicer wrote: > >> Was not sure if this list was even used. Have seen little about using >> this framework. But here goes. >> >> Just staring out to try and get this to work. I have a table loaded >> and displayed in a NSTableView. >> >> I have it registered with the notification center so when a user >> finishes editing a cell, it calls a method called updateTable- the >> idea being that the changes will be written back to the database. >> >> Alas, the notification is being called BEFORE the setObjectValue >> method, so the data is still old (ie I'm getting it from the array of >> NSMutableDictionaries. >> >> Where is the best place to do this? Perhaps right from the the >> setObjectValue method? |
From: Aaron J. <aj...@ed...> - 2004-07-19 21:57:59
|
This sounds like more of a Cocoa question than an SMySQL question as it really has nothing to do with the underlying storage. Either way, it sounds like you are using the wrong notification. Try looking into NSControlTextDidChangeNotification. On Jul 19, 2004, at 4:01 PM, John Spicer wrote: > Was not sure if this list was even used. Have seen little about using > this framework. But here goes. > > Just staring out to try and get this to work. I have a table loaded > and displayed in a NSTableView. > > I have it registered with the notification center so when a user > finishes editing a cell, it calls a method called updateTable- the > idea being that the changes will be written back to the database. > > Alas, the notification is being called BEFORE the setObjectValue > method, so the data is still old (ie I'm getting it from the array of > NSMutableDictionaries. > > Where is the best place to do this? Perhaps right from the the > setObjectValue method? |