Re: NSArray EXEC_BAD_ACCESS when initalized with strings

2009-09-10 Thread Jens Alfke
On Sep 9, 2009, at 11:39 PM, Dave Keck wrote: If you enable the -Wformat warning, the compiler will warn you if you omit the trailing nil. Never understood why it's not enabled by default... The first thing I do in a new Xcode project is, in the project build settings, add "-Wall" to "other

Re: QTMovie and audio stream

2009-09-10 Thread Jens Alfke
On Sep 10, 2009, at 1:54 AM, Massimiliano Gargani wrote: I'm developing a little music player. It works fine with file but it doesn't work with audio streaming. as you can see from log below it wants to open the stream as a file: 2009-09-10 10:47:04.221 Primafila[511:10b] the file path http

Re: Scrolling NSScrollView by fractional amounts - why would values get rounded?

2009-09-10 Thread Jens Alfke
On Sep 10, 2009, at 7:01 AM, Martin Redington wrote: This works fine when the new y value is a whole integer, but I'm seeing some strange behaviour when trying to scroll by fractional amount (e.g. .25 or .5 of a pixel). Are you sure you want to scroll by fractional pixels? It will be slower

Re: Subversion and Interface Builder

2009-09-11 Thread Jens Alfke
On Sep 11, 2009, at 1:10 AM, Alexander Hartner wrote: Thanks for all the feedback on this. Have there been any new development with 10.6 in this regard. The .xib file format was added in 10.5 — it's a flat file, so no problems with directory versioning. You should switch to using that.

Re: Retaining a NSURL and retaining its -path

2009-09-12 Thread Jens Alfke
On Sep 12, 2009, at 9:43 AM, John Love wrote: Basic question: if a parent object is retained, why isn't each sibling component object of that parent retained?? It's not a component object in the implementation. Whenever you call - path, the NSURL implementation copies out and decodes the pa

Re: NSString and UIWebView load

2009-09-12 Thread Jens Alfke
There aren't any obvious ref-counting problems in the code you posted. What's the backtrace of the crash? Also, have you tried using the new Build And Analyze command in Xcode 3.2? It can help find some problems like these. *[newWebView **loadHTMLString**:htmlContentTemp **baseURL**: [**NSUR

Re: NSString and UIWebView load

2009-09-13 Thread Jens Alfke
The crash log shows the crash is in a background thread running Data Detectors code: Thread 3 Crashed: 0 libobjc.A.dylib 0x93ca268c objc_msgSend + 28 1 CoreFoundation 0x30288bb4 __CFSTUnitWordSentenceLineSetString + 1204 2 DataDetectorsCore

Re: sprintf and 64-bit integers

2009-09-13 Thread Jens Alfke
It would be best to convert all your sprintf calls to snprintf, which is a safer equivalent that won't overflow the buffer. If the value is too long to fit, it'll be truncated instead of overflowing and corrupting the stack. (This type of overflow is one of the main causes of security holes

Re: Mac Mini or iMac for Cocoa Development?

2009-09-13 Thread Jens Alfke
On Sep 13, 2009, at 12:53 PM, Michael Rogers wrote: I am leaning towards iMacs, because these computers will serve as ambassadors as well as development machines; I want to double-check that if we have to go to Mac Minis, say with 4 GB of RAM, we won't be waiting forever to compile a simp

Re: Text Searching system...

2009-09-14 Thread Jens Alfke
On Sep 11, 2009, at 4:47 AM, Farooq zaman wrote: I want to develop a text searching system for my application. This system should search for a search expressions in all files present is a particular project directory. Can anybody tell me what COCOA classes used for text searching? There

Re: coding NSNumber in NSArray?

2009-09-14 Thread Jens Alfke
On Sep 14, 2009, at 9:11 AM, jon wrote: I thought i had read that NSNumber knew how to code itself in an NSArray... is this not the case? or is this code below just set up all wrong? and what would the proper way be to set this up? The code looks OK to me. Have you single-stepped throug

Re: Need Help : Iphone Dynamic behavior Tab Controller!

2009-09-14 Thread Jens Alfke
On Sep 13, 2009, at 9:19 PM, Waqas Qureshi wrote: Please help me to design the architecture of this dynamic behaviour tabs ... That's really not an appropriate type of question to ask here. If you want someone to design an architecture for you, that's a consulting job and you should expe

Re: coding NSNumber in NSArray?

2009-09-14 Thread Jens Alfke
On Sep 14, 2009, at 10:17 AM, Quincey Morris wrote: Whatever your question is, the answer likely is: don't try to use 'encodeObject:forKey:' to encode NSNumber objects. Use one of the variants like "encodeInteger:forKey:" or "encodeInt32:forKey:" -- you need to tell the archiver which *kin

Re: Garbage collecting live threads

2009-09-14 Thread Jens Alfke
On Sep 14, 2009, at 11:54 AM, Edward Chan wrote: Would mythread be considered garbage and be collected even though it hasn't finished running? If so, would it be cancelled first? Or would it just get killed? Threads aren't garbage collected; they're implemented at a lower level. (Or you

Re: coding NSNumber in NSArray?

2009-09-14 Thread Jens Alfke
On Sep 14, 2009, at 12:09 PM, Henry McGilton (Boulevardier) wrote: You're creating an auto-released NSNumber instance, and then releasing it.At a first guess, it's over-released . . . No. Look at the code more carefully. The -release call is on node1, which is a BookMarkNode object no

Re: coding NSNumber in NSArray?

2009-09-14 Thread Jens Alfke
On Sep 14, 2009, at 12:10 PM, Jon wrote: I don't quite understand why you don't see the word "NSNumber" in my code... when you said twice incorrectly that it doesn't involve an NSNumber nor why you don't see the word "NSArray" in my code. when you said again incorrectly you don't se

Re: coding NSNumber in NSArray?

2009-09-14 Thread Jens Alfke
On Sep 14, 2009, at 12:33 PM, Kyle Sluder wrote: This is how how you should be implementing this setter. In particular, the !typeOfLeaf condition shouldn't be there. Why not? It looks harmless. I think there are nearly as many favorite ways to write accessor methods as there are Cocoa pro

Re: Custom Fonts in UI Webview

2009-09-14 Thread Jens Alfke
On Sep 14, 2009, at 2:43 PM, Ben Lachman wrote: I was looking at the NYTimes iPhone app today and noticing that it looks like they're using a UIWebView with a custom font (not sure what font though, anyone know?). I did some digging on how to do this and couldn't come up with anything exc

Re: Need -[NSTask waitUntilExitOrTimeout:] (was NSTask "Thread Unsafe"...)

2009-09-14 Thread Jens Alfke
On Sep 14, 2009, at 6:29 PM, Jerry Krinock wrote: Uh, yeah, it took me a while to track that one down. Apparently, running a run loop that is already running is not a good idea. That's not generally true; there's definitely code that does this. I've found that generally it helps to run th

Re: How to implement to rename the file by single click its name column

2009-09-14 Thread Jens Alfke
On Sep 14, 2009, at 8:12 PM, James wrote: I can implement to play the file by double click its name column only. But I do not know how to implement to rename the file by single click its name column. Unfortunately this isn't one of the things NSTableView makes easy for you. If I recal

Re: Overcoming crappiness of NSSplitView - what's the magic?

2009-09-15 Thread Jens Alfke
I've done this a few times … you can find an example in the source code of my app Murky, in RepoController.m lines 400-475. http://bitbucket.org/snej/murky/src/tip/Source/RepoController.m —Jens___ Cocoa-dev mailing list (Cocoa-dev@lists.apple

Re: NSFireTimer Crash

2009-09-15 Thread Jens Alfke
On Sep 14, 2009, at 9:51 PM, Anurag Khare wrote: Application Specific Information: objc_msgSend() selector name: grayscaleImageRep Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x925de91b objc_msgSend + 27 1 com.apple.Foundation 0x98a839d4 __NSFireTimer + 141 2 com.a

Re: File Conversion Using Cocoa

2009-09-15 Thread Jens Alfke
On Sep 15, 2009, at 6:53 AM, Ramesh P wrote: I would like to convert pdf, doc files to html files using Cocoa? Please help me in this. This is the kind of question you would ask a paid consultant, not a mailing list. Please ask more specific questions; preferably after reading some docum

Re: Custom Fonts in UI Webview

2009-09-15 Thread Jens Alfke
On Sep 15, 2009, at 1:46 PM, Ben Lachman wrote: However, I also found after checking the NYTimes app again that they're actually using Georgia for their font face, not anything custom. I know this is doable, though, because the app Eucalyptus includes custom fonts (the Libertine family).

Re: Having a weird error with NSStreams

2009-09-15 Thread Jens Alfke
On Sep 15, 2009, at 2:36 PM, Development wrote: while (0 < remainingToWrite) { int actuallyWritten = 0; actuallyWritten = [_outStream write:marker maxLength:remainingToWrite]; remainingToWrite -= actuallyWritten; marker += actuallyWritten;

Re: NSString vs. unicode encoding

2009-09-15 Thread Jens Alfke
On Sep 15, 2009, at 9:04 PM, Johan Kool wrote: NSString *stringA = @"hello\040world"; NSString *stringB = [NSString stringWithUTF8String:"hello \040world"] ; I'm confused. '\040' is a regular ascii space character (040 = 32 decimal). What's unusual about either of these strings? // Thi

Re: [myNSWindow setDocumentEdited:dirtyB] fail ??

2009-09-15 Thread Jens Alfke
On Sep 15, 2009, at 4:23 PM, David M. Cotter wrote: when i try to set a breakpoint on setDocumentEdited, the "enabled" check box shows "mixed" state, and the breakpoint is never hit. if i try to set it to "on" it goes back to mixed state so i can't set a breakpoint :( What are the exact

Re: Send POST data to browser

2009-09-17 Thread Jens Alfke
On Sep 17, 2009, at 3:26 AM, Bartosz Białecki wrote: I can launch browser with url using this code: NSURL *url = [NSURL URLWithString: @"https://www.example.com/ index.php"]; [[UIApplication sharedApplication] openURL: url]; but I don't know how to send post data. You can't do it — the brow

Re: What is the life of the c string returned by NSString's UTF8String method?

2009-09-18 Thread Jens Alfke
On Sep 18, 2009, at 11:04 AM, Stuart Malin wrote: I am under the impression that the reference returned by NSString's UTF8String method is valid for the life of the NSString instance which provided the reference (and further, that the memory of the referenced C string is freed when the NSS

Re: Running Safari from application

2009-09-18 Thread Jens Alfke
On 18.09.2009, at 18:52, Bartosz Białecki wrote: I think so too. So do you know maybe another solution how to open local html file with Safari? You could encode the entire HTML file in a 'data:' URL, if it's not too huge. (You'd have to do the same thing to any custom image: convert it t

Re: Finding user's Music folder (and others)?

2009-09-18 Thread Jens Alfke
On Sep 17, 2009, at 9:32 PM, Graham Cox wrote: It's also pretty common to relocate it - don't assume it's unusual. Quite a few people like to keep their music on an external drive so whatever it is you're doing, if you assume ~/Music/, it'll fail in those cases, as you realise. Yes! I've

Re: Optimizing Enormous lists in NSBrowser

2009-09-18 Thread Jens Alfke
On Sep 17, 2009, at 2:32 PM, Dave DeLong wrote: For normal-sized directories, this works pretty well. However, in my "worst-case" scenario of a flat directory containing 1 million files, I've found that it takes 34.8 seconds to retrieve a full directory listing (so I know how many to retu

Re: Static Analyzer and Core Foundation

2009-09-18 Thread Jens Alfke
On Sep 18, 2009, at 5:25 PM, Steve Cronin wrote: Is this the 'best' this can be? You need to call CFRelease on 'mdi', right after releasing 'arrayRef'. I don't know why the analyzer isn't reporting that as a leak — you could file a bug report. —Jens

Re: Capturing content programatically

2009-09-21 Thread Jens Alfke
On Sep 19, 2009, at 8:09 AM, Achint Sandhu wrote: Is there a way to programatically capture content from different applications in osx. Not in general. It depends on how scriptable the application is. As an example, I'd like to be able to get a webarchive of the current web page being di

Re: Architecture for concurrent network client

2009-09-21 Thread Jens Alfke
On Sep 20, 2009, at 8:43 AM, Sixten Otto wrote: One way to approach this might be to create N threads, each of which would "own" a connection, and wait on the request queue You don't need concurrency or threads to handle socket connections. The 'Mac way' is to use asynchronous I/O, hooking

Re: Any way to tell why a window is closing?

2009-09-21 Thread Jens Alfke
On Sep 21, 2009, at 8:15 AM, Scott Ribe wrote: Within -windowWillClose, I need to know whether or not the user clicked the close button on the window. Well, if the user clicked the close button your -windowShouldClose delegate method will be called first. You could set a flag in there,

Re: Optimizing Enormous lists in NSBrowser

2009-09-21 Thread Jens Alfke
On Sep 21, 2009, at 8:28 AM, Graham Cox wrote: Ideally if the list can't display more than, say 50 files at a time (depends on how big your screen is, etc), then it shouldn't touch more than 50 files on disk. It has never really managed that however, and maybe there are fundamental limitat

Re: NSURLConnection inserting Accept-Language and Accept headers

2009-09-21 Thread Jens Alfke
On Sep 21, 2009, at 5:08 AM, Michael C.Silva wrote: Is there anyway to completely remove these headers from being inserted by NSURLConnection? They are not present in my NSMutableURLRequest, but show up in the stream sent out by the NSURLConnection. I see no way to control this. I don't k

Re: favicon of address

2009-09-21 Thread Jens Alfke
The best engineered approach would probably be to load the page up into a WebView, BUT use the WebResourceLoadDelegate to stop it wasting time downloading any resource that isn't the favicon. WebView has a lot of overhead! It would be much more efficient to just use NSXMLDocument to down

Re: Architecture for concurrent network client

2009-09-21 Thread Jens Alfke
On Sep 21, 2009, at 10:14 AM, Sixten Otto wrote: I don't think that that gets me out of the problem I was really trying to ask about, though, which is how to manage getting the work from the (single) queue of requests from the user to the exactly N persistent connections available to the applic

Re: Why am I always getting the linker error: 'duplicate symbol'...?

2009-09-21 Thread Jens Alfke
On Sep 21, 2009, at 1:24 PM, Kyle Sluder wrote: You might want to review your favorite C documentation. I always preferred K&R. Specifically, look up the keyword "extern" in the index. —Jens___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: Why am I always getting the linker error: 'duplicate symbol'...?

2009-09-21 Thread Jens Alfke
On Sep 21, 2009, at 2:15 PM, Frederick C. Lee wrote: I'm assuming 'const ' is better then the compiler directive '#define', due to the use of the compiler for more-efficient code. Hence the attempt. It depends. In C, a const variable of a primitive type like an integer is less efficient

Re: FileManager Problem Post OS X 10.6 Installation

2009-09-21 Thread Jens Alfke
On Sep 21, 2009, at 3:26 PM, dct wrote: Prior to installing OS X 10.6 and Xcode 3.2 (64-bit), a bit of FileManager code for replacing one file with another, to wit: if( [mgr fileExistsAtPath:path1] ) [mgr removeFileAtPath:path1 handler:nil]; [mgr movePath:path0 toPath:path1 handler:nil]

Re: Strategies for tracking a tricky (typing) slowdown/lag bug

2009-09-21 Thread Jens Alfke
On Sep 21, 2009, at 3:40 PM, Keith Blount wrote: My app uses a heavily modified version of the OS X text system and has some typing lag issues. Generally it has always been fine, but in some circumstances typing would slow down (sometimes this is in part attributable to the fault of the O

Re: Displaying Strings in custom formats

2009-09-22 Thread Jens Alfke
If you generate HTML you can get better control over formatting using CSS. Or you can build the formatted text directly using NSAttributedString, although this can be a pain. --Jens {via iPhone} On Sep 22, 2009, at 7:56 AM, Arun wrote: Hi All, I have a set of lines and needs to displ

Re: an app that never quits

2009-09-22 Thread Jens Alfke
On Sep 21, 2009, at 11:31 PM, Kyle Sluder wrote: On Mon, Sep 21, 2009 at 11:30 PM, Erick Calder wrote: wow. ok. I guess that's not going to help much then. I must say that without daemons the range of applications possible seems rather quite narrow to me. Background processing is a m

Re: RTF in MultilineTextField

2009-09-22 Thread Jens Alfke
On Sep 22, 2009, at 9:12 AM, Arun wrote: I have written a sample code which displays the contents of RTF file in Mutiline text filed. The RTF file has a text which is styled like a web-link. when i run the program, the link appears as a normal text. But if i click on the textfiled area it appea

Re: Suppressing Crash Reporter dialogs for a task

2009-09-22 Thread Jens Alfke
On Sep 22, 2009, at 9:47 AM, Mark Woods wrote: However, when the task crashes, a Crash Reporter dialog appears which could be confusing for the user and ugly if several appear at once. Is there any way to suppress these messages and prevent them from appearing? I'm pretty sure there is,

Re: Strategies for tracking a tricky (typing) slowdown/lag bug

2009-09-22 Thread Jens Alfke
On Sep 22, 2009, at 3:51 PM, Keith Blount wrote: Initial tests suggest this has improved things a little, but I'm not confident it's the only cause. The way that typing would get slower and slower over time, and then speed up again once the app was quit and relaunched, means that I'm still

Re: an app that never quits

2009-09-22 Thread Jens Alfke
On Sep 22, 2009, at 3:44 PM, Erick Calder wrote: one final recourse of a solution for me: is there such a thing as cron on the iPhone whereby I could schedule a bit of processing to occur every x seconds? No. The current policy on the OS is that 3rd party code does not execute unless the

Re: Getting content out of a WebView

2009-09-23 Thread Jens Alfke
On Sep 22, 2009, at 5:53 PM, Eddie Aguirre wrote: getting the data from the WebView through the mainFrame and dataSource works for the initial contents but not the edited contents. The dataSource always returns the unedited content. I've tried editing in the WebView then turning off edit

Re: app delegate +initialize

2009-09-23 Thread Jens Alfke
Does your class have a subclass, which also has a +initialize method, which doesn't call [super initialize]? That might cause this sort of behavior, because the order in which the classes load may be indeterministic. In general, you cannot predict the order in which objects/classes are in

Re: automatically send the email from code using NSWorkspace

2009-09-23 Thread Jens Alfke
On Sep 22, 2009, at 8:37 PM, jon wrote: great, found it, Thank you. do you (or someone) know how to get the current machine's default Email address for sending email? I personally don't have a default email address. I have one for home and two for work, and which one I want to use i

Re: Strategies for tracking a tricky (typing) slowdown/lag bug

2009-09-23 Thread Jens Alfke
On Sep 23, 2009, at 6:55 AM, Keith Blount wrote: So now that I know it's CPU, the question is, how do I track it, given that I've been having poor luck with Activity Monitor and Shark in finding the problem areas of code? What I don't understand is how more and more CPU can get eaten up li

Re: Stability on Snow Leopard

2009-09-23 Thread Jens Alfke
On Sep 22, 2009, at 8:16 PM, Navneet Kumar wrote: My intention was to get some general responses on two things: Memory Management in a program on SnowLeopard (strictly needed?) and the need for code signing. Code signing has nothing to do with app stability. What it does is guarantee to

Re: Creator Codes in Snow Leopard

2009-09-23 Thread Jens Alfke
On Sep 23, 2009, at 9:06 AM, Gerriet M. Denkmann wrote: So I looked at Launch Services Reference, but could not figure out, how to inform Lauch Services which app to use for some document. But if Finder can tell Lauch Services, then my app should be also able to do this, shouldn't it? Where

Re: app delegate +initialize

2009-09-23 Thread Jens Alfke
On Sep 23, 2009, at 9:44 AM, Matt Neuburg wrote: Whoa, whoa. Let's be fair. There is some common initialization (such as registering defaults, esp. when bindings are also involved) that *must* be done in +initialize, as awakeFromNib is not early enough. Sorry, you're right. In that senten

Re: Trying to reproduce a feature of Xcode's interface

2009-09-23 Thread Jens Alfke
On Sep 23, 2009, at 12:31 PM, Rui Pacheco wrote: How do you create that row? How do you keep a row of segmented cells centered? It's probably an NSSegmentedControl with springs on both the left and right sides. —Jens___ Cocoa-dev mailing list (

Re: [__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-23 Thread Jens Alfke
On Sep 23, 2009, at 2:27 PM, Matt Gough wrote: NSEnumerator *iter = [myMutableArray objectEnumerator]; while (syncInfo = [iter nextObject]) { ... Do some stuff } That's not a fast enumerator; that's the old-fashioned slow enumerator. (Although as alr

Re: [__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-23 Thread Jens Alfke
On Sep 23, 2009, at 6:10 PM, Graham Cox wrote: I thought that NSEnumerator was implemented in terms of fast enumeration "underneath" - the docs seem to imply that, as does the existence of __NSFastEnumerationEnumerator private class. It may be still slower than directly using the fast enum

Re: How to do what Finder does programmatically

2009-09-23 Thread Jens Alfke
On Sep 23, 2009, at 9:38 PM, Gerriet M. Denkmann wrote: If the document is a file, Finder will add a 'usro' resource which contains the absolute path to the application to be used. Thanks to Alistair who pointed me to: So th

Re: iPhone to Mac Synchronization

2009-09-24 Thread Jens Alfke
On Sep 24, 2009, at 6:38 AM, Ricky Sharp wrote: This is possible, but only over WiFi. I'm currently working on a feature to do bi-directional syncing between the Mac and iPhone versions of my app. I'm also using Bonjour for self-discovery (if you go this route, make sure to register your s

Re: How to use Authenticator example to a remote machine?

2009-09-24 Thread Jens Alfke
On Sep 24, 2009, at 4:11 AM, Arthur C. wrote: The example is for inter-application communication on one machine; I'd like to have that between two machines... NSConnection is part of Distributed Objects. It's possible to run DO between two machines across a TCP connection, but it takes a bi

Re: Subview drawn with reverted order

2009-09-24 Thread Jens Alfke
On Sep 24, 2009, at 4:28 PM, gMail.com wrote: It seems that the Front-Back drawing order of the subviews has been reverted. How to fix this problem? Overlapping sibling views aren't really supported in AppKit. If you want to do this kind of thing, you're better off using CoreAnimation lay

Re: Correct way to tell if a path is to a .bundle?

2009-09-24 Thread Jens Alfke
On Sep 24, 2009, at 6:41 PM, Rick Mann wrote: I'm scanning a directory for plugins for my app. Given a path, what's the right way to tell if it's a path to a bundle? -[NSWorkspace isFilePackageAtPath:]. —Jens___ Cocoa-dev mailing list (Cocoa-dev@

Re: Remove NSTableView Default Selection

2009-09-24 Thread Jens Alfke
On Sep 24, 2009, at 5:07 PM, John McIntosh wrote: I assumed that I could send the same deselectAll message in either an awakeFromNib function or applicationDidFinishLaunching. However, neither of these clears the selection. Make sure you've checked the table's "Empty" checkbox (allow empty

Re: Correct way to tell if a path is to a .bundle?

2009-09-25 Thread Jens Alfke
On Sep 24, 2009, at 9:51 PM, Rick Mann wrote: Thanks Jens. If I create a custom extension for my plugins (not even sure I can do that), will this still work? Yup, as long as you declare the extension properly in your Info.plist and indicate that it's a bundle. —Jens__

Re: How to create a control just as RGB Sphere and Alpha bar

2009-09-25 Thread Jens Alfke
On Sep 25, 2009, at 3:02 AM, Florian Soenens wrote: http://www.google.com/search?client=safari&rls=en-us&q=cocoa+get+pixel+rgb+value&ie=UTF-8&oe=UTF-8 In this case it might be better to check http://lmgtfy.com/?q=cocoa+get+pixel+rgb+value first. One of my favorite references in these sorts

Re: Correct way to tell if a path is to a .bundle?

2009-09-25 Thread Jens Alfke
On Sep 25, 2009, at 12:12 PM, Rick Mann wrote: LSTypeIsPackage Shouldn't that be true, not false? —Jens___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the li

Re: Correct way to tell if a path is to a .bundle?

2009-09-25 Thread Jens Alfke
On Sep 25, 2009, at 8:52 AM, Sean McBride wrote: So while you should absolutely do as Jens says, you should additionally set the bundle bit for packages you create. See 'man SetFile'. SetFile -a B /path/to/package. Sounds like good advice, but SetFile is a command-line tool, not an API

Re: redrawing a particular subview in non mainWindows.

2009-09-27 Thread Jens Alfke
On Sep 27, 2009, at 7:04 AM, jon wrote: so far i can find the chain of windows, like this, but i can't figure out how to go deeper into them to be able to udpate the custom view down deep maybe i'm approaching it wrong too... The best way to do this is to use NSNotification. Post a

Re: NSURLConnection upload to iDisk works with iPhone OS 2.x but fails on 3.x

2009-09-27 Thread Jens Alfke
On Sep 27, 2009, at 2:25 AM, Sergey Shapovalov wrote: This makes me think that chunked upload from stream via NSURLConnection has been broken in iPhone OS 3.x. Unfortunately, in real life I can't upload my file by using setHTTPBody instead of setHTTPBodyStream because it's too big to store

Re: Xcode3.2 build and analyze warning for NSString allocation

2009-09-27 Thread Jens Alfke
On Sep 27, 2009, at 2:03 AM, Nick Rogers wrote: 1. Method returns an Objective-C object with a +1 retain count (owning reference). It means exactly what it says. The string was created by -alloc, so you own a reference so it, so you need to call -autorelease on it before returning it.

Re: Best Design Advice

2009-09-27 Thread Jens Alfke
On Nov 14, 2009, at 9:21 AM, David Blanton wrote: I need to create an app the is auto downloaded and installed from a web site when the user clicks a web page button. It can be downloaded when the user clicks a button, but of course it can't automatically run or be installed that way; that

Re: where to release a CF object thats retained by a cocoa object

2009-09-27 Thread Jens Alfke
On Sep 27, 2009, at 10:11 AM, Navneet Kumar wrote: // Shall I do CFRelease(outputVolumeName); here? Yes. You have to call CFRelease on any reference you got via a xxCopyxx or xxCreatexx function. —Jens___ Cocoa-dev mailing list

Re: redrawing a particular subview in non mainWindows.

2009-09-27 Thread Jens Alfke
On Sep 27, 2009, at 11:19 AM, jon wrote: the question it appears to me is: that this "treeController" also is made into multiple instances with each new Document, is there an already defined "loop" of these? (a list of the open document's NSTreeController *treeController;) No. I thin

Re: how do i make SecKeyRef object from NSData of publicKey value

2009-09-28 Thread Jens Alfke
On Sep 27, 2009, at 8:57 PM, bosco fdo wrote: I need to do RSA encryption for that i need to have SecKeyRef object for the public Key i have. Do i still need to add to the Keychain and get from the Keychain as a SecKeyRef ? Doing crypto with the Security APIs is rather complex and unintuitive

Re: Crash in +[NSMethodSignature signatureWithObjCTypes:]

2009-09-28 Thread Jens Alfke
On Sep 28, 2009, at 8:17 PM, Andrew Thompson wrote: Thread 68 Crashed: Dispatch queue: com.apple.root.default-priority 0 com.apple.CoreFoundation 0x7fff85ed8713 + [NSMethodSignature signatureWithObjCTypes:] + 403 1 librococoa.dylib 0x0001145fa416 -[ProxyForJava

Re: Separate WebViews?

2009-09-28 Thread Jens Alfke
On Sep 28, 2009, at 1:49 AM, charlie dropbox wrote: I was looking around for cookie state or some separation of data sharing between WebViews. There's a singleton NSHTTPCookieStorage object that you can use to interact with cookie storage. But the design is such that there is one single

Re: Efficient searching of an NSArray of NSDictionary

2009-09-29 Thread Jens Alfke
On Sep 29, 2009, at 7:38 AM, Pascal Harris wrote: I have an application with an NSArray of NSDictionary (with 18 keys) which populates an NSTableView. I am concerned that my method of accessing the contents of my array are sub-optimal and I'm therefore seeking advice from the experts.

Re: simpleBrowser example has setCellClass setting a cell to an instance?

2009-09-29 Thread Jens Alfke
On Sep 29, 2009, at 5:19 PM, jon wrote: [fsBrowser setCellClass: [FSBrowserCell class]]; fsBrowser is an instance, IBOutlet NSBrowser*fsBrowser; yet isn't setCellClass a class method? No, it's a regular instance method; just look in NSBrowser.h: - (void)setCellClass:(Class)facto

Re: Static Analyzer Question

2009-09-29 Thread Jens Alfke
On Sep 29, 2009, at 5:12 PM, Steve Cronin wrote: "…. Object with +0 retain counts returned to caller where a +1 (owning) retain count is expected" this is shown at the end of a particular method. I think this means the method has a name that by convention indicates that it returns a refer

Re: The principle of the "iTunes Syncing"?

2009-09-30 Thread Jens Alfke
On Sep 29, 2009, at 11:30 PM, Kyle Sluder wrote: 2009/9/29 James : Now I am developing an cocoa application. One of the app's function is to synchronize the audio and video files to the iPod/iPhone. The function is same as the "iTunes Syncing" function. You have no access to the user's

Re: Displaying a string with Core Animation

2009-09-30 Thread Jens Alfke
On Sep 30, 2009, at 3:41 AM, Gabriel Zachmann wrote: This sort of works, EXCEPT that the string is always behind the image! I tried to set the zPosition of my image sub-layer to either +1.0 or -1.0, to no avail. I think layers are always drawn in front of the view's own content. I also tri

Re: NSTimer and modal panels

2009-09-30 Thread Jens Alfke
On Sep 30, 2009, at 5:03 AM, Ken Thomases wrote: However, exactly because it's so tricky, the Cocoa frameworks are not going to just arbitrarily invoke your code on some random thread. Yup. Generally, the only time your code will run on a secondary thread is if — You create an NSThread —

Re: NSRunLoop method - configureAsServer alternative in 10.6.1?

2009-09-30 Thread Jens Alfke
On Sep 30, 2009, at 9:17 AM, Christopher Kane wrote: Since time immemorial the implementation looked like this: - (void)configureAsServer { } So any apparently beneficial effect of calling it was entirely coincidental. No way! I know people who were cured of cancer by calling - configureAs

Re: Sleep, NSWorkspaceWillSleepNotification, 30 seconds and the run loop

2009-09-30 Thread Jens Alfke
On Sep 30, 2009, at 9:59 AM, jonat...@mugginsoft.com wrote: Before entering sleep I would like to send small amounts of data via async instances of CFSocket to the local and some remote hosts. It's usually best to close open sockets entirely before going to sleep. The socket might not work

Re: Releasing NSSearchPathForDirectoriesInDomain causes crash

2009-10-01 Thread Jens Alfke
On Sep 30, 2009, at 7:37 PM, Adam R. Maxwell wrote: Does the Cocoa memory management documentation cover functions? It specifically refers to "...a method whose name begins with...". I wonder if something like the CF "Create" rule applies to Foundation? No — Foundation functions almost n

Re: Sleep, NSWorkspaceWillSleepNotification, 30 seconds and the run loop

2009-10-01 Thread Jens Alfke
On Sep 30, 2009, at 1:32 PM, jonat...@mugginsoft.com wrote: I intend to send off my bit of data, hang around ( <= 30 secs) to get notification and then close everything. Why do you need to wait at all? —Jens___ Cocoa-dev mailing list (Cocoa-dev@l

Re: Bad stardardUserDeafaults

2009-10-01 Thread Jens Alfke
On Oct 1, 2009, at 2:19 PM, Jacob Schwartz wrote: NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary]; NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"/ Users/jacobschwartz/Pictures/wallpapers"]]; NSData *pathAsData = [NSKeyedArchiver archivedDataWithRootO

Re: very newbie question

2009-10-01 Thread Jens Alfke
On Oct 1, 2009, at 2:39 PM, Manuel Grau wrote: I have my own controller classes for each view. The problem is that my IBAction method that receives button event is in fourthViewController, so I can't acces fields in the other views to get the values I need. So, which is the usual way to do

Re: reading (parsing) CSV (or Excel) data

2009-10-01 Thread Jens Alfke
On Oct 1, 2009, at 4:09 PM, Colin Howarth wrote: Before I go through the 550,000 hits (some of them quite old) dare I ask if there's one Right Way (TM) to parse this sort of data? If the data's not too huge, you can read the file into an NSString, break that into lines (there are some NSSt

Re: Sleep, NSWorkspaceWillSleepNotification, 30 seconds and the run loop

2009-10-02 Thread Jens Alfke
On Oct 2, 2009, at 2:50 AM, jonat...@mugginsoft.com wrote: Seems that by the time I get the IOKit sleep notification my Bonjour service has already disconnected so my packets end up going nowhere anyway. How exactly is your Bonjour service implemented? Bonjour itself only does service di

Re: odd behavior with NSError?

2009-10-02 Thread Jens Alfke
On Oct 2, 2009, at 4:05 AM, Gregory Weston wrote: It would be a good idea to get into the habit of initializing your local variables at the point of declaration. At the risk of starting a religious debate, I disagree. It makes the code somewhat bigger and slower, and worse, it can mask uni

Re: Auto Install Login Item

2009-10-03 Thread Jens Alfke
On Oct 3, 2009, at 12:38 PM, Todd Heberlein wrote: On Oct 3, 2009, at 12:30 PM, David Blanton wrote: Should my cocoa app write an entry to com.apple.loginitems.plist so it launches at login or is there a better way? Look at the documentation for launchd. No, launchd is not in charge of u

Re: main nib, firing a secondary nib and it's controller....

2009-10-03 Thread Jens Alfke
On Oct 3, 2009, at 4:19 PM, jon wrote: i want to have a WindowController object and it's own nib separate from the main nib.. but i want this secondary nib and controller to fire up when the application launches... Create and open an instance of that WindowController subclass from yo

Re: Keeping NSWindow below all other windows

2009-10-03 Thread Jens Alfke
One oddity of low window levels is that below some level the windows become immune to Exposé, i.e. they stay in place. I think this happens because the Finder's desktop icons are in fact windows at a very low level, and Exposé needs to leave them alone. This can be a useful effect if you wa

Re: Probs with "BetterAuthorizationSample"-code

2009-10-03 Thread Jens Alfke
On Oct 3, 2009, at 6:04 AM, Frank W. Tag wrote: 1. How can I debug my HelperTool? Obviously any breakpoints set in XCode won't work because the HelperTool is launched outside by the launchd. You can use Xcode's Run > Attach command to attach GDB to it once it's launched. (Hopefully Xcode

Re: Working with an Unsupported Character Encoding (ANSEL)

2009-10-03 Thread Jens Alfke
On Oct 3, 2009, at 8:11 AM, Thomas Wetmore wrote: 1. Apparently reading a file to an NSString using the NSASCIIStringEncoding returns each of the bytes of the file exactly as they were, that is, the 8-bit bytes seem to be read exactly as they were. So is it true that reading with NSASCIISt

Re: [Performance issue] Resizing an alert sheet => blinks

2009-10-05 Thread Jens Alfke
On Oct 5, 2009, at 3:12 PM, Iceberg-Dev wrote: Is it the intended behavior that resizing an Alert Sheet in Mac OS X 10.5.8 on a MacBook Pro produces a lot of blinking? I have a custom alert sheet that can be resized and when I resize it on a MacBook Pro (either 9400 or 9600 GPU), the resize

<    3   4   5   6   7   8   9   10   11   12   >