Re: Outrunning the Garbage Collector

2009-05-08 Thread Marcel Weiher
Hi Jeffrey, I have a multithreaded application with several NSOperationQueues and it appears as if under heavy load conditions I'm overwhelming the garbage collector so-to-speak. From what you describe, it looks like your analysis is spot on. I essentially have three queues which can be pr

Garbage collector related crash

2009-05-08 Thread Chris Idou
I've got an object that holds onto a CF ref: mdref= MDItemCreate(nil, (CFStringRef)path); [NSMakeCollectable(mdref) autorelease]; I think I'm doing the right thing in the class declaration: @interface MetadataItem : NSObject { __strongMDItemRefmdref; @end But every now and then: CFTypeRefre

[iPhone] Grouped TableView baffling problem

2009-05-08 Thread James Lin
Hi, I have a table view with 3 grouped sections. Each section contains only one item. There is a baffling problem i don't have a clue what went wrong. if any one of the single row in any section is selected for the first time. All is well, the correct next view will get pushed without prob

Re: [iPhone] Grouped TableView baffling problem

2009-05-08 Thread Kyle Sluder
Not much of an iPhone dev, but have you checked where you are when the debugger kicks in? `where` in the the gdb console or just looking at the Debugger panel (or the status bar) will usually tell you. From the empty debug console it sounds like you're breaking on objc_exception_throw and just no

Re: ViewControllers and window nibs

2009-05-08 Thread Derek Chesterfield
On 6 May 2009, at 21:01, jonat...@mugginsoft.com wrote: See the following for hints on binding across nibs. http://homepage.mac.com/mmalc/CocoaExamples/controllers.html I have a *vaguely* similar question: In IB, is it possible to connect an object in one NIB to an outlet in another NIB? Dr

problem with NSTimer

2009-05-08 Thread Kiran Kumar S
according to documentation for beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: it says that While the application is in the run loop, it does not respond to any other events (including mouse, keyboard, or window- close events) unless they are associated with the sheet. I

Re: ViewControllers and window nibs

2009-05-08 Thread Kyle Sluder
On Fri, May 8, 2009 at 5:51 AM, Derek Chesterfield wrote: > I have a *vaguely* similar question: In IB, is it possible to connect an > object in one NIB to an outlet in another NIB? Dragging a connection in IB > across NIBs doesn't seem to work, so I suspect it is not possible?? No, it's not. >

Re: Disabling check box cells

2009-05-08 Thread Kyle Sluder
On Wed, May 6, 2009 at 1:37 AM, John Baldwin wrote: > I'm fairly new to Cocoa, and I have a table with columns bound to an > arraycontroller. I turned off the "enabled" option for the column and the > cell on the check box cell column, and it looks disabled in IB, but when I > run my application,

iPhone how to suppress phone dialer screen

2009-05-08 Thread Shraddha Karwan
Hi, I am writing an application which is in landscape mode. It dials a phone number using the "tel" protocol. While dialing the standard iPhone dialer screen pops up. Is there any means by which this screen can be suppressed? Or how can I make this screen device orientation aware? Is there any oth

Fwd: iPhone how to suppress phone dialer screen

2009-05-08 Thread Shraddha Karwan
Hi, I am writing an application which is in landscape mode. It dials a phone number using the "tel" protocol. While dialing the standard iPhone dialer screen pops up. Is there any means by which this screen can be suppressed? Or how can I make this screen device orientation aware? Is there any oth

Re: iPhone how to suppress phone dialer screen

2009-05-08 Thread Gwynne Raskind
On May 8, 2009, at 7:35 AM, Shraddha Karwan wrote: Hi, I am writing an application which is in landscape mode. It dials a phone number using the "tel" protocol. While dialing the standard iPhone dialer screen pops up. Is there any means by which this screen can be suppressed? Or how can I

Re: iPhone how to suppress phone dialer screen

2009-05-08 Thread Shraddha Karwan
On Fri, May 8, 2009 at 5:16 PM, Gwynne Raskind wrote: > Please don't suppress the standard dialer screen. As long as it remains, > the user has no doubt about what you're doing, and how to interact with the > interface. > > It would worry me if there *was* a way to suppress it. Control of the > d

Re: Custom NSImageView

2009-05-08 Thread Livio Isaia
Corbin Dunn ha scritto: On May 7, 2009, at 8:16 AM, Livio Isaia wrote: I create MyImageView (from NSImageView) which must use MyImageCell (from NSImageCell). I put MyImageView in MyWindow with Interface Builder, creating an NSImageView and setting its class to MyImageView. The cell is enc

Re: iPhone how to suppress phone dialer screen

2009-05-08 Thread glenn andreas
On May 8, 2009, at 6:59 AM, Shraddha Karwan wrote: On Fri, May 8, 2009 at 5:16 PM, Gwynne Raskind >wrote: Please don't suppress the standard dialer screen. As long as it remains, the user has no doubt about what you're doing, and how to interact with the interface. It would worry me if

Re: iPhone how to suppress phone dialer screen

2009-05-08 Thread Conrad Taylor
On Fri, May 8, 2009 at 4:59 AM, Shraddha Karwan wrote: > On Fri, May 8, 2009 at 5:16 PM, Gwynne Raskind >wrote: > > > > Please don't suppress the standard dialer screen. As long as it remains, > > the user has no doubt about what you're doing, and how to interact with > the > > interface. > > > >

quick and dirty NSData implosion

2009-05-08 Thread Jon
so far, what i've determined by dumbing this down, is that I must be doing something inherently bad and nubi like here... the run time just completely implodes when it gets to the "NSData" line of code any help would be great, thanks in advance. the "BookMark" is just a class with th

Re: quick and dirty NSData implosion

2009-05-08 Thread Alexander Spohr
Am 08.05.2009 um 15:25 schrieb Jon: but NSUserDefaults only takes immutable things. Why do you think that? Did you try? From the documentation: "value The object to store in the defaults database. A default’s value can be only property list objects: NSData, NSString, NSNumber, NSDate, NS

Re: NSXMLParser frees itself on error?

2009-05-08 Thread Michael Ash
On Fri, May 8, 2009 at 1:43 AM, Marcel Weiher wrote: > > On May 7, 2009, at 21:12 , Michael Ash wrote: > >> On Thu, May 7, 2009 at 11:53 PM, Marcel Weiher >> wrote: >>> >>> On May 7, 2009, at 17:29 , Jeff Johnson wrote: >>> On May 7, 2009, at 6:00 PM, Marcel Weiher wrote: >> That's

Re: problem with NSTimer

2009-05-08 Thread Michael Ash
On Fri, May 8, 2009 at 5:51 AM, Kiran Kumar S wrote: >        according to documentation for > beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: it says > that While the application is in the run loop, it does not respond to any > other events (including mouse, keyboard, or windo

Re: quick and dirty NSData implosion

2009-05-08 Thread jon
yes i did try, i would send the data, and nothing would show up in the property list file. but there would be no crash, no error, nothing, but no results either. so after reading the same documentation you also saw, I assumed it had to be NSDictionary, rather than NSMutableDictionar

HFS Format API?

2009-05-08 Thread iseecolors
Is there a Cocoa/Core Foundation (or ___) API for formatting a Volume? Rich Collyer ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins

Re: quick and dirty NSData implosion

2009-05-08 Thread John Cebasek
Why don't you do something like this: @try { [defaults setObject:bookMarkList forKey:PECBookMarkListKey]; } @catch (NSException *e) { NSLog(@"NSData blew up because: %@", [e reason]); } and find out what the error is? John On 8-May-09, at 9:56 AM, jon wrote: yes i did try, i would

Re: Associating Objective-C objects with Java objects using JNI

2009-05-08 Thread Scott Ribe
It can certainly be done; I did something exactly analogous ~7 years ago for C++ & Carbon. Basically, you can use the JNI to instantiate a Java runtime instance within your program, then use JNI to call through to Java object instances. Backing out a bit, you can create your own proxy classes whose

Re: quick and dirty NSData implosion

2009-05-08 Thread Alexander Spohr
Am 08.05.2009 um 15:56 schrieb jon: [defaults setObject:bookMarkList forKey:PECBookMarkListKey]; so again, I must be doing something fundamentally wrong here? Yes. Your BookMark-instance is not a property list object. So you could store the NSMutableDictionary, but it holds an ille

Distributed Objects via Bonjour?

2009-05-08 Thread Doug Knowles
Hi, all, I've tried Googling for explanations or sample code, and all of the hits are suggestions to Google for explanations or sample code... Can I use Bonjour to advertise a service, then use distributed objects to "vend" a server object and handle requests from remote clients? I have the Bonjo

Re: Cancel NSThread - cocoa/mysql database search...

2009-05-08 Thread spartan g
Thanks... I tried both the ways as Bill and Mike suggested. I could manage to cancel the thread by checking the bool flag for cancellation. It works fine. But the problem I am facing now is, once i sent the query to MySQL through SMySQL framework, I am unable to cancel it. This query takes so muc

Re: quick and dirty NSData implosion

2009-05-08 Thread Dave DeLong
And just to make sure... your Bookmark class does implement NSCoding, correct? That's required by NSKeyedArchiver. Dave On May 8, 2009, at 8:05 AM, Alexander Spohr wrote: Am 08.05.2009 um 15:56 schrieb jon: [defaults setObject:bookMarkList forKey:PECBookMarkListKey]; so again, I

Re: [iPhone] Grouped TableView baffling problem

2009-05-08 Thread Dave Camp
Instead of running and letting it load the debugger on crash, start it with the debugger in the first place (Cmd-Y). Depending on the problem, if the debugger loads after-the-fact you may not get a lot of helpful information in the console log. Dave On May 8, 2009, at 1:04 AM, James Lin wr

Re: quick and dirty NSData implosion

2009-05-08 Thread Keary Suska
On May 8, 2009, at 7:56 AM, jon wrote: yes i did try, i would send the data, and nothing would show up in the property list file. but there would be no crash, no error, nothing, but no results either. so after reading the same documentation you also saw, I assumed it had to be NSD

Re: quick and dirty NSData implosion

2009-05-08 Thread Dave DeLong
Not quite. It can if it's encoded first (with something like NSKeyedArchiver, and it can only be archived if it conforms to NSCoding. Dave On May 8, 2009, at 8:14 AM, Keary Suska wrote: ...your BookMark class cannot be stored in defaults... ___

RE: Distributed Objects via Bonjour?

2009-05-08 Thread Kirk Kerekes
Good DO demo code is rather scarce, and the best-practices are highly dependent on the target OS. For one example showing about every permutation imaginable, and a little-recognized simplified Bonjour strategy, try: The demo

Re: quick and dirty NSData implosion

2009-05-08 Thread jon
in the debugger, here are the last lines it followed... #0 0x91b35de9 in -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] #1 0x91b35b07 in -[NSMenu performKeyEquivalent:] #2 0x91b343ac in -[NSApplication _handleKeyEquivalent:] #3 0x91a5116b in -[NSApplication se

Re: quick and dirty NSData implosion

2009-05-08 Thread Dave DeLong
This is a clear indication that your BookMark class does not conform to NSCoding. Check the docs on what NSCoding is and how to use it. If you implement the two required methods (initWithCoder: and encodeWithCoder:), your code should work just fine. Dave On May 8, 2009, at 8:35 AM, jon w

Re: quick and dirty NSData implosion

2009-05-08 Thread Alexander Spohr
Am 08.05.2009 um 16:35 schrieb jon: NSData blew up because: *** -[BookMark encodeWithCoder:]: unrecognized selector sent to instance 0x1f900a40 So what are you asking for? It’s right there in your face: Your BookMark does not implement encodeWithCoder: an is therefore not NSCoding complia

Getting the private IP

2009-05-08 Thread Mr. Gecko
Hello, I'm trying to find out how to get the private IP address. This is my quick way of finding out. - (NSString *)localIP { NSString *IPAddress = @""; struct ifaddrs *myaddrs, *ifa; struct sockaddr_in *s4; int status; char buf[64]; status

Re: quick and dirty NSData implosion

2009-05-08 Thread jon
sorry, I am getting emails out of order because i'm using the option that sends list in a bundle, so getting the ones that reply directly to me first, so i am looking for Dave's answer now... thanks, Jon. On May 8, 2009, at 8:40 AM, Alexander Spohr wrote: So what are you asking for? It’s

Re: Cocoa-dev Digest, Vol 6, Issue 702

2009-05-08 Thread Jon
ya, that would be a big problem, I'm looking at how to do "NSCoding" for a class now... thanks, hey, at least i knew i was doing something fundamentally wrong... nubi Jon. On May 8, 2009, at 8:21 AM, cocoa-dev-requ...@lists.apple.com wrote: And just to make sure... your Bookmark class d

NSApplication and command line args

2009-05-08 Thread Brian Arnold
Hi, For those of you familiar with handling command line arguments with an NSApplication, I am requesting a reality-check whether I am understanding the following problem correctly, and whether the proposed solution makes sense. Please reply directly to me off-line unless you believe the answer

Converting NSString to C++ std::string

2009-05-08 Thread Andrew Wood
Im using a library which requires arguments to be C++ std::strings, but I need to take the value from an NSTextField. I thought I could do it like this: std::string mycppstring; . . . mycppstring = std::string([[myNSTextField stringValue] UTF8String]); But it keeps crashing. What's the rec

NSXMLNode bug in method XMLString

2009-05-08 Thread Kenneth Chin-Purcell
I am a long time programmer returning to Mac development, so pardon if I'm not following protocol. I submitted this bug to the Apple Bug Reporter (id 6693016) about two months ago and it's just been sitting there with no response. From my searching of the archives it seems that no-one has

NSString to bit pattern

2009-05-08 Thread erappy
Hi, I am trying to find way to convert the NSString object into its bit pattern and convert that bit pattern into another NSString object, For Example if I have NSString *origStr = @"Hello": NSString * bitPatternoforigStr ; no I want to convert it to the bit pattern if Hello and return an object o

RE: problem with NSTimer

2009-05-08 Thread Gopinath Srinivasan
I am guessing you will have to configure your runloop in the appropriate mode (see NSRunLoop, and Run Loop Management in the docs), to specify the behavior of your timers. Hope that helped, ~Gopinath -Original Message- From: cocoa-dev-bounces+gopinath=adobe@lists.apple.com [mailto

Re: Converting NSString to C++ std::string

2009-05-08 Thread Alexander Spohr
Am 07.05.2009 um 23:38 schrieb Andrew Wood: mycppstring = std::string([[myNSTextField stringValue] UTF8String]); But it keeps crashing. What's the recommended way? Does std::string() copy the char* contents? I guess not (but I don’t use C++). See the docs: UTF8String Returns a null-termi

Re: Converting NSString to C++ std::string

2009-05-08 Thread vinai
--- On Thu, 5/7/09, Andrew Wood wrote: > From: Andrew Wood > Subject: Converting NSString to C++ std::string > To: Cocoa-dev@lists.apple.com > Date: Thursday, May 7, 2009, 4:38 PM > Im using a library which requires > arguments to be C++ std::strings, but I need to take the > value from an NSTe

Re: NSString to bit pattern

2009-05-08 Thread Greg Guerin
erappy wrote: Hi, I am trying to find way to convert the NSString object into its bit pattern and convert that bit pattern into another NSString object, For Example if I have NSString *origStr = @"Hello": NSString * bitPatternoforigStr ; no I want to convert it to the bit pattern if Hello and

Re: Converting NSString to C++ std::string

2009-05-08 Thread Jesper Storm Bache
That should work. Where are you crashing - and what is your crash log? My guess is that something else is not right (are you sure that myNSTextField is a valid object)? Jesper Storm Bache On May 7, 2009, at 2:38 PM, Andrew Wood wrote: Im using a library which requires arguments to be C++ st

Re: Converting NSString to C++ std::string

2009-05-08 Thread cocoa learner
Probably you can read this document in following link... http://developer.apple.com/documentation/Cocoa/Conceptual/Strings/Articles/CreatingStrings.html This talks about how to C string. And after that you can convert that into a C++ string object. On Fri, May 8, 2009 at 9:39 PM, Alexander Spohr

Re: Converting NSString to C++ std::string

2009-05-08 Thread Alex Curylo
On 8-May-09, at 8:55 AM, cocoa-dev-requ...@lists.apple.com wrote: mycppstring = std::string([[myNSTextField stringValue] UTF8String]); But it keeps crashing. What's the recommended way? I have no idea, but it works for me to simply assign it without the constructor. Why, here's an example

Re: Getting the private IP

2009-05-08 Thread Michael Ash
On Fri, May 8, 2009 at 10:46 AM, Mr. Gecko wrote: > Hello, I'm trying to find out how to get the private IP address. If I understand your code correctly, you're trying to get the loopback address? No need for all of this, then. The IPv4 loopback address is 127.0.0.1 by definition. The IPv6 loopba

Re: [Q] Correct way to identify an application, Launch Services, & Spaces

2009-05-08 Thread Eric Schlegel
On May 7, 2009, at 10:40 AM, Eric Gorr wrote: So, is it the "right thing" for two versions of the application to have the same identifier? That's the typical approach, although there are lots of apps that change their identifier with each release too. Spaces does identify apps strictly b

Re: Converting NSString to C++ std::string

2009-05-08 Thread Clark Cox
On Fri, May 8, 2009 at 8:39 AM, Alexander Spohr wrote: > > Am 07.05.2009 um 23:38 schrieb Andrew Wood: > >> mycppstring = std::string([[myNSTextField stringValue] UTF8String]); >> >> But it keeps crashing. What's the recommended way? > > Does std::string() copy the char* contents? I guess not (but

Re: [iPhone] Grouped TableView baffling problem

2009-05-08 Thread Luke the Hiesterman
I would expect that the backtrace will give a clue as to what's going on. Luke On May 8, 2009, at 1:04 AM, James Lin wrote: Hi, I have a table view with 3 grouped sections. Each section contains only one item. There is a baffling problem i don't have a clue what went wrong. if any one o

Not sleeping - Why?

2009-05-08 Thread Trygve Inda
My app is a background app that sends and receives distributed notifications, reads from a few large mmap'd files and crates a new file every few minutes (and deletes the old one). When it is running, the display sleeps, but the system does not. How can I tell the OS that it is ok to sleep. Since

Re: [Q] Correct way to identify an application, Launch Services, & Spaces

2009-05-08 Thread Eric Gorr
On May 8, 2009, at 12:38 PM, Eric Schlegel wrote: On May 7, 2009, at 10:40 AM, Eric Gorr wrote: So, is it the "right thing" for two versions of the application to have the same identifier? That's the typical approach, although there are lots of apps that change their identifier with eac

Re: Converting NSString to C++ std::string

2009-05-08 Thread Drew Lawson
According to Alex Curylo: > > On 8-May-09, at 8:55 AM, cocoa-dev-requ...@lists.apple.com wrote: > > > mycppstring = std::string([[myNSTextField stringValue] UTF8String]); > > > > > > But it keeps crashing. What's the recommended way? > > I have no idea, but it works for me to simply assign it w

Re: Tri-state Check box

2009-05-08 Thread Arun
In my app, the check box is in the table column and i have binded the value of table column to a BOOL variable of my model class. In this case how do i set the Mixed State to a particulat item in the table column. Thanks Arun On Fri, May 8, 2009 at 1:05 AM, Eric Gorr wrote: > If I understand c

Re: Key-Value Observing: light-weight or heavy-weight?

2009-05-08 Thread Jerry Krinock
On 2009 May 07, at 17:29, Stuart Malin wrote: is each individual observer reasonably light-weight, and this a viable way to go. Well, I wish you'd get an answer from someone smarter about this than me, but since you didn't, here's my two cents: KVO is light-weight. Also, since you're co

Re: iPhone Telephone APIs

2009-05-08 Thread Gwynne Raskind
On May 8, 2009, at 1:03 PM, Luke the Hiesterman wrote: On May 8, 2009, at 10:00 AM, wrote: If you feel strongly (like I do) that this functionality should be made available, file a bug. I'm thinking there is a legal reason this feature is not enabled, but I am unable to confirm my suspici

Re: iPhone Telephone APIs

2009-05-08 Thread Gwynne Raskind
Apologies for the random e-mail from nowhere; I replied to the wrong list. On May 8, 2009, at 1:17 PM, Gwynne Raskind wrote: On May 8, 2009, at 1:03 PM, Luke the Hiesterman wrote: On May 8, 2009, at 10:00 AM, wrote: If you feel strongly (like I do) that this functionality should be made a

Re: [Q] Correct way to identify an application, Launch Services, & Spaces

2009-05-08 Thread Kyle Sluder
On Fri, May 8, 2009 at 12:55 PM, Eric Gorr wrote: > Are you (or anyone else) aware of any issues I should be aware of? If you expose any scripting interface then people might get frustrated when their Frobdignag 2008 scripts don't work when they upgrade to Frobdignag 2009, even though the scripti

Re: [Q] Correct way to identify an application, Launch Services, & Spaces

2009-05-08 Thread Quincey Morris
On May 8, 2009, at 09:55, Eric Gorr wrote: My only other question would involve whether or not there would be undesirable side-effects by having different identifiers for different versions of the application. Are you (or anyone else) aware of any issues I should be aware of? Well, for on

Re: Tri-state Check box

2009-05-08 Thread Kyle Sluder
Wire up a delegate and set the state in willDisplayCell. --Kyle Sluder -- --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-ad

Re: [Q] Correct way to identify an application, Launch Services, & Spaces

2009-05-08 Thread Eric Gorr
Thank you Kyle & Quincey for your additional comments. I agree, it does not seem to be a good idea to give an application a different identifier based on the version changing. p.s. Anyone know how exactly Spaces builds the string that it uses? In my actual case, the name of the application s

Re: Garbage collector related crash

2009-05-08 Thread Bill Bumgarner
On May 8, 2009, at 12:47 AM, Chris Idou wrote: I've got an object that holds onto a CF ref: mdref= MDItemCreate(nil, (CFStringRef)path); [NSMakeCollectable(mdref) autorelease]; I think I'm doing the right thing in the class declaration: @interface MetadataItem : NSObject { __strongMDItemRefmd

Re: [Q] Correct way to identify an application, Launch Services, & Spaces

2009-05-08 Thread Eric Gorr
On May 8, 2009, at 1:40 PM, Quincey Morris wrote: If Spaces can't tell the difference between application versions with the same bundle identifier, that's a defect in Spaces (from your point of view), not a reason for deforming your application to gain a small usability feature. If anyon

Re: [Q] Correct way to identify an application, Launch Services, & Spaces

2009-05-08 Thread Eric Gorr
Never mind. It was probably just some weird glitch, but with some experimentation, Spaces is clearly grabbing the name it shows from the name of the app as it appears in the finder. On May 8, 2009, at 1:51 PM, Eric Gorr wrote: p.s. Anyone know how exactly Spaces builds the string that it

AppleEvents and modal dialogs

2009-05-08 Thread James Walker
I have a mostly-Carbon app that runs some Cocoa modal dialogs using -[NSApplication runModalForWindow:]. If an Apple Event (such as 'odoc') arrives while such a dialog is showing, it just gets eaten. I'd like to have it either handled or deferred. I tried creating an NSApplication delegate o

Renaming a file repositions icon in Finder

2009-05-08 Thread Jim Turner
It appears that renaming a file will cause the Finder to reposition the icon for the file if it's currently displayed in a icon view somewhere. Is there any way to prevent that from happening? It looks very strange to have icons jump all over the place just because of a rename. Thinking that it

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!

2009-05-08 Thread Jerry Krinock
Conclusion. Here's what I believe to be the "missing documentation"... *** "You can use -insertObject: to cancel a prior deletion, however if certain operations are performed after the deletion and before the restoring -insertObject:, the attributes of the deleted/inserted object will all

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!

2009-05-08 Thread Adam Swift
On May 8, 2009, at 1:00 PM, Jerry Krinock wrote: Conclusion. Here's what I believe to be the "missing documentation"... *** "You can use -insertObject: to cancel a prior deletion, however if certain operations are performed after the deletion and before the restoring -insertObject:, th

Re: NSString to bit pattern

2009-05-08 Thread Andrew Farmer
On 08 May 09, at 08:47, Greg Guerin wrote: A string is a sequence of characters. Retrieve each character, determine its bit-pattern, then append that pattern to an NSMutableString. Now you have to figure out how to turn a character into its bit-pattern. So break that down. One extra com

Re: NSApplication and command line args

2009-05-08 Thread Andrew Farmer
On 07 May 09, at 12:36, Brian Arnold wrote: I have recently converted an application which processes command line arguments to call NSApplicationMain when it starts up, and defer command line processing until later in a separate thread. The deferred command line processing still works; however,

Re: Cancel NSThread - cocoa/mysql database search...

2009-05-08 Thread Andrew Farmer
On 08 May 09, at 07:08, spartan g wrote: But the problem I am facing now is, once i sent the query to MySQL through SMySQL framework, I am unable to cancel it. This query takes so much time to return the results and cannot be canceled as far as I understand. Is there any way to cancel this qu

Re: AppleEvents and modal dialogs

2009-05-08 Thread Uli Kusterer
On 08.05.2009, at 21:16, James Walker wrote: I have a mostly-Carbon app that runs some Cocoa modal dialogs using - [NSApplication runModalForWindow:]. If an Apple Event (such as 'odoc') arrives while such a dialog is showing, it just gets eaten. I'd like to have it either handled or deferre

Re: HFS Format API?

2009-05-08 Thread Andrew Farmer
On 08 May 09, at 07:01, iseecolors wrote: Is there a Cocoa/Core Foundation (or ___) API for formatting a Volume? No, largely because formatting a volume is a privileged operation which can't be performed by a userspace application anyway. However, you may want to look into the newfs_hfs and

Re: Converting NSString to C++ std::string

2009-05-08 Thread Clark Cox
On Fri, May 8, 2009 at 9:56 AM, Drew Lawson wrote: > According to Alex Curylo: > >> >> On 8-May-09, at 8:55 AM, cocoa-dev-requ...@lists.apple.com wrote: >> >> > mycppstring = std::string([[myNSTextField stringValue] UTF8String]); >> > >> > >> > But it keeps crashing. What's the recommended way? >>

Re: NSString to bit pattern

2009-05-08 Thread Robert Claeson
On 8 May 2009, at 23:00, Andrew Farmer wrote: On 08 May 09, at 08:47, Greg Guerin wrote: A string is a sequence of characters. Retrieve each character, determine its bit-pattern, then append that pattern to an NSMutableString. Now you have to figure out how to turn a character into its

Re: [Q] Correct way to identify an application, Launch Services, & Spaces

2009-05-08 Thread Sean McBride
On 5/8/09 10:40 AM, Quincey Morris said: >OTOH, if your two "versions" really have a good reason for existing >independently (beyond testing and an interim changeover period), then >what you probably have is two different apps, and different bundle >identifiers would make sense. I've just run int

Re: Renaming a file repositions icon in Finder

2009-05-08 Thread Sean McBride
On 5/8/09 2:52 PM, Jim Turner said: >It appears that renaming a file will cause the Finder to reposition >the icon for the file if it's currently displayed in a icon view >somewhere. Is there any way to prevent that from happening? It looks >very strange to have icons jump all over the place jus

Re: NSApplication and command line args

2009-05-08 Thread Kyle Sluder
On Fri, May 8, 2009 at 6:03 PM, Andrew Farmer wrote: > A much simpler solution would be to preprocess the arguments which you pass > to NSApplicationMain. Run through everything in argv, then create a new > array of arguments from that with all arguments your application wants to > handle removed

Re: AppleEvents and modal dialogs

2009-05-08 Thread Sean McBride
On 5/8/09 12:16 PM, James Walker said: >I have a mostly-Carbon app that runs some Cocoa modal dialogs using >-[NSApplication runModalForWindow:]. If an Apple Event (such as 'odoc') >arrives while such a dialog is showing, it just gets eaten. I'd like to >have it either handled or deferred. I tr

Re: NSString to bit pattern

2009-05-08 Thread Greg Guerin
Andrew Farmer wrote: One extra complication: By Cocoa's standards, a string is not a sequence of bytes: it's a sequence of Unicode codepoints.* To treat a string as a "bag of bytes", you will first need to choose a text encoding to treat the text as, then convert it using the NSString dat

Re: NSString to bit pattern

2009-05-08 Thread Alastair Houghton
On 8 May 2009, at 23:13, Robert Claeson wrote: On 8 May 2009, at 23:00, Andrew Farmer wrote: On 08 May 09, at 08:47, Greg Guerin wrote: A string is a sequence of characters. Retrieve each character, determine its bit-pattern, then append that pattern to an NSMutableString. Now you have t

Re: NSString to bit pattern

2009-05-08 Thread Alastair Houghton
On 8 May 2009, at 10:00, erappy wrote: Hi, I am trying to find way to convert the NSString object into its bit pattern and convert that bit pattern into another NSString object, For Example if I have NSString *origStr = @"Hello": NSString * bitPatternoforigStr ; no I want to convert it to the

Re: Getting the private IP

2009-05-08 Thread Alastair Houghton
On 8 May 2009, at 15:46, Mr. Gecko wrote: Hello, I'm trying to find out how to get the private IP address. This is my quick way of finding out. - (NSString *)localIP { NSString *IPAddress = @""; struct ifaddrs *myaddrs, *ifa; struct sockaddr_in *s4; int status;

Re: Getting the private IP

2009-05-08 Thread Mr. Gecko
I'm writing a personal application for managing my domains, and I think what I wrote will work well enough for me. But the problem where if it's a self-assigned address does miss with my setup. Because sometimes I'll hock it up via firewire to my server for fast backup. On May 8, 2009, at 6

converting a characer to a keycode

2009-05-08 Thread kvic...@pobox.com
i would like to convert a character to its corresponding virtual keycode. the why: i allow users to specify keyboard equivalents for menu items (in a manner similar to xcode key binding preferences). for reasons i don't understand it works better use unshifted characters for the shifted numeri

Re: converting a characer to a keycode

2009-05-08 Thread Greg Guerin
ken wrote: the only way i can think to perform this conversion is to itereate over the virtual key codes 0-127 (with various combinations of shift and option keys) until i find the one that matches the user input character. and while this is certainly doable, it feels awfully clumsy (and

Re: NSApplication and command line args

2009-05-08 Thread Andrew Farmer
On 08 May 09, at 15:48, Kyle Sluder wrote: On Fri, May 8, 2009 at 6:03 PM, Andrew Farmer wrote: A much simpler solution would be to preprocess the arguments which you pass to NSApplicationMain. Run through everything in argv, then create a new array of arguments from that with all arguments

Re: ViewControllers and window nibs

2009-05-08 Thread David Scheidt
On May 6, 2009, at 3:44 PM, David Scheidt wrote: I've got a Core Data app, using the NSPersistantDocument stuff. There are three basic entity types. There is one, which I'll call MainEntity, which has optional to-many relationships with the other two, which I'll call A and B. In my main

Re: quick and dirty NSData implosion

2009-05-08 Thread Graham Cox
On 09/05/2009, at 12:35 AM, jon wrote: @interface BookMark : NSObject You can help yourself out with this type of thing by declaring your classes properly. If you need it to be NSCoding compliant (as you do), then ensure it subscribes to the protocol: @interface BookMark : NSObject T

Make an attributed string all uppercase without losing attributes?

2009-05-08 Thread Graham Cox
I have an attributed string. I want to preserve the attributes within the string but set all the actual characters to uppercase, lowercase, etc. According to the docs for NSMutableAttributedString, the - mutableString method returns a mutable string that the receiver tracks changes to in o

Re: NSXMLParser frees itself on error?

2009-05-08 Thread Marcel Weiher
On May 8, 2009, at 6:50 , Michael Ash wrote: Begin forwarded message: From: Marcel Weiher Date: May 7, 2009 10:05:29 PDT And yes, the code that I use explicitly runs the runloop, and it is the code that runs the runloop that both allocates the NSURLConnection and then cleans up after

Hex to NSString or NSData

2009-05-08 Thread Mr. Gecko
Hello, I have a string with hex and I want to ether make it into a NSData or NSString. How might I do that. P.S. The only thing I can find is how to make NSString/NSData into hex. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: Hex to NSString or NSData

2009-05-08 Thread Jerry Krinock
On 2009 May 08, at 20:16, Mr. Gecko wrote: Hello, I have a string with hex and I want to ether make it into a NSData or NSString. How might I do that. -[NSString initWithBytes:length:encoding:] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

Re: Hex to NSString or NSData

2009-05-08 Thread Mr. Gecko
And how could that make @"68656c6c6f" into @"hello"? Thinking this will help you understand what I'm trying to do... On May 8, 2009, at 10:23 PM, Jerry Krinock wrote: On 2009 May 08, at 20:16, Mr. Gecko wrote: Hello, I have a string with hex and I want to ether make it into a NSData or NSS

Re: Make an attributed string all uppercase without losing attributes?

2009-05-08 Thread Graham Cox
On 09/05/2009, at 1:11 PM, Jim Correia wrote: The documentation for -[NSMutableString replaceCharactersInRange:withString:] is perhaps more enlightening. """The new characters inherit the attributes of the first replaced character from aRange""" Processing the string by attribute runs sounds

Re: Hex to NSString or NSData

2009-05-08 Thread Jerry Krinock
On 2009 May 08, at 20:34, Mr. Gecko wrote: And how could that make @"68656c6c6f" into @"hello"? ? Thinking this will help you understand what I'm trying to do... scanf() ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not pos

Re: Make an attributed string all uppercase without losing attributes? [SOLVED]

2009-05-08 Thread Graham Cox
On 09/05/2009, at 2:11 PM, Graham Cox wrote: On 09/05/2009, at 1:11 PM, Jim Correia wrote: The documentation for -[NSMutableString replaceCharactersInRange:withString:] is perhaps more enlightening. """The new characters inherit the attributes of the first replaced character from aRange"""