[Mysql-cocoa-users] Re: My App
Brought to you by:
sergecohen
|
From: John G. <jo...@jl...> - 2003-09-26 09:27:06
|
no problem :)
would be worth forwarding this on to the list (which I have done now
anyway).
then let serge have your app code to look at.
There IS an init method by the way, just that it doesn't seem to be
initialising the encoding variable (internal to the framework)
JOhn
On Friday, September 26, 2003, at 12:25 AM, Ezat Hashim wrote:
> You were absolutely right! Thanks!
>
> The app bombed because (I guess) there is no 'init' method per se. I
> have made the changes as you suggested and things seem to be working
> now. Do you think that I should ask Serge to look at his 'init' to see
> what went wrong (I assume there is an init).?
>
>
> On Thursday, September 25, 2003, at 08:05 AM, John Guy wrote:
>
>> Hiya,
>>
>> had a very quick look, can't see anything that looks obviously wrong.
>>
>> I am a little busy, and also I just realised I am still using the
>> older version of the framework so I can't compile your code :(
>>
>> BUT
>>
>> I have noticed that you are doing a very simple
>> dbQuery=[[MCPConnection alloc] init];
>> in your DataController init method.
>>
>> Looking at the documentation it implies that you wouldn't normally
>> use a simple init, so maybe there is some problem in the Framework.
>>
>> This is the code I always use when setting up my connections etc.
>>
>> -(bool)loginToServer:(NSString*)server
>> user:(NSString*)user
>> password:(NSString*)pass
>> selectDatabase:(NSString*)db
>> {
>> if (dbConnection = [[MCPConnection alloc]
>> initToHost:server withLogin:user password:pass usingPort:0])
>> {
>> if ([dbConnection selectDB:db])
>> {
>> loggedIn = TRUE;
>> return(TRUE);
>> }
>> }
>> //TODO setting loggedIn may be redundent since a valid dbConnection
>> object
>> // means the same
>> loggedIn = FALSE;
>> return(FALSE);
>> } // loginToServer()
>>
>> as you can see I use the initToHost methods which I think Serge has
>> been using in his examples originally. So maybe this is setting up
>> the encoding better (again I haven't got the time to check the
>> Framework source code at the moment - sorry).
>>
>> Why not try using the initToHost method and see if this fixes you
>> problem.
>> Easiest way to check is change your
>> dbQuery=[[MCPConnection alloc] init];
>> to
>> dbQuery= [MCPConnection alloc];
>>
>> in the DataController init method
>>
>> then use the initToHost method in your establishConnectionToServer:
>> method in place of the call to connectWithLogin.
>>
>> hope this helps, also out of interest which method were you in when
>> you got the error exception in your debugger (which of your methods?)
>> this may help tell Serge which method was bombing out
>>
>> let me know how you get on.
>>
>> JOhn
>>
>>
>> On Thursday, September 25, 2003, at 11:46 AM, Ezat Hashim wrote:
>>
>>> Gee Thanks! I have attached my small app.
>>> <SMySQLTester.2.tar.gz>
>>> On Thursday, September 25, 2003, at 05:42 AM, John Guy wrote:
>>>
>>
>> |