Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-09 Thread Russell Gray
OK, so i checked out the link, and tried the following calls: [subscriptions insertObject:subscriptionInfo atIndex:[subscriptions count]]; that didn't work, so I tried the following: [subscriptionsArrayController willChangeValueForKey:@"subscriptions"]; [subscriptions insertObject:subscriptionIn

Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-09 Thread Quincey Morris
On Jan 9, 2010, at 00:19, Russell Gray wrote: > OK, so i checked out the link, and tried the following calls: > > [subscriptions insertObject:subscriptionInfo atIndex:[subscriptions count]]; > > that didn't work, so I tried the following: > > [subscriptionsArrayController willChangeValueForKey:

Re: NSDatePicker 24 hour clock

2010-01-09 Thread Daniel Wambold
> > On Jan 8, 2010, at 3:12 PM, Daniel Wambold wrote: > >> Hello. I have an NSDatePicker (NSTextFieldAndStepperDatePickerStyle) and I >> need it to display time in a 24-hour time mode. After reading Apple's docs >> and searching the Web, I can't seem to find a way to make this happen. I >> hav

Re: NSDatePicker 24 hour clock

2010-01-09 Thread Daniel Wambold
> Daniel Wambold (wambo...@gmail.com) on 2010-01-08 6:12 PM said: > >> Hello. I have an NSDatePicker (NSTextFieldAndStepperDatePickerStyle) and >> I need it to display time in a 24-hour time mode. After reading Apple's >> docs and searching the Web, I can't seem to find a way to make this >> happe

Re: A password strength checker

2010-01-09 Thread Martin Hewitson
Thanks to all for the useful suggestions. I'll have a look through the various links and hopefully find something useful. Best wishes, Martin On Jan 9, 2010, at 12:24 AM, Matthew Lindfield Seager wrote: > On Saturday, January 9, 2010, Philip Ershler wrote: >> Martin, >>If you haven't

Re: NSDatePicker 24 hour clock

2010-01-09 Thread Sean McBride
Daniel Wambold (wambo...@gmail.com) on 2010-01-09 08:09 said: >> Strange. Have you tried in a test app? My app's >> NSTextFieldAndStepperDatePickerStyle NSDateField follows Sys Pref >> settings. I did nothing fancy to get that behaviour. > >Thanks for your reply. Yes, I tried a sample App. (XCo

Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-09 Thread Russell Gray
Ok, so I do have subscriptions, and subscriptionsArrayContoller set up as you say - I should have mentioned that. I also have the arrayController "Prepares Content" option checked in Interface Builder. I tried all those options you provided. none worked, I still have the same result, the tableV

Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-09 Thread Quincey Morris
On Jan 9, 2010, at 12:48, Russell Gray wrote: > Ok, so I do have subscriptions, and subscriptionsArrayContoller set up as you > say - I should have mentioned that. > I also have the arrayController "Prepares Content" option checked in > Interface Builder. > > I tried all those options you provi

Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-09 Thread Russell Gray
So, I added an observer to my awakeFromNIb: [subscriptionsArrayController addObserver: self forKeyPath: @"arrangedObjects" options: NSKeyValueObservingOptionNew context: NULL]; and the following method: - (void) observeValueF

Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-09 Thread mmalc Crawford
On Jan 9, 2010, at 1:50 pm, Russell Gray wrote: > On 10/01/2010, at 8:18 AM, Quincey Morris wrote: >> How about if you register your own KVO observer of the "subscriptions" >> property? Does it get notified when the property changes? Did you check the >> log for exception error messages? > So, I

Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-09 Thread Russell Gray
I have a controller object "Controller" of Class Name "AdBlockerPreferences", with the outlet connected to the Array Controller. the Array Controller's content is bound to Controller.subscriptions the Array Controller has the preference "Prepares Content" checked. .I also have File's Owner w

Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-09 Thread mmalc Crawford
On Jan 9, 2010, at 2:15 pm, Russell Gray wrote: > [subscriptionsArray addObject:output]; > You haven't shown where you're modifying 'subscriptions' (apart from in the init method). Do you have two arrays that mirror each other, subscriptions and subscriptionsArray? Otherwise, if this is

Enabling NSZombieEnabled programatically

2010-01-09 Thread Graham Cox
Is there a straightforward way to set the NSZombieEnabled environment variable programatically from within my app, and only for my app? It's OK if this would need a relaunch to take effect. I want to be able to add a UI control to enable this so that I can work with end-users who report over-re

[iPhone] NSCoder Question

2010-01-09 Thread Development
I am trying to transport data after being encoded with the coder. The problem is that when I get it on the other end I'm being told that the data is invalid. Does the coder on the iPhone not work the same as the one in MacOSX? The basic transport I am using is just a post to a url done with the

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Sean McBride
Graham Cox (graham@bigpond.com) on 2010-01-10 18:02 said: >Is there a straightforward way to set the NSZombieEnabled environment >variable programatically from within my app, and only for my app? It's >OK if this would need a relaunch to take effect. > >I want to be able to add a UI control to

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Jim Correia
On Jan 9, 2010, at 6:22 PM, Sean McBride wrote: > I've never tried, but NSDebug.h seems to say that there is an > NSZombieEnabled global var that you can set. Read the warning at the top of the header. While those variables have been there as long as I can remember, as soon as you ship software

Re: NSDatePicker 24 hour clock

2010-01-09 Thread Daniel Wambold
Sean- I changed the Apple Menu > System Preferences > Date & Time > Use a 24-hour clock setting. However, as I mentioned, I'd really prefer not to make this a system-wide change. I just find it odd that there would be no programmatic way to change the NSDatePicker to a 24-hour clock. If there is

Re: [iPhone] NSCoder Question

2010-01-09 Thread Mike Abdullah
On 9 Jan 2010, at 23:10, Development wrote: > I am trying to transport data after being encoded with the coder. The problem > is that when I get it on the other end I'm being told that the data is > invalid. Does the coder on the iPhone not work the same as the one in MacOSX? > > The basic tra

Re: NSFilesPromisePboardType

2010-01-09 Thread Nick Paulson
I ended up just using a define to easily change it later: #define kiTunesPboardType @"CorePasteboardFlavorType 0x6974756E" To anyone interested, it is a property list that contains a lot of information about iTunes itself and the tracks being dragged. Thanks for the help, Jim, --Nick On Jan 9

Re: [iPhone] NSCoder Question

2010-01-09 Thread Development
Well it gives me the error on any iPhone including the one that created the file. But I am using standard keyed archiving. I was under the impression that the data was serialized and transportable. When I receive the file it's through an NSURL request. So what is handed off from the methods is d

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Graham Cox
On 10/01/2010, at 10:26 AM, Jim Correia wrote: > On Jan 9, 2010, at 6:22 PM, Sean McBride wrote: > >> I've never tried, but NSDebug.h seems to say that there is an >> NSZombieEnabled global var that you can set. > > Read the warning at the top of the header. While those variables have been > t

Re: [iPhone] NSCoder Question

2010-01-09 Thread Mike Abdullah
Can you try manually placing a known good archive on the server, and then downloading from code? Sounds to me your upload process is probably to blame. On 10 Jan 2010, at 00:44, Development wrote: > Well it gives me the error on any iPhone including the one that created the > file. > But I am u

if statement causing 32 Byte leak?

2010-01-09 Thread Mr. Gecko
Hello, I'm going through leak checking and it seems that a if statement is causing a leak that's 32 Bytes big. My if statement is if (connections==nil) { connections = [[NSMutableArray new] retain]; } It says that if (connections==nil) is leaking 32 bytes which I have no idea how that

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Graham Cox
On 10/01/2010, at 12:15 PM, Mr. Gecko wrote: > Hello, I'm going through leak checking and it seems that a if statement is > causing a leak that's 32 Bytes big. My if statement is > > if (connections==nil) { > connections = [[NSMutableArray new] retain]; > } > > It says that if (connecti

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Paul Bruneau
-new is the equivalent of an -alloc and -init, so you already own the object at that point. Then you retain it, so I think that's more retaining than you want to do. That's my guess Sent from my iPhone--typos caused by auto-correct On Jan 9, 2010, at 8:15 PM, "Mr. Gecko" wrote: Hello, I'm

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Joar Wingfors
On 9 jan 2010, at 17.15, Mr. Gecko wrote: > if (connections==nil) { > connections = [[NSMutableArray new] retain]; > } > > It says that if (connections==nil) is leaking 32 bytes which I have no idea > how that could be possible. Yes I'm releasing connections after I'm done > using it.

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Mr. Gecko
I thought it was [[[id alloc] init] autorelease]; and I thought of another idea that it could of been, I clicked the button twice and because NSURLConnection is a thread based connection system, it could of been releasing at the same time as it was checking, so I added locks. On Jan 9, 2010, at

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Dave Keck
About a year ago I tried to enable NSZombieEnabled programatically but was never able to, resulting in the same behavior that you mentioned. (In fact, when using the NSZombieEnabled global to enable it, it seemed that it was "half-enabled", with it working on some objects, but still crashing on oth

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Graham Cox
On 10/01/2010, at 12:28 PM, Mr. Gecko wrote: > I thought it was [[[id alloc] init] autorelease]; You thought wrong: new Allocates a new instance of the receiving class, sends it an init message, and returns the initialized object. + (id)new Return Value A new instance of the receiver. Disc

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Dave Keck
> Discussion > This method is a combination of alloc and init. Like alloc, it initializes > the isa instance variable of the new object so it points to the class data > structure. It then invokes the init method to complete the initialization > process. While we're on the topic, I always though

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Graham Cox
On 10/01/2010, at 12:35 PM, Mr. Gecko wrote: > I just looked and saw that, so one question. Is array, string, and data all > the same as new or are those autorelease? As Joar said: > From the memory management guide: > > "You take ownership of an object if you create it using a method

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Graham Cox
On 10/01/2010, at 12:29 PM, Dave Keck wrote: > I'd say your best > bet would be to set the environment variable and re-launch your app. OK, seems to be that way. So how do I do that from within my app? I tried setenv("NSZombieEnabled", "YES", 1 ) but that didn't seem to work. --Graham _

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Mr. Gecko
I just looked and saw that, so one question. Is array, string, and data all the same as new or are those autorelease? On Jan 9, 2010, at 7:34 PM, Graham Cox wrote: > > On 10/01/2010, at 12:28 PM, Mr. Gecko wrote: > >> I thought it was [[[id alloc] init] autorelease]; > > > You thought wrong:

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Andy Lee
On Jan 9, 2010, at 8:40 PM, Dave Keck wrote: >> Discussion >> This method is a combination of alloc and init. Like alloc, it initializes >> the isa instance variable of the new object so it points to the class data >> structure. It then invokes the init method to complete the initialization >>

Re: Optimizing View Drawing Code

2010-01-09 Thread Stephen Blinkhorn
Hi Markus, On 8 Jan 2010, at 10:50, Markus Spoettl wrote: Are you absolutely sure that you're not updating more than the 20 times mentioned in your initial message? The audio back end posts a notification every 50ms to the GUI that the display needs refreshing. The GUI checks a few things

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Mr. Gecko
I know about memory management, but I don't know how I can tell what is autorelease or not. Is there a way to like says isAutorelease for testing? And you still didn't answer my question about string, data and so on, all I need is a yes or no. On Jan 9, 2010, at 7:41 PM, Graham Cox wrote: > >

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Andy Lee
On Jan 9, 2010, at 8:35 PM, Mr. Gecko wrote: > I just looked and saw that, so one question. Is array, string, and data all > the same as new or are those autorelease?

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Graham Cox
On 10/01/2010, at 12:52 PM, Mr. Gecko wrote: > I know about memory management, but I don't know how I can tell what is > autorelease or not. Is there a way to like says isAutorelease for testing? > And you still didn't answer my question about string, data and so on, all I > need is a yes or n

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Alex Kac
It seems pretty simple to me. Read the memory management rules. It explains pretty clearly what you own. That’s all that you care about. You don’t care if its autoreleased or not. You just care whether you own it or not. If you own it, you release it when you’re done. If you don’t own it, you le

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Joar Wingfors
On 9 jan 2010, at 17.35, Mr. Gecko wrote: > Is array, string, and data all the same as new or are those autorelease? These classes all inherit from NSObject, so unless they override and change the behavior of "+new" (hint: They don't, that would be crazy) their behavior would have to be the s

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Dave Keck
> OK, seems to be that way. So how do I do that from within my app? I tried setenv("NSZombieEnabled", "YES", 1 ) but that didn't seem to work. Proof of concept, needs to be cleaned up. Appears to work as expected, though: = uint32_t maxLen = 0x400; char *executablePath = malloc(maxLen); FSRe

Re: NSDatePicker 24 hour clock

2010-01-09 Thread Sean McBride
Daniel Wambold (wambo...@gmail.com) on 2010-01-09 18:37 said: >I changed the Apple Menu > System Preferences > Date & Time > Use a 24- >hour clock setting. In the "Clock" tab? If so, that setting applies only to the menu bar clock (why it can't just use the system setting is beyond me.) NSDatePi

NSAffineTransform

2010-01-09 Thread Eric Smith
I have the following code: CIFilter* vertFlipFilter = [CIFilter filterWithName: @"CIAffineTransform"]; NSAffineTransform* vertFlipTransform = [NSAffineTransform transform]; CIImage* theImage = [[CIImage alloc] initWithCGImage:imageOne]; [vertFlipTransform translateXBy:100. yBy:1000]; [vertFlipFi

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Mr. Gecko
So I do not own the object when I get it from string, but I do when I get it from new and that means that I have to release it. So according to that, this code shouldn't leak, right? NSMutableString *string = [NSMutableString string]; if (http) { [string appendString:@"http://";]; } else {

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Graham Cox
On 10/01/2010, at 1:27 PM, Mr. Gecko wrote: > So I do not own the object when I get it from string, but I do when I get it > from new and that means that I have to release it. > So according to that, this code shouldn't leak, right? > NSMutableString *string = [NSMutableString string]; > if (htt

Re: if statement causing 32 Byte leak?

2010-01-09 Thread mmalc Crawford
On Jan 9, 2010, at 6:34 pm, Graham Cox wrote: > 'string' does not contain 'new', 'alloc' or 'copy' therefore you do not own > it. > That summary is just very subtly wrong(*), which is why people are generally discouraged from paraphrasing the rules. That said, there is indeed really very littl

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Mr. Gecko
Ok, thanks for the help, now I'm going to have to fix all my applications to work like that ;) On Jan 9, 2010, at 8:34 PM, Graham Cox wrote: > > On 10/01/2010, at 1:27 PM, Mr. Gecko wrote: > >> So I do not own the object when I get it from string, but I do when I get it >> from new and that m

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Graham Cox
On 10/01/2010, at 1:47 PM, mmalc Crawford wrote: >> 'string' does not contain 'new', 'alloc' or 'copy' therefore you do not own >> it. >> > That summary is just very subtly wrong(*), which is why people are generally > discouraged from paraphrasing the rules. > That said, there is indeed reall

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Graham Cox
On 10/01/2010, at 1:12 PM, Dave Keck wrote: > > OK, seems to be that way. So how do I do that from within my app? I tried > > setenv("NSZombieEnabled", "YES", 1 ) but that didn't seem to work. > > Proof of concept, needs to be cleaned up. Appears to work as expected, though: Thanks Dave, that

NSURLConnection POST issues

2010-01-09 Thread Damien Cooke
Hi All, I have a solution for this problem that I am not at all happy with. I have appended all of my html form variables into a single variable using ||| as the field separators. This is a rubbish solution. I am looking for a more elegant solution that is less like a dodgy hack. Here is the

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Dave Keck
> Thanks Dave, that's just what I need. I changed it slightly to use > [[[NSBundle mainBundle] executablePath] UTF8String] Ah, of course - that method slipped my mind. I'm not sure if there's ever a scenario where you would want to use _NSGEP over the NSBundle method... __

Re: NSURLConnection POST issues

2010-01-09 Thread Jason Foreman
On Jan 9, 2010, at 9:31 PM, Damien Cooke wrote: > here is my code to send this data > > [appendedData appendData:[[[NSString > stringWithFormat:@"ProdName=%@",[self applicationName]] > stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding] > dataUsingEncoding:NSASCIIStringEn

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Jim Correia
On Jan 9, 2010, at 7:54 PM, Graham Cox wrote: > I'm getting something odd though. If I set NSZombieEnabled during app > delegate -applicationDidFinishLaunching: method from my preference, a later > deliberate over-release still causes a EXC_BAD_ACCESS. If I set it as an > environment variable (

Re: NSURLConnection POST issues

2010-01-09 Thread Damien Cooke
Thanks Jason, I knew it would be simple. Thank you so much. Regards Damien On 10/01/2010, at 2:35 PM, Jason Foreman wrote: > > On Jan 9, 2010, at 9:31 PM, Damien Cooke wrote: > >> here is my code to send this data >> > >> [appendedData appendData:[[[NSString >> stringWithFormat:@"Prod

[self frame].size.width reporting incorrectly

2010-01-09 Thread PCWiz
I'm using NSLog(@"%f", [self frame].size.width); from within my NSTextField subclass to check the width of the text field (pretty standard stuff). But for some reason, its reporting incorrectly. See this video to see what I mean: http://img191.imageshack.us/img191/2460/screenflow.mp4 I have it

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Ron Fleckner
On 10/01/2010, at 3:46 PM, Jim Correia wrote: On Jan 9, 2010, at 7:54 PM, Graham Cox wrote: I'm getting something odd though. If I set NSZombieEnabled during app delegate -applicationDidFinishLaunching: method from my preference, a later deliberate over-release still causes a EXC_BAD_ACC

Re: [self frame].size.width reporting incorrectly

2010-01-09 Thread Joar Wingfors
On 9 jan 2010, at 21.21, PCWiz wrote: > I'm using NSLog(@"%f", [self frame].size.width); from within my NSTextField > subclass to check the width of the text field (pretty standard stuff). But > for some reason, its reporting incorrectly. Are you sure that you're logging the width of the corr

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Stephen J. Butler
On Sat, Jan 9, 2010 at 11:49 PM, Ron Fleckner wrote: > Hmm... I'm interested in this.  But how can code be executed before main() > gets control?  Isn't main() the first thing that gets called?  Or would it > be in a helper app which sets your target app's environment variables? Plenty of things.

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Dave Keck
> Hmm... I'm interested in this.  But how can code be executed before main() > gets control?  Isn't main() the first thing that gets called?  Or would it > be in a helper app which sets your target app's environment variables? See the docs for +load for some ideas: http://developer.apple.com/mac/

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Ron Fleckner
On 10/01/2010, at 5:17 PM, Dave Keck wrote: Hmm... I'm interested in this. But how can code be executed before main() gets control? Isn't main() the first thing that gets called? Or would it be in a helper app which sets your target app's environment variables? See the docs for +load

Re: Enabling NSZombieEnabled programatically

2010-01-09 Thread Stephen J. Butler
On Sun, Jan 10, 2010 at 12:36 AM, Ron Fleckner wrote: > OK, thanks Dave and Stephen.  I think I'll have to find some documentation > which lists the order of function calls at app startup, though, because the > documentation for +load doesn't specifically say anything about app startup, > just cla

Re: What gets automatically localized?

2010-01-09 Thread John Joyce
On Jan 7, 2010, at 12:36 AM, cocoa-dev-requ...@lists.apple.com wrote: > Subject: Re: What gets automatically localized? > To: Cocoa Developers > Message-ID: > Content-Type: text/plain; charset=windows-1252 > > > On 2010 Jan 05, at 14:11, Dave DeLong wrote: > >> I'm working on localizing an a