Re: [Mysql-cocoa-users] prepareString and quoteObject (solution)
Brought to you by:
sergecohen
From: Serge C. <ser...@us...> - 2004-11-17 10:38:22
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Jim;=0D =0D Sorry not ot have answered before... anyway you got a correct answer =0D= from another user of the list (difference between class and instance =0D= methods).=0D If I'm sending this reply it is because I think there is something =0D wrong in the code snippet you send to the list :=0D =0D > MCPConnection *aQueryConnection =3D [[[MCPConnection alloc] init] =0D > retain];=0D =0D An object which is just alloc then init does NOT need to be retained =0D= because it's retain count is already set to 1, so unless you're trying =0D= to do something unusual you would just not need to call the 'retain' =0D= method.=0D =0D For more information on how to use alloc, init, retain, release and =0D autorelease a very good reference is Apple documentation :=0D http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/ =0D= index.html=0D http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaObjects/ =0D= index.html=0D =0D Hope this will help you...=0D =0D Serge.=0D =0D Le 17 nov. 04, =E0 00:51, Jim Hall a =E9crit :=0D =0D > I figured it out! (duh, it should have been obvious)=0D >=0D > For those of you searching the archives with a similar problem, try =0D= > using it like this:=0D >=0D > MCPConnection *aQueryConnection =3D [[[MCPConnection alloc] init] =0D > retain];=0D > MCPConnection *aQueryResult;=0D > aQueryResult =3D [aQueryConnection queryString:[NSString =0D > stringWithFormat:@"insert into table (fieldA,fieldB) values ( '%@', =0D= > '%@')",=0D > [aQueryConnection prepareString:fieldAString],=0D > [aQueryConnection prepareString:fieldAString]]];=0D >=0D > Thanks!=0D > -JH=0D =0D *******************************************=0D Serge Cohen=0D =0D GPG Key ID: 9CBB58FB=0D ******************************************* -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFBmynx5EPeG5y7WPsRAh7fAJ4x3jVWGh12THNfqNkd5/lGIiepVgCdFkMV 3H0Z8jTuHmXTs2FWpBIJFk0=3D =3DCASA -----END PGP SIGNATURE----- |