Re: BarView won't run

2010-05-18 Thread Reinhard Segeler
I've checked your project with 10.5. I have deleted the class Bar View in IB, you don't need it there. Connected the slider to the action-method of the BarView-view in the window. There is no protocol so I commented it out, maybe it's defferent in 10.6 In IB I disconnected all broken c

Re: Style Advice for using NSEnumerator

2010-05-18 Thread Carlton Gibson
On 17 May 2010, at 20:57, Quincey Morris wrote: > What's wrong with the direct approach? The best enumerator is no enumerator > (written in Mail): > >> NSArray *strokeColors = [NSArray arrayWithObjects: >> [UIColor redColor], [UIColor orangeColor, [UIColor yellowColor], [UIColor >> greenColo

Specify "Sent Action on" Behavior of NSTextField

2010-05-18 Thread Dong Feng
There is a option on IB to specify if an NSTextField "Sent Action on Enter Only" or "Sent Action on Editing." How to set the option programmatically? Thanks, Dong ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

RE: My program causes MacBook Pro to use NVidia graphics

2010-05-18 Thread Keith Blount
Interesting - I only just came across this thread, but one of my users reported exactly the same thing a few weeks back. As the user just left the comment via Twitter and I never received anything else, until I saw this thread it had gone on my curious-must-look-at-that-in-the-future list. The s

Re: My program causes MacBook Pro to use NVidia graphics

2010-05-18 Thread Gideon King
I'm the one who started the thread, and it's the same for me - my program doesn't explicitly link against those libraries, but something somewhere obviously does. The first I knew about it was when a customer queried it, asserting that it was shortening his battery life on his laptop. Seeing a

Re: Why I can't see my localized nib?

2010-05-18 Thread Reinhard Segeler
In a test app I ran into the same problem. That changed after I connected the menu command orderFrontStandardAboutPanel: - by default connected via the File's Owner - to the overridden method in my class. -- Reinhard Am 16.05.2010 um 13:06 schrieb Gustavo Pizano: Hello all. I was t

baseURL problem with +fileURLWithPath:

2010-05-18 Thread Robert Monaghan
Hi Everyone.. I am loosing my mind with NSURL's initFileURLWithPath. (Trying to build a 10.5 app.. btw) If I create a NSURL object with a local file path, everything looks as it should, when stepping through the code with the debugger. However, when I use "[myURL path]" in my code, I get a path

Re: My program causes MacBook Pro to use NVidia graphics

2010-05-18 Thread Keith Blount
Hi Gideon, Thanks for the reply and the update. I don't think I'm going to spend time worrying about it for now either given that it's not something I am doing directly. I have exactly the same situation as you, where my app has linked against the same libraries for two or three years and has b

Re: Regarding MVC design pattern

2010-05-18 Thread Sai
Hi, Sorry I haven't given full details. I just found where the exc_bad_access signal comes from. I have a controller object and a model object, both are created in the interface builder. So I suppose they are stored in the XIB document. That's why they are initialized automatically as you guys men

Re: Why I can't see my localized nib?

2010-05-18 Thread Joanna Carter
Hi Gustavo > I dunno about that.. I was just selecting French from the pop up list when I > clicked the "Make localizable" button under info of the xib file, and then I > put in the first position of the lang list under system preferences French > language... re build re run and nothing, I logo

Re: baseURL problem with +fileURLWithPath:

2010-05-18 Thread Mike Abdullah
Show us some code. On 18 May 2010, at 09:49, Robert Monaghan wrote: > Hi Everyone.. > > I am loosing my mind with NSURL's initFileURLWithPath. (Trying to build a > 10.5 app.. btw) > > If I create a NSURL object with a local file path, everything looks as it > should, when stepping through the

Re: Regarding MVC design pattern

2010-05-18 Thread Joanna Carter
Hi Sal > However, I declare a NSDictionary instance variable in my model object. This > NSDictionary instance > store some data I need. And I will create this NSDictionary instance by > invoking: > [NSDictionary dictionaryWithObjects:names forKeys:keys] > Both names and keys are string NSArray. I

Re: Specify "Sent Action on" Behavior of NSTextField

2010-05-18 Thread René v Amerongen
In IB, move with the mouse over the popup item. Op 18 mei 2010, om 10:21 heeft Dong Feng het volgende geschreven: > There is a option on IB to specify if an NSTextField "Sent Action on > Enter Only" or "Sent Action on Editing." How to set the option > programmatically? > > Thanks, > Dong > _

Re: Regarding MVC design pattern

2010-05-18 Thread Alexander Spohr
Am 18.05.2010 um 12:40 schrieb Sai: > Unfortunately, when I try to get value from that NSDictionary, I will get > exc_bad_access signal, and I follow gdb, the NSDictionary instance seems to > be corrupted. > So where does it go wrong? Hopefully I state things clearly this time. Thank > you all.

Re: Regarding MVC design pattern

2010-05-18 Thread Jack Nutting
On Tue, May 18, 2010 at 12:40 PM, Sai wrote: > However, I declare a NSDictionary instance variable in my model object. This > NSDictionary instance > store some data I need. And I will create this NSDictionary instance by > invoking: > [NSDictionary dictionaryWithObjects:names forKeys:keys] Are y

Re: Regarding MVC design pattern

2010-05-18 Thread Sai
Hi all, Thanks for your reply. I didn't retain that, I will try that as soon as I get home. Anyway, why I should retain that? Will it be released by "somebody"? Can anyone tell me the whole process and what's going on please? I want to know what happened. Thanks a lot. On Tue, May 18, 2010 at 7:0

Re: baseURL problem with +fileURLWithPath:

2010-05-18 Thread Robert Monaghan
Hi Mike, This is pretty trivial.. I have a string that is coming from an FCP XML file. The string looks like this: file:/localhost/Users/bob/Movies/ARRI/ELAP/shot_1_2/Imagery/Proxies/DMAG001_1_2_TAKE_005_RAWPROXY720P.mov I then pass the string to an NSURL object using: (Yes, I know I can do a "

Re: baseURL problem with +fileURLWithPath:

2010-05-18 Thread Volker in Lists
Robert, when/where do you call [url path]? It may be released at that moment and thus display garbage! What happens if you omit the call to autorelease when creating url ? Volker Am 18.05.2010 um 13:52 schrieb Robert Monaghan: > Hi Mike, > > This is pretty trivial.. I have a string that is c

Re: baseURL problem with +fileURLWithPath:

2010-05-18 Thread Robert Monaghan
Immediately after the NSURL object is created. (so there is no danger of being released.) bob. On May 18, 2010, at 2:03 PM, Volker in Lists wrote: > Robert, > > when/where do you call [url path]? It may be released at that moment and thus > display garbage! What happens if you omit the call to

Re: baseURL problem with +fileURLWithPath:

2010-05-18 Thread Abhinay Kartik Reddyreddy
On May 18, 2010, at 7:52 AM, Robert Monaghan wrote: > Hi Mike, > > This is pretty trivial.. I have a string that is coming from an FCP XML file. > The string looks like this: > file:/localhost/Users/bob/Movies/ARRI/ELAP/shot_1_2/Imagery/Proxies/DMAG001_1_2_TAKE_005_RAWPROXY720P.mov > > I then

Re: baseURL problem with +fileURLWithPath:

2010-05-18 Thread Robert Monaghan
The path from [[pathurlArray objectAtIndex:0] stringValue] is going into the NSURL properly. This doesn't appear to be a problem with retaining the source NSArray object. The base URL, however is being populated with the path to my binary. I am trying to figure out how to set the baseURL to nil.

Re: Why I can't see my localized nib?

2010-05-18 Thread Gustavo Pizano
Joanna Hello. Ok I tried again with French lang, run it and din't work, clean target and rerun and it worked.. Now I made for sk_SK lang same procedure as before, (changing the lang of the system) and it didn't work. I took the codes from the ISO docs and when I open the xib of slovak lang it s

Re: Why I can't see my localized nib?

2010-05-18 Thread Joanna Carter
Hi Gustavo > Ok I tried again with French lang, run it and din't work, clean target and > rerun and it worked.. Now I made for sk_SK lang same procedure as before, > (changing the lang of the system) and it didn't work. I took the codes from > the ISO docs and when I open the xib of slovak lang

Re: (solved?) baseURL problem with +fileURLWithPath:

2010-05-18 Thread Robert Monaghan
Ok, I am doing this now, which *seems* to work. NSURL *url = [NSURL URLWithString:[[pathurlArray objectAtIndex:0] stringValue] relativeToURL:nil]; bob.. On May 18, 2010, at 2:20 PM, Robert Monaghan wrote: > The path from [[pathurlArray objectAtIndex:0] stringValue] is going into the > NSURL

Re: baseURL problem with +fileURLWithPath:

2010-05-18 Thread Joar Wingfors
On 18 maj 2010, at 04.52, Robert Monaghan wrote: > This is pretty trivial.. I have a string that is coming from an FCP XML file. > The string looks like this: > file:/localhost/Users/bob/Movies/ARRI/ELAP/shot_1_2/Imagery/Proxies/DMAG001_1_2_TAKE_005_RAWPROXY720P.mov > > I then pass the string t

Programmatic Binding

2010-05-18 Thread Richard Somers
I have an issue that has me absolutely stumped. I have a custom view using a custom layer. When 'bind:toObject:withKeyPath:options:' is called after 'setView' the binding works. When it is called before 'setView' the binding does not work. // MyCustomView (this version works) - (void)awakeF

Re: Blog post announcements

2010-05-18 Thread Bill Hernandez
On May 18, 2010, at 1:09 AM, Scott Anguish wrote: > Hi Bill > > I moderate the cocoa-dev list. I’m hoping you could do be a favor. Can you > pace yourself a bit on announcing your blog posts? Perhaps collect a few and > post them once a week? > > I’ve had a few people poke me about it. I don’

Cancelling a loading loop in order to load something else

2010-05-18 Thread Keith Blount
Hi, I'm having problems getting my head around something that is probably fairly basic, but I can't find any obvious examples to give me the clue I need (no doubt because I'm using the wrong search terms). Essentially I need to add to my app the ability for the user to cancel what could potenti

Re: Programmatic Binding

2010-05-18 Thread Richard Somers
On May 18, 2010, at 8:17 AM, Richard Somers wrote: I have an issue that has me absolutely stumped. Correction and additional information. MyCustomOpenGLLayer should be MyCustomLayer. MyCustomLayer does not implement 'bind:toObject:withKeyPath:options:' so the standard framework version of

Re: My program causes MacBook Pro to use NVidia graphics processor

2010-05-18 Thread Michael Diehr
On May 17, 2010, at 6:41 PM, Dave Keck wrote: > The user's Energy Saver settings affects which card is used (better > battery life vs. higher performance.) Not sure if that helps you > though, since changing the value on my system requires logging out. According to this: http://codykrieger.com

Re: Why I can't see my localized nib?

2010-05-18 Thread Joanna Carter
Hi Gustavo > Joanna hello. here is the app. I cannot get the Slovak localisation to work either. But, then I read that the localisation is not included in Snow Leopard by default and I don't want to have to buy the licence for it. Sorry about that. Joanna -- Joanna Carter Carter Consulting

Re: Why I can't see my localized nib?

2010-05-18 Thread Gustavo Pizano
No problem... In this case.. is tehre anyway to let teh user choose what lang to use?.. I mean if I localize my app, but the user has no localization either, how to make the app run in a given language (i.e sk)? G. PS: thanks for the help tough On 18.5.2010, at 17:46, Joanna Carter wrote: > H

Re: Programmatic Binding

2010-05-18 Thread Quincey Morris
On May 18, 2010, at 07:17, Richard Somers wrote: > I have an issue that has me absolutely stumped. I have a custom view using a > custom layer. When 'bind:toObject:withKeyPath:options:' is called after > 'setView' the binding works. When it is called before 'setView' the binding > does not work

Re: My program causes MacBook Pro to use NVidia graphics

2010-05-18 Thread Nick Zitzmann
On May 18, 2010, at 3:28 AM, Keith Blount wrote: > I'm not explicitly linking against the OpenGL framework, though - does this > mean that another framework I am linking against is invoking it? (I link > against the QuickLook, AddressBook, Carbon, QTKit, > QuickTime, Quartz, QuartzCore, WebKit

Re: Programmatic Binding

2010-05-18 Thread Chaitanya Pandit
Are you exposing the binding first? + (void)exposeBinding:(NSString *)binding Thanks, Chaitanya Pandit Chief Architect Expersis Software Inc. On May 18, 2010, at 7:47 PM, Richard Somers wrote: > I have an issue that has me absolutely stumped. I have a custom view using a > custom layer. When

Re: Regarding MVC design pattern

2010-05-18 Thread Kyle Sluder
On May 18, 2010, at 4:20 AM, Sai wrote: Hi all, Thanks for your reply. I didn't retain that, I will try that as soon as I get home. Anyway, why I should retain that? Will it be released by "somebody"? Re-read the Memory Management Programming Guide until you know the rules backwards and

Re: Why I can't see my localized nib?

2010-05-18 Thread Joanna Carter
Hi Gustavo > In this case.. is tehre anyway to let teh user choose what lang to use?.. I > mean if I localize my app, but the user has no localization either, how to > make the app run in a given language (i.e sk)? The only way I can think of is to delete the other localizations from the bundl

Re: Programmatic Binding

2010-05-18 Thread Kyle Sluder
On May 18, 2010, at 9:21 AM, Chaitanya Pandit wrote: Are you exposing the binding first? This is completely unnecessary. --Kyle Sluder + (void)exposeBinding:(NSString *)binding Thanks, Chaitanya Pandit Chief Architect Expersis Software Inc. On May 18, 2010, at 7:47 PM, Richard Somers

Re: Regarding MVC design pattern

2010-05-18 Thread Uli Kusterer
On May 18, 2010, at 1:20 PM, Sai wrote: > Anyway, why I should retain that? Because otherwise it will get autoreleased, but your instance variable will still contain its address, and the next time you try to use it via the instance variable, you will try to talk with random memory at that addre

Re: Cancelling a loading loop in order to load something else

2010-05-18 Thread Kyle Sluder
On May 18, 2010, at 8:07 AM, Keith Blount wrote: Should I forge ahead with trying to get a modal session working for this, or is there a better solution I'm missing? Perform the loading asynchronously or on a background thread. With 10.6, you could enqueue a block on a background queue for

Notifications on main thread

2010-05-18 Thread Jonny Taylor
Hi all, I have been programming on the mac for many years but have only just started trying to get the hang of cocoa. I have a particular question about NSNotification that I hope somebody will be able to help with. My code works with a firewire video camera, and receives callbacks from the ca

Re: Notifications on main thread

2010-05-18 Thread Nick Zitzmann
On May 18, 2010, at 8:34 AM, Jonny Taylor wrote: > - I could try acquiring the NSNotificationQueue for the main thread, but > there does not appear to be a standard way of doing that. I have seen this > suggested as a strategy elsewhere, but I think I have also read that one is > not meant to

Re: My program causes MacBook Pro to use NVidia graphics

2010-05-18 Thread Keith Blount
Hi Nick, many thanks for the clarification. That explains the OpenGL inclusion then, as I include Quartz for the PDFKit. Thanks again and all the best, Keith P.S. Apologies as I think I may have previously sent a blank reply. - Original Message From: Nick Zitzmann To: Keith Blount Cc

Re: My program causes MacBook Pro to use NVidia graphics processor

2010-05-18 Thread Michael Diehr
On May 17, 2010, at 6:26 PM, Michael Diehr wrote: > Update: it appears as if instantiating a dummy NSOpenGLView in my master > process helps the issue. > > I'm not clear whether I actually need to go so far as to create the > NSOpenGLView and add it as a subview, or if simply linking with the O

Re: Notifications on main thread

2010-05-18 Thread Michael Ash
On Tue, May 18, 2010 at 12:58 PM, Nick Zitzmann wrote: > > On May 18, 2010, at 8:34 AM, Jonny Taylor wrote: > >> - I could try acquiring the NSNotificationQueue for the main thread, but >> there does not appear to be a standard way of doing that. I have seen this >> suggested as a strategy elsew

Re: (solved?) baseURL problem with +fileURLWithPath:

2010-05-18 Thread Tony Romano
First, the first 2 characters need to be // and not / for it to be a valid resource specifier. The 10.6 Overview states it will fail to create a NSURL. Look at the class reference. Why the base is set to your binary maybe just a bug in 10.5. So you don't go nuts, just temp fix the string and

Re: Notifications on main thread

2010-05-18 Thread Jean-Daniel Dupas
Le 18 mai 2010 à 16:34, Jonny Taylor a écrit : > Hi all, > > I have been programming on the mac for many years but have only just started > trying to get the hang of cocoa. I have a particular question about > NSNotification that I hope somebody will be able to help with. > > My code works wi

Re: Cancelling a loading loop in order to load something else

2010-05-18 Thread Keith Blount
Hi Kyle, Many thanks for your reply, much appreciated. I guess it's finally time to get my hands dirty and learn how to use threads properly, then. :) (Although I was under the impression that working with NSAttributedStrings wasn't thread-safe according to other mail list postings. I could be

Detecting modifier key down when opening a menu?

2010-05-18 Thread Laurent Daudelin
What's the best way to detect if a modifier key is held down when the user click to open a menu? -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin http://nemesys.dyndns.org Logiciels Nemesys Software laure

Re: (solved?) baseURL problem with +fileURLWithPath:

2010-05-18 Thread John Joyce
On May 18, 2010, at 12:39 PM, cocoa-dev-requ...@lists.apple.com wrote: > Content-Type: text/plain; charset=us-ascii > > First, the first 2 characters need to be // and not / for it to be a valid > resource specifier. The 10.6 Overview states it will fail to create a NSURL. > Look at the clas

Re: Detecting modifier key down when opening a menu?

2010-05-18 Thread Nick Zitzmann
On May 18, 2010, at 11:38 AM, Laurent Daudelin wrote: > What's the best way to detect if a modifier key is held down when the user > click to open a menu? [[NSApp currentEvent] modifierFlags] ought to work... Nick Zitzmann _

Re: (solved?) baseURL problem with +fileURLWithPath:

2010-05-18 Thread Robert Monaghan
Interesting.. The source of this path is from Final Cut Pro. I can't say how they come up with the path. I will ping some people and find out. bob. On May 18, 2010, at 8:01 PM, John Joyce wrote: > > On May 18, 2010, at 12:39 PM, cocoa-dev-requ...@lists.apple.com wrote: > >> Content-Type: text

Re: Detecting modifier key down when opening a menu?

2010-05-18 Thread Laurent Daudelin
On May 18, 2010, at 10:59, Nick Zitzmann wrote: > > On May 18, 2010, at 11:38 AM, Laurent Daudelin wrote: > >> What's the best way to detect if a modifier key is held down when the user >> click to open a menu? > > [[NSApp currentEvent] modifierFlags] ought to work... > > Nick Zitzmann >

Re: Detecting modifier key down when opening a menu?

2010-05-18 Thread Eric Schlegel
On May 18, 2010, at 11:35 AM, Laurent Daudelin wrote: > Thanks, Nick. That works. But now I realize I would need something a little > more dynamic. I see that NSResponder has "flagsChanged:" when a modifier flag > changes but since NSMenu is not a subclass of NSResponder, I'm not sure how > to

[iPhone] How to add a text field like that scales with return key like in iPhone Messages

2010-05-18 Thread Tharindu Madushanka
Hi, I want to add a text field that will scale down when user presses the Return key. mean time the background view will scale up same as how Messages iPhone application do it. I have currently only a single line text field, on which when i type more the font size gets decreased. Could someone gi

Re: Programmatic Binding

2010-05-18 Thread Richard Somers
On May 18, 2010, at 10:04 AM, Quincey Morris wrote: What is foo? What does "not work" mean? Foo is an int. Does not work means foo is never updated with the value in the user defaults. On May 18, 2010, at 10:21 AM, Chaitanya Pandit wrote: Are you exposing the binding first? No, but I

Re: Detecting modifier key down when opening a menu?

2010-05-18 Thread Laurent Daudelin
On May 18, 2010, at 11:57, Eric Schlegel wrote: > > On May 18, 2010, at 11:35 AM, Laurent Daudelin wrote: > >> Thanks, Nick. That works. But now I realize I would need something a little >> more dynamic. I see that NSResponder has "flagsChanged:" when a modifier >> flag changes but since NSMen

Re: Detecting modifier key down when opening a menu?

2010-05-18 Thread Eric Schlegel
On May 18, 2010, at 12:05 PM, Laurent Daudelin wrote: > Well, I'd like to track the option key down when a menu is opened so that I > can change one of the menu item title dynamically. I was hoping you'd say that. :) NSMenuItem already has built-in support for this. What you need to do is crea

Re: Detecting modifier key down when opening a menu?

2010-05-18 Thread Dave DeLong
Sounds to me like you want to investigate NSMenuItem's setAlternate: method. I answered a StackOverflow question about this recently, so I'll just link to that post instead of typing everything again. :) http://stackoverflow.com/questions/2808016#2808168 Cheers, Dave On May 18, 2010, at 1:05

Re: Why I can't see my localized nib?

2010-05-18 Thread Frédéric Testuz
Le 18 mai 2010 à 18:28, Joanna Carter a écrit : > Hi Gustavo > >> In this case.. is tehre anyway to let teh user choose what lang to use?.. I >> mean if I localize my app, but the user has no localization either, how to >> make the app run in a given language (i.e sk)? > > The only way I can t

Re: Detecting modifier key down when opening a menu?

2010-05-18 Thread Laurent Daudelin
On May 18, 2010, at 12:07, Eric Schlegel wrote: > > On May 18, 2010, at 12:05 PM, Laurent Daudelin wrote: > >> Well, I'd like to track the option key down when a menu is opened so that I >> can change one of the menu item title dynamically. > > I was hoping you'd say that. :) NSMenuItem alread

NSTask and piped commands

2010-05-18 Thread appledev
I have to run the following and similar commands using NSTask. df -k | grep /dev/ |awk '{print $1 "\t" $4 "\t" $5 "\t" $6;}' I got so far. NSTask *task; task = [[NSTask alloc] init]; [task setLaunchPath: @"/bin/sh"]; NSArray *arguments; arguments = [NSArray arrayWit

Re: NSTask and piped commands

2010-05-18 Thread Rick Genter
On May 18, 2010, at 12:33 PM, appledev wrote: > I have to run the following and similar commands using NSTask. > > df -k | grep /dev/ |awk '{print $1 "\t" $4 "\t" $5 "\t" $6;}' > > I got so far. > > NSTask *task; >task = [[NSTask alloc] init]; >[task setLaunchPath: @"/bin/sh"]; >

Re: Detecting modifier key down when opening a menu?

2010-05-18 Thread Eric Schlegel
On May 18, 2010, at 12:30 PM, Laurent Daudelin wrote: > Wow! I was not aware of that! Is that supported on 10.5 too? From NSMenuItem.h: #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 - (void)setAlternate:(BOOL)isAlternate; - (BOOL)isAlternate; #endif -eric

Re: Programmatic Binding

2010-05-18 Thread Quincey Morris
On May 18, 2010, at 12:02, Richard Somers wrote: > Foo is an int. If you want an answer, you're going to have to be a bit more forthcoming with information. Is "foo" an instance variable or a property? If instance variable, what's the value of accessInstanceVariablesDirectly for its class? If

Re: NSTask and piped commands

2010-05-18 Thread Stephen J. Butler
On Tue, May 18, 2010 at 2:33 PM, appledev wrote: > I dont want to use a call to a bash script, because of sneaking in bad > commands. > But how should I handle this? That's only a real concern when you put user supplied data into the command you're running. But I don't see you doing that here...

Re: NSTask and piped commands

2010-05-18 Thread Stephen J. Butler
On Tue, May 18, 2010 at 2:37 PM, Rick Genter wrote: > On May 18, 2010, at 12:33 PM, appledev wrote: > >>    NSArray *arguments; >>    arguments = [NSArray arrayWithObjects: @"-c", @"/bin/df -k| /usr/bin/grep >> /dev/ | /usr/bin/awk '{print $1 $4 $5 $6;}'",nil]; >>       // arguments = [NSArray ar

Re: Why I can't see my localized nib?

2010-05-18 Thread Joanna Carter
Hi Frédéric > You can launch the application with AppleLanguages in the arguments or in the > app defaults. > > See : > > > > and > >

Re: NSTask and piped commands

2010-05-18 Thread Jens Alfke
On May 18, 2010, at 12:33 PM, appledev wrote: > I dont want to use a call to a bash script, because of sneaking in bad > commands. As others said, it’s not a problem here because the command line is entirely hardcoded. If you wanted to avoid using a shell, you’d have to start three separate

Re: NSTask and piped commands

2010-05-18 Thread Alastair Houghton
On 18 May 2010, at 20:48, Stephen J. Butler wrote: > On Tue, May 18, 2010 at 2:33 PM, appledev wrote: >> I dont want to use a call to a bash script, because of sneaking in bad >> commands. >> But how should I handle this? > > That's only a real concern when you put user supplied data into the >

Re: NSTask and piped commands

2010-05-18 Thread Alastair Houghton
On 18 May 2010, at 21:13, Jens Alfke wrote: > > On May 18, 2010, at 12:33 PM, appledev wrote: > >> I dont want to use a call to a bash script, because of sneaking in bad >> commands. > > As others said, it’s not a problem here because the command line is entirely > hardcoded. > > If you want

Re: NSTask and piped commands

2010-05-18 Thread Alastair Houghton
On 18 May 2010, at 20:33, appledev wrote: >[task launch]; > >[task waitUntilExit]; > >NSData *data; >result = [file readDataToEndOfFile]; This part is not safe. If the tasks output enough data to fill the pipe buffer (which may be of whatever size the kernel chooses to m

Re: NSTask and piped commands

2010-05-18 Thread Jens Alfke
On May 18, 2010, at 1:27 PM, Alastair Houghton wrote: > Something like the following should work, right? That looks right; but you’re proving my point that it’s easier just to do the filtering in native code :) —Jens___ Cocoa-dev mailing list (Cocoa

Re: NSTask and piped commands

2010-05-18 Thread Alastair Houghton
On 18 May 2010, at 21:35, Jens Alfke wrote: > On May 18, 2010, at 1:27 PM, Alastair Houghton wrote: > >> Something like the following should work, right? > > That looks right; but you’re proving my point that it’s easier just to do the > filtering in native code :) Well, there is that too :-)

Re: Why I can't see my localized nib?

2010-05-18 Thread Gustavo Pizano
So at app start up I can get the Application defaults objectforkey "AppleLanguages", then set array with the first object to be "sk_SK" and then push the array again back to the application defaults.. right? And if the user selects for example English I must do the above, and restart the applic

NSKeyedArchiver: confusion

2010-05-18 Thread Matthew Weinstein
Dear Cocoa-dev, I'm trying to use a keyed archiver to manipulate a file without actually opening it. Everything seems fine at first: I get the data, I copy it into a NSMutableData object, I init a NSKeyedUnarchiver and get the data I need; I create a new object with the old data (an array of dic

Re: NSKeyedArchiver: confusion

2010-05-18 Thread Jens Alfke
On May 18, 2010, at 1:40 PM, Matthew Weinstein wrote: > The problem: The old @"codedDataArray" is not replaced! When I open the file > the old junk is all there. The old array is not discarded and replaced with > the new (myRecs) array. So I cannot use NSKeyedArchiver like an > NSMutableDictio

Re: NSKeyedArchiver: confusion

2010-05-18 Thread Matthew Weinstein
My mistake for not being clear: I have an NSData in an object; I read that data using a keyedArchiver to get to the chunk I want. I want to replace a chunk of that data with another using the same key. (the file part is immaterial). On May 18, 2010, at 2:10 PM, Jens Alfke wrote: > > On May 1

Re: NSKeyedArchiver: confusion

2010-05-18 Thread Jeff Kelley
Right, but in your original e-mail, you said, "When I open the file the old junk is all there." If you want the data to be in the file then you'll need to save it to the file. When you create the NSMutableData object, it's copied out of the file and into memory; you are not operating directly o

Re: iPad interface orientation basics

2010-05-18 Thread David Duncan
On May 17, 2010, at 8:58 AM, sebi wrote: > I have a ViewController with a view. In that view there is an UIImageView > background subview. Now, when I rotate the device I want to switch the image > of the UIImageview so it fills the view again without being distorted. The > only working method

Re: NSKeyedArchiver: confusion

2010-05-18 Thread Michael Ash
On Tue, May 18, 2010 at 5:21 PM, Matthew Weinstein wrote: > My mistake for not being clear: > I have an NSData in an object; > I read that data using a keyedArchiver to get to the chunk I want. > > I want to replace a chunk of that data with another using the same key. (the > file part is immater

Re: NSKeyedArchiver: confusion

2010-05-18 Thread Jens Alfke
On May 18, 2010, at 2:32 PM, Michael Ash wrote: > If you need incremental modifications, you'll need to use some other > storage/serialization strategy, such as SQLite or CoreData. You can fake it by using an archive whose root object is a mutable dictionary. Then you can read the archive, keep

Re: NSTask and piped commands

2010-05-18 Thread René v Amerongen
Sorry for the late reaction. I did check every ten minutes Cocoabuilder and sometimes my mail, but I see that there where all ready replies before I got my own posting. Op 18 mei 2010, om 22:13 heeft Jens Alfke het volgende geschreven: >> I dont want to use a call to a bash script, because of

Re: NSTask and piped commands

2010-05-18 Thread René v Amerongen
Thanks for this. Your right about this idea. I will check it out. René Op 18 mei 2010, om 22:34 heeft Alastair Houghton het volgende geschreven: > On 18 May 2010, at 20:33, appledev wrote: > >> [task launch]; >> >> [task waitUntilExit]; >> >> NSData *data; >> result = [file read

Re: NSTask and piped commands

2010-05-18 Thread Jens Alfke
On May 18, 2010, at 3:04 PM, René v Amerongen wrote: > Maybe just an imagination from me, but it looks slow all that moving of > results to the next task. But that’s exactly what the shell does! The “|” operator spawns a process for each side and hooks the output of the first to the input of t

Re: Programmatic Binding

2010-05-18 Thread Richard Somers
On May 18, 2010, at 1:40 PM, Quincey Morris wrote: If you want an answer, you're going to have to be a bit more forthcoming with information. Is "foo" an instance variable or a property? If instance variable, what's the value of accessInstanceVariablesDirectly for its class? If a propert

Re: SETUP : Regular Expressions - Easy Setup for RegexKitLite

2010-05-18 Thread Scott Ribe
On May 15, 2010, at 6:02 PM, Jens Alfke wrote: > FYI, you don’t have to edit the linker flags anymore to do this. In Xcode > 3.1+ you can open the target inspector, choose the General tab, and click the > + button at the bottom left to pop up a list of available libraries. Then > choose “libicu

Re: NSTask and piped commands

2010-05-18 Thread René v Amerongen
Op 18 mei 2010, om 21:48 heeft Stephen J. Butler het volgende geschreven: >> > > Depending on what information you need, I'd use [NSWorkspace > mountedLocalVolumePaths] and then [NSFileManager > attributesOfFileSystemForPath:error:]. > Didn't have NSWorkspace some bugs with giving the right in

singleton design pattern

2010-05-18 Thread Alejandro Marcos Aragón
Hi all, I've been staring at this piece of code now to try to find out what's wrong with it and I can't think of anything at this point. I'm trying to have a single instance of an NSMutableDictionary inside a class: // in .h file @interface ClassA : NSObject { } + (NSMutableDictiona

Re: singleton design pattern

2010-05-18 Thread Mike Abdullah
On 18 May 2010, at 23:28, Alejandro Marcos Aragón wrote: > Hi all, > > I've been staring at this piece of code now to try to find out what's wrong > with it and I can't think of anything at this point. I'm trying to have a > single instance of an NSMutableDictionary inside a class: > > > >

Re: Programmatic Binding

2010-05-18 Thread Quincey Morris
On May 18, 2010, at 15:21, Richard Somers wrote: > I have verified that the setter 'setFoo' is being called in all cases so that > is not the problem as I originally thought. > > In 'awakeFromNib' when 'bindFoo' is called before 'setView' the layer frame > is set but never actually changes to t

Re: singleton design pattern

2010-05-18 Thread Abhinay Kartik Reddyreddy
On May 18, 2010, at 6:42 PM, Mike Abdullah wrote: > > On 18 May 2010, at 23:28, Alejandro Marcos Aragón wrote: > >> Hi all, >> >> I've been staring at this piece of code now to try to find out what's wrong >> with it and I can't think of anything at this point. I'm trying to have a >> single

Get controller from nib

2010-05-18 Thread James Maxwell
Hello All, I'm working on MIDI set-up customization for my music app. I have a main controller object, called Central_MIDI_Controller, that uses the VVMIDI framework to detect MIDI ports, and handle low-level MIDI stuff. I have an object called MIDIInstrument, which is a simple wrapper-type ob

Re: Get controller from nib

2010-05-18 Thread Jens Alfke
On May 18, 2010, at 4:28 PM, James Maxwell wrote: > I know this is probably really simple, but how do I grab a reference to a > controller object loaded only in the MainMenu.nib file? You can add an outlet to your app controller object pointing to that controller object, and then add an access

Re: Get controller from nib

2010-05-18 Thread James Maxwell
okay, so I kind of hacked around it. I gave my AppController (which is a delegate of File's Owner) an outlet for the Central_MIDI_Controller, and hooked that up in IB. Then I also gave the AppController an accessor for "midiController", that returns the reference to Central_MIDI_Controller conn

Re: Get controller from nib

2010-05-18 Thread Mark Ritchie
On 18/May/2010, at 4:28 PM, James Maxwell wrote: > What I'm not understanding is how to allow newly created MIDIInstrument > objects to read the available/enabled ports from Central_MIDI_Controller. I > know this is probably really simple, but how do I grab a reference to a > controller object l

Re: Get controller from nib

2010-05-18 Thread Mark Ritchie
Hey James! On 18/May/2010, at 5:00 PM, James Maxwell wrote: > From the MIDIInstrument init, I can run [[NSApp delegate] midiController] and > get the instance of Central_MIDI_Controller loaded in the nib. As I say, it > feels a bit hackish. Though it does work, and advice is still welcome. Sure

Re: Get controller from nib

2010-05-18 Thread James Maxwell
Hey Mark, Thanks for this, but it points out one confusion i have. If I thought it would be fine to just have MIDIInstrument in the nib, everything would be simple. But my (mis)understanding was that putting the MIDIInstrument in the nib would only apply to that single instance. Is that not cor

Re: Get controller from nib

2010-05-18 Thread James Maxwell
Yes, this is basically what I've done, and it does seem to work... On 2010-05-18, at 4:49 PM, Jens Alfke wrote: > > On May 18, 2010, at 4:28 PM, James Maxwell wrote: > >> I know this is probably really simple, but how do I grab a reference to a >> controller object loaded only in the MainMenu.

Re: Get controller from nib

2010-05-18 Thread James Maxwell
ugh... Okay, getting a bit deeper into this, I realize I'm still "in the woods", so to speak. I'm going to have to hook up my NSTableView to set the *selected* port and channel for the MIDIInstruments, which means it's pretty much going to have to be loaded in the nib after all (since the MIDII

  1   2   >