Re: Solving memory leaks

2010-03-28 Thread Michael Davey
OK, thanks for the links, and the help - I am going to read through and apply what I have learned to my code, I have already managed to fix two other leaks as a result of what I have learned. Thank you. On 28 Mar 2010, at 19:03, Philip Mobley wrote: > > On Mar 28, 2010, at 10:42 AM, mmalc Cr

Re: Solving memory leaks

2010-03-28 Thread Michael Davey
I cache the fields array on the first run so that the method is efficient - this is a generic SQLite db wrapper that may potentially be used to access 1000s of rows, and it seems perfectly reasonable that I should be able to store the fields in between SELECTs On 28 Mar 2010, at 19:04, Jack Ca

Solving memory leaks

2010-03-28 Thread Michael Davey
> -(NSDictionary *)fetch { > NSMutableDictionary *output = nil; > if (db != nil && sth != nil) { > int c = sqlite3_column_count(sth); > if (fields == nil) { > fields = [[NSMutableArray alloc] init]; > for (int i =

Re: Solving memory leaks

2010-03-28 Thread Michael Davey
, Klaus Backert wrote: > > On 28 Mar 2010, at 18:40, Michael Davey wrote: > >>> 1. Some other piece of code assigns a new value to 'myFields' without >>> releasing the old value. >> >> That is the only part of my code that adds values to the fi

Re: Solving memory leaks

2010-03-28 Thread Michael Davey
On 28 Mar 2010, at 02:14, Quincey Morris wrote: > On Mar 27, 2010, at 16:51, Noah Desch wrote: > >> If you are *not* using getters and setters but instead have myFields >> declared as: >> >> @interface MyClass >> { >> NSMutableDictionary *myFields; >> } >> >> and you use the above line o

Re: Solving memory leaks

2010-03-27 Thread Michael Davey
Thank you all so much for your responses - I will give them much better attention tomorrow, and sober :o) On 28 Mar 2010, at 02:23, Klaus Backert wrote: > > On 27 Mar 2010, at 23:16, Quincey Morris wrote: > >> On Mar 27, 2010, at 14:11, Klaus Backert wrote: >> >>> something like this (caution

Re: Solving memory leaks

2010-03-27 Thread Michael Davey
On 27 Mar 2010, at 22:16, Quincey Morris wrote: > On Mar 27, 2010, at 14:11, Klaus Backert wrote: > >> something like this (caution: typed in mail, etc.) > > > Yeah, something like this, but *not* this: > >> self.myFields = [[NSMutableArray alloc] init]; > > That's a memory leak right t

Re: Solving memory leaks

2010-03-27 Thread Michael Davey
s when you assign a > newly allocated array to feilds. > > You should either release fields before reassigning it (conditionally if it > is not nil), or do not reallocate memory for it, instead empty it and reuse > the existing memory. > > Sandor Szatmari > > On Mar

Solving memory leaks

2010-03-27 Thread Michael Davey
Hi! I have been running my iPhone application through the Leaks Instrument in an attempt to further understand what I have been coding, however, I fear I do not know enough about how retain/release work to be able to fix my leaks, and I was wondering if I could paste one trouble spot function t

Re: UITable Views and display lags / NSOperation vs NSURLConnection

2010-03-21 Thread Michael Davey
NSURLConnection was indeed more appropriate for what I needed, and what I ended up using. On 21 Mar 2010, at 18:06, Jack Carbaugh wrote: > NSURLConnection does this as well. The main issue i had with using an > NSOperation/OperationQueue was that is was "serial" ... using the > NSURLConnection

Re: UITable Views and display lags

2010-03-19 Thread Michael Davey
That worked a treat - thanks. I was already aware of the threading issues as have developed for the Mac before, but thanks for the heads up On 19 Mar 2010, at 17:55, WT wrote: > On Mar 19, 2010, at 6:40 PM, Michael Davey wrote: > >> OK, so I have changed the code to show a place

Re: FREED(id)

2010-03-19 Thread Michael Davey
Thank you for your help On 19 Mar 2010, at 20:04, Don Quixote de la Mancha wrote: > While Guard Malloc didn't find this particular problem, before you > deliver to your client you would do well to test your entire > application with Guard Malloc enabled. If it complains, then you've > got a bug

Re: FREED(id)

2010-03-19 Thread Michael Davey
I will, but for now I just need to get this out of the door for a client - however, it certainly looked like a very powerful tool. On 19 Mar 2010, at 19:43, Greg Parker wrote: > On Mar 19, 2010, at 11:55 AM, Michael Davey wrote: >> Thanks, I have managed to find and fix my error, just

Re: FREED(id)

2010-03-19 Thread Michael Davey
Thanks, I have managed to find and fix my error, just by using Zombies - I turned on Guard Malloc and it didn't do anything, and I tried instruments and found myself in a whole new world of things I have no idea how to use :o) On 19 Mar 2010, at 18:09, Don Quixote de la Mancha wrote: > On Fri,

Re: FREED(id)

2010-03-19 Thread Michael Davey
Thank you both for your suggestions, I will give them a go later :o) On 19 Mar 2010, at 18:09, Don Quixote de la Mancha wrote: > On Fri, Mar 19, 2010 at 11:00 AM, Nick Zitzmann wrote: >> Run your app with Instruments with the object alloc tool, and turn on >> reference counting and zombies. And

Re: UITable Views and display lags

2010-03-19 Thread Michael Davey
available. You > should not do anything to interrupt smooth scrolling. > > Luke > > On Mar 19, 2010, at 10:18 AM, Michael Davey wrote: > >> Another question... >> >> In my application, I have several connected UITable views, and on the last >> level, I am

UITable Views and display lags

2010-03-19 Thread Michael Davey
Another question... In my application, I have several connected UITable views, and on the last level, I am displaying images that may or may not already be cached, what I would like to know is whether there is some way I can display some sort of notification to the user that this is what is hap

FREED(id)

2010-03-19 Thread Michael Davey
Hi, I have just encountered the following error at (seemingly) random intervals when trying to debug my iPhone application, and I was wondering what causes it and how I might go about hunting it down so that I can try and fix it? objc[22029]: FREED(id): message release sent to freed object=0x3b

Re: Case sensitive fileName

2010-03-17 Thread Michael Davey
I don't think that the OP wanted to iterate through the entire directory though... On 17 Mar 2010, at 16:15, Don Quixote de la Mancha wrote: > Does readdir work on Mac OS X? I don't have a Mac handy right now to > check, but it should work because so many *NIX programs build on OS X > right out

Re: Noob iPhone Question

2010-03-11 Thread Michael Davey
ere is space left on the device you > should be able to keep using it for storing your downloaded images. > > Regards, > Thomas > > > On 12 March 2010 08:08, Michael Davey wrote: >> Hi, >> >> I am now being approached to develop an iPhone application for one

Noob iPhone Question

2010-03-11 Thread Michael Davey
Hi, I am now being approached to develop an iPhone application for one of my clients which will involve storing a cache of previously downloaded images. My question is whether or not there are constraints as to how my storage space I have at my disposal, and whether any of you have a link to f

UILabel updating from a button click

2010-02-21 Thread Michael Davey
Hi, I have, for a bit of fun, taken my first steps out of Mac development and into iPhone development, and have encountered a bit of a problem. Basically, what I want to do is update a UILabel when a button is clicked in the view, but I want to be able to update it in intervals with different

Re: NSTableViewDataSource Protocol

2010-02-18 Thread Michael Davey
Thanks for that! On 18 Feb 2010, at 16:05, Sean McBride wrote: > On 2/18/10 12:07 PM, Michael Davey said: > >> I am writing an app that needs to be able to target 10.5 at least and >> hopefully 10.4, but I have just found that the way that table views are >> handled h

Re: NSTableViewDataSource Protocol

2010-02-18 Thread Michael Davey
OK, just did some reading on informal protocols, thanks a lot for your help Mikey On 18 Feb 2010, at 12:40, Graham Cox wrote: > > On 18/02/2010, at 11:37 PM, Michael Davey wrote: > >> My class is describes as follows: >> >> @interface AppController : NSObject

Re: NSTableViewDataSource Protocol

2010-02-18 Thread Michael Davey
My class is describes as follows: @interface AppController : NSObject I tried removing NSObject and putting it there, but that did not work - any clues? Thanks, btw On 18 Feb 2010, at 12:28, Graham Cox wrote: > > On 18/02/2010, at 11:21 PM, Michael Davey wrote: > >> We

Re: NSTableViewDataSource Protocol

2010-02-18 Thread Michael Davey
e_Protocol/Reference/Reference.html Suggest that it is available to 10.6 and later Any idea what I might be doing wrong? On 18 Feb 2010, at 12:14, Graham Cox wrote: > > On 18/02/2010, at 11:07 PM, Michael Davey wrote: > >> I have just found that the way that table views are handled h

NSTableViewDataSource Protocol

2010-02-18 Thread Michael Davey
Hi, I am writing an app that needs to be able to target 10.5 at least and hopefully 10.4, but I have just found that the way that table views are handled has changed - does anyone have a link to some documentation for the old way to do things? Many thanks, Mikey___

Re: NSExtraMIData?

2010-01-11 Thread Michael Davey
I googled and found this, I hope it helps: http://imlocation.wordpress.com/2007/09/13/strange-objects-nscftype-indicate-memory-management-bugs/ On 12 Jan 2010, at 14:54, Graham Cox wrote: > Anyone got any idea what NSExtraMIData is? > > I'm getting a "unrecognized selector" error logged on thi

Re: [iPhone] how do I stop a running thread

2010-01-02 Thread Michael Davey
To elaborate and agree... Run your thread in a loop such as: while (isRunning) { // work done here } and have a method such as: -(void)stopThread { isRunning = NO; } On 3 Jan 2010, at 16:56, Glenn L. Austin wrote: > Your best bet -- have a flag that the thread can check for ex

Re: Adding sub menus programatically [SOLVED]

2009-12-27 Thread Michael Davey
: > > On Dec 24, 2009, at 4:25 AM, Michael Davey wrote: > >> Hi, >> >> I have googled around but have found nothing that can help me with this... I >> have a menu in my application that I wish to add sub items to >> programatically. I have the Menu itself connec

Re: Detect dim/brightness keys on laptop

2009-12-26 Thread Michael Davey
As far as I know, the system provides you with this choice. On 26 Dec 2009, at 01:01, John Clayton wrote: > Hi All > > I there a way to detect, on a system wide basis, that the dim/brightness keys > (or volume keys) have been pressed? > > I tried using the event-tap API using a HID + head base

Adding sub menus programatically

2009-12-24 Thread Michael Davey
Hi, I have googled around but have found nothing that can help me with this... I have a menu in my application that I wish to add sub items to programatically. I have the Menu itself connected up and I can add NSMenuItems to it just fine, but seem at a loss to be able to add a sub menu and the

Re: Weird problem closing windows

2009-12-19 Thread Michael Davey
Not quite sure how but I seem to have fixed this - sorry for wasting your time... On 19 Dec 2009, at 18:22, Michael Davey wrote: > Hi, > > I am experiencing a weird problem with my GC (if this is relevant) > application when trying to re-display windows that are in the main xib fi

Re: NSAlert or what?

2009-12-18 Thread Michael Davey
So the problem I was having with my googling was that I was trying alert, popup and dialog - not sheet ;o) On 19 Dec 2009, at 18:41, Ken Thomases wrote: > On Dec 19, 2009, at 12:37 AM, Michael Davey wrote: > >> Sorry for the really noob posting, but I am currently using the NSAle

Re: NSAlert or what?

2009-12-18 Thread Michael Davey
appropriate > implementation ourselves. I like the new "Implementation" sections a lot, > though currently they seem to only exist for the various views and controls. > > [1] > <http://developer.apple.com/mac/library/DOCUMENTATION/UserExperience/Conceptual/AppleHIGuidelin

Weird problem closing windows

2009-12-18 Thread Michael Davey
Hi, I am experiencing a weird problem with my GC (if this is relevant) application when trying to re-display windows that are in the main xib file. More specifically, when I try to launch the preferences panel for the second time it hangs the window with even the close button disabled. Is ther

NSAlert or what?

2009-12-18 Thread Michael Davey
Hi, Sorry for the really noob posting, but I am currently using the NSAlert class to display alerts in my application, but what I would rather do is display one of the alert boxes that slide out of the title bar, as with the installer, firefox and a slew of other applications. Does anyone know

Re: Build target question

2009-11-23 Thread Michael Davey
you may need some other #if statements or may not, since you are not building > for a different platform. > > Karolis > > On Mon, Nov 23, 2009 at 7:51 PM, Michael Davey wrote: > I am about to add a new target to my project as it will be re-using a lot of > the code g

Build target question

2009-11-23 Thread Michael Davey
I am about to add a new target to my project as it will be re-using a lot of the code generated from my server application and I do not want to start creating duplicate copies of classes that I am writing. So far, so good, I am finding my way around making my new target, but have a quick questi

mySQL libs and an apology...

2009-11-23 Thread Michael Davey
First off, sorry to those who I have offended by asking the question of whether or not I can share my libs legally to this list. It was not my intention to do that. What I end up distributing with my application is still being considered, and I hope to resolve that before I approach my clients

A question of legality...

2009-11-23 Thread Michael Davey
I want to share with you all the 4 arch version of the mysql libs that I went to some trouble to make today, but in light of the information given to me today by Andrew Farmer, I do not know if this is legal. Anyone know? ___ Cocoa-dev mailing list (C

Re: mySQL client lib linking problem...

2009-11-22 Thread Michael Davey
have the 64bit PPC version as well - does anyone know if this is needed? Many thanks to all for your help, Mikey On 23 Nov 2009, at 18:10, Andrew Farmer wrote: > On 22 Nov 2009, at 22:33, Michael Davey wrote: >> Yeah, thanks - but given that I cannot even get it to build I will worry

Re: mySQL client lib linking problem...

2009-11-22 Thread Michael Davey
ile whenever you compile your app. > > Karolis > > On Sun, Nov 22, 2009 at 11:19 PM, Michael Davey wrote: > I am using the mysql c library in my application, and have wrapped the C > calls in an objective-C class (source available if needed). > > I have added the linking

Re: mySQL client lib linking problem...

2009-11-22 Thread Michael Davey
On 23 Nov 2009, at 16:19, Michael Davey wrote: > I am using the mysql c library in my application, and have wrapped the C > calls in an objective-C class (source available if needed). > > I have added the linking references as per instructions I have found on the > web an

mySQL client lib linking problem...

2009-11-22 Thread Michael Davey
I am using the mysql c library in my application, and have wrapped the C calls in an objective-C class (source available if needed). I have added the linking references as per instructions I have found on the web and when I run my application in debug mode everything works just fine, however, w

Re: UI Question: Hide application window after minimising

2009-11-22 Thread Michael Davey
proof of how far superior the Objective-C/Cocoa paradigm is to C#/.NET Thanks again Fritz On 21 Nov 2009, at 10:09, Michael Davey wrote: > > On 21 Nov 2009, at 08:19, Fritz Anderson wrote: > >> On 20 Nov 2009, at 2:02 AM, Michael Davey wrote: >> >>> Ba

Fwd: UI Question: Hide application window after minimising

2009-11-20 Thread Michael Davey
Ooops, forgot the list... > From: Michael Davey > Date: 21 November 2009 09:59:39 GMT+11:00 > To: Jason Foreman > Subject: Re: UI Question: Hide application window after minimising > > This is not what I wanted to do, but thanks... > > On 21 Nov 2009, at 08

UI Question: Hide application window after minimising

2009-11-20 Thread Michael Davey
Hi there, This is my first post, so please be gentle ;o) I am writing an application using obj-c/Cocoa and I was curious about something I have seen in another application that I would like mine to be able to do. Basically, when you minimise the application, it's window goes down into the dock