Re: NSPipe (NSFileHandle) writedata limit?
On 12 Apr 2010, at 10:56, McLaughlin, Michael P. wrote: Greg Guerin wrote The fundamental design is send all data before looking for any results. This is inherently synchronous, even though two or more processes are involved. If the subtask is designed to read all data before producting any results, then it shouldn't deadlock. However, if the subtask is designed to read some data, produce some results, then it is prone to deadlock. In my app so far, I have not even gotten to the point where the subtask produces any output. I am sending all data from main but main blocks iff the number of bytes sent 65536. What I think you're missing here is that pipes have a finite capacity -- this is 64K in current releases of OS X, as you've discovered, but POSIX guarantees only that it will be at least 512 bytes. As such, writing data to a pipe and then beginning to read bytes from the other end WILL cause deadlocks; you will need to start reading data from the pipe at the same time as data is being written to it. In practical terms, this means either ordering the reading end to start reading before beginning to write data to the other end, or adding the pipe fd as a runloop source.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cant read second table from same sqlite database iphone
On 10 Apr 2010, at 18:02, charisse napeÿf1as wrote: //get the name and the score int iDen = sqlite3_column_int(statement, 0); NSString* name = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 0)]; Surely column 0 cannot be both an integer and text. Which one is it?___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Removing quit button from dock menu
On 24 Feb 2010, at 05:09, Arun wrote: I think what Yogin is looking for is something like what Finder has. The finder doc menu does not has the Quit option in it. Well i wish i could have given the solution if i were to know how finder has did it. Unfortunately i am Novice in cocoa..!!! The Finder is handled as a special case in the Dock -- it has different menu options than all other applications, and can't be moved away from the end of the Dock. As far as I am aware, there is no way to make the Dock handle any other application in this way.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to call on id
On 24 Feb 2010, at 19:43, David Blanton wrote: I misspoke earlier. What I want to do is access an an ivar in m_view such as m_cpp wher m_cpp is an instance of a C++ class and then call functions on m_cpp such as m_view-m_cpp.Function() but I get 'struct objc_object' has no member named 'm_cppr' Your best bet is to either: 1. Declare m_cpp as @public in the class's @interface, cast m_view to the correct class, and access m_cpp as shown above, or - better yet - 2. Define an accessor method on the class and use it: [m_view mCppAccessorThing].Function();___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How is the best way to emulate the plist editor GUI?
On 14 Feb 2010, at 22:35, Juanma Cabello wrote: I have a simple object that only has a NSMutableDictionary where I store all the Apache configurations parameters. That's the collection I want to bind. I know it's a bit of a tangent, but that representation isn't going to work very well. Particularly when mod_rewrite becomes involved, Apache configuration values don't follow a strict key-value pattern: a single directive may appear multiple times with similar (or even identical) values, and the order of directives can affect their meaning.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: RegisterEventHotKey and keylogging
On 6 Feb 2010, at 02:34, Michael Vannorsdel wrote: I found that I can hotkey any keys and then use CGEventPost to post the key to the front application. This effectively lets me track all the keys the user presses from a non-privileged application while still sending input to the key window/process. I was also able to see my admin pass as it was typed in to an authentication window without any side-effects. Am I missing something or is this a security flaw? That sounds like a potential bug. Report it: https://bugreport.apple.com/___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Touch: Non-rectangular Touch areas
On 6 Feb 2010, at 11:05, Jens Alfke wrote: The easiest way to do this is to create an NSBezierPath in the shape of the trapezoid and call -containsPoint: on it; but IIRC, that class doesn't exist on iPhone. Fortunately the math for hit-testing convex polygons is pretty easy: check any computer graphics textbook for details. Another simple approach is to use an image to do hit testing. You can either create a bitmap image for each touchable area, or a single image with a different color for each target, then test the color at the target point to determine membership. My only concern with using this approach on iPhone might be the memory usage of that image.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Revolving scoreboard
On 3 Jan 2010, at 15:24, Mike Abdullah wrote: Core Animation is the perfect tech for this. Probably by using layer-backed table views to display the scores. Quartz Composer is also worth looking into if you're after a full-screen display with a minimum of coding. The default RSS and Word Of The Day screensavers both make use of QC, if you're looking for examples. As an added bonus, it uses Javascript internally for the logic that can't be implemented with the built-in patches, so it'll be an easy step up for the OP.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Dynamically update drawRect
On 27 Dec 2009, at 01:18, proger proger wrote: I'm still don't know how to do it. As solution i see programmically create MyView class and call drawRect function as i needed. There is rarely any good reason to call drawRect yourself. It should only be called by the AppKit drawing internals. Because now MyView(NSView) is created by nib. And i can't call MyView class instance methods. Why not? This is the basis of most (non-KVO) view programming.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Any way to keep on pane of NSSplitView from resizing?
On 27 Dec 2009, at 16:41, Rick Mann wrote: I have an NSSplitView that divides my window in to two panes (vertically). When the window is resized, I'd like the left pane to keep the width it has, rather than having both panes resizing proportionally. Is this possible? Sure. Even without getting BWToolkit involved, a split view delegate can control what goes where when the view gets resized.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: IPhone app passing info into Desktop app
On 26 Dec 2009, at 06:54, Chad Eubanks wrote: Does anyone know of an example that has an iPhone app passing information to a desktop app? Could this be done with CoreData or should I be looking into a webview based app? Neither CoreData nor WebView are appropriate technologies for what you're describing. CoreData's purpose is managing object graphs, and WebView's purpose is displaying web pages. Neither one is particularly proficient at contacting a remote system and transferring data*. Depending on what you're wanting to do here, you'll probably want to look into either Sync Services or Bonjour / sockets. (*: While WebView superficially fits the bill, it's the wrong approach entirely.)___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Diacritics in Thai
On 17 Dec 2009, at 16:41, Randall Meadows wrote: If this is such an emergency for you, open up a DTS support incident. Good luck, you're gonna need it. Alternatively, ignore AppKit and implement the comparison yourself! AppKit does not demand your undying devotion; you're perfectly free to go off on your own whenever it's more convenient for you to do so. (And, again, good luck. You will still need it.)___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sending a non http request
On 15 Dec 2009, at 14:22, Development wrote: I am trying to post data to NSString * url = [NSString stringWithFormat:@ipp://%@:%i/%@,host,[service port],item]; Which as you can see is an ipp address. However the code below fails as I get an error from the NSError that I am using an unsupported url. Obviously if I send it as http:// all I get is the cups page. So the question then is how to format this url or how to send the request. This is more of a question about IPP than about Cocoa... start reading up on how IPP works. http://tools.ietf.org/html/rfc2910 http://tools.ietf.org/html/rfc2911 Once you've figured out how to properly format the request, just call it HTTP and send it off. If you're still just getting the CUPS page, your request isn't formatted properly.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: memcpy with 64 bit
On 14 Dec 2009, at 11:06, gMail.com wrote: Handle imagesH = NewHandleClear(totImages * oneImageSize); Wait, Handle? NewHandleClear? Your use of these functions suggests that you may be working from a dangerously old textbook. There's really no reason to use them in new code.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSNumber stringValue
On 12 Dec 2009, at 09:32, Ben Haller wrote: You should not compare floating point numbers for equality in most cases. This is true of any language on any platform. Indeed, some floating-point numbers (such as the one represented by the integer 0x7fc0) will compare as not equal to themselves: I think what the OP really wanted to know (and I'm interested in the answer too) is whether going out to the stringValue and back to the doubleValue is guaranteed to yield a float that is bitwise identical to the original float, or whether there is drift in the least significant bit or two due to the changes in representation. Anyway, even if that's not the OP meant, that's what I'd like to ask. :- Nope, there are trivial counterexamples there too. All NaNs stringify to nan, for instance, and all infinities stringify to either inf or -inf, depending on sign. (And, even if you only care about finite numbers, Andy Lee has an excellent counterexample for that as well.)___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSNumber stringValue
On 11 Dec 2009, at 21:14, Bryan Henry wrote: You should not compare floating point numbers for equality in most cases. This is true of any language on any platform. Indeed, some floating-point numbers (such as the one represented by the integer 0x7fc0) will compare as not equal to themselves: { union { float f; long i; } u; u.i = 0x7fc0; if(u.f == u.f) printf(As expected.\n); else printf(How strange.\n); }___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Localizing Xibs using bindings
On 5 Dec 2009, at 10:05, Rossi Matteo wrote: I find it very annoying to localize Xibs by keeping a copy for each translation. It's both tedious and error-prone. I've found that by simply binding each button's title (or wharever other control you need) to the appropriate key of a NSDictionary object I can easily localize each item. No need to create tons of outlets for each control. Indeed I have no outlet at all. It works smoothly and I can send only .strings files to my translators. Since I haven't found no article on this solution, I was wondering if it's wrong or which problems may arise. Obvously I take care to keep control sizes large enough to host each translation. Among other issues, it will make your application look backwards in RTL languages.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Heap and memory zone queries
On 6 Dec 2009, at 13:57, jonat...@mugginsoft.com wrote: 1. GC is on. Does that mean that all allocations invocation by NS*/CF* will be in the auto_zone? Not necessarily. AppKit and CoreFoundation objects are still capable of allocating unmanaged memory (via malloc(), for instance) for their use under garbage collection, so long as they clean it up when they're done with it. 2. Are the allocations accomplished using NSZoneMalloc and CFAllocatorAllocate? Not sure on this one - I'll defer to someone more knowledgable. 3. grepping the heap(1) output shows little data allocated to NSText* instances. Is some of the 40MB of non-object data allocated by the NSText system? for glyph storage?` 4. If 3 is not utterly incorrect - why isn't the memory utilised by the NSText system flagged as being allocated by NSText*. All that #3 means is that the NSText objects themselves are small. heap(1) is relatively simplistic - it can't determine that one allocated object belongs to another. If a NSText object allocates a bunch of CTRun objects (for instance), those allocation will be billed against CTRun, not NSText.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: applicationShouldTerminate problem
On 3 Dec 2009, at 00:25, proger proger wrote: I'm making little cocoa application. After the application will be closed i need to show alert. So i created applicationShouldTerminate delegate: - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app { if (textChanged == 1) { int ret = NSRunAlertPanel(@Save the work?, @Do you want save the work?, @Yes, @Cancel, @No ) ; You are reimplementing NSDocumentController, awkwardly. Read this before you continue: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Documents/Documents.html Don't reinvent the wheel!___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: dynamic NSPointArray allocation
On 1 Dec 2009, at 05:27, Jonathan Dann wrote: Just use NSPointerArray... Just as is the case with an array of NSValue objects, NSPointerArray doesn't help here -- it makes no guarantees about how the objects will be arranged in memory, and NSBezierPath needs them to be contiguous.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Download Alert -- Quarantine information removal
On 1 Dec 2009, at 22:04, John Joyce wrote: Please do not do this. Please read the documentation on why this is there and what is expected behavior. Code Signing does not prevent this. Even Apple software that is downloaded internally triggers the quarantine message to users on first launch of that software. No, I think you're conflating two different warnings here - there's one warning for first time you've opened X, and a separate warning for first launch of quarantined app. The former only shows up once, but the latter will show up every launch if you don't have permissions to clear the quarantined attribute -- which is why it's important to clear that up in an automated install. :)___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cast NSNumber to int
On 28 Nov 2009, at 03:20, Philip Vallone wrote: I want to cast a NSNumber to int. When I execute the below code, my result should be 1, not 68213232. What am I doing wrong? You are trying to cast a pointer to an integer and expecting meaningful results. Don't. If you want to get the numeric value of a NSNumber object, use its intValue (or floatValue, longValue, etc.) method.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: dynamic NSPointArray allocation
On 28 Nov 2009, at 15:12, Henry McGilton (Boulevardier) wrote: Another possible approach is simply use a NSMutableArray full of NSValue objects that contain the NSPoint structures . . . I don't believe that'll work - storing everything in NSValue objects will end up scattering the actual NSPoint structures to the four winds, which isn't much use when you need a contiguous array of them (a NSPointArray) to pass to NSBezierPath.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Conversion of CFSocketCreateWithNative - NSSocketPort
On 27 Nov 2009, at 06:48, Michael Ash wrote: There's no Cocoa version of this, as far as I know. However, CFSocketCopyPeerAddress is just a wrapper around the POSIX function getpeername(), so you can just get the native socket from your NSSocketPort and then call that. Or just keep using CFSocketCopyPeerAddress. Using CoreFoundation is not a crime - it's just as much a part of OS X as Cocoa is, and it's not going to be removed at any point in the foreseeable future.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: My try/catch block isn't catching exceptions on 10.6
On 27 Nov 2009, at 11:40, Mark Allan wrote: Isn't it the case that you only need locks around something if you plan that it will be modified by more than one thread at a time, or if you write to it in another thread and care that any read operation will be predictable? No, that is not the case. An object that is described as not thread-safe may enter an inconsistent state while being modified that will cause a crash or data corruption if accessed. Moreover, there is no guarantee that accessor methods will not modify internal state of an object (to cache results, for instance, or to control access to another object). Short version - if an object is not described as being thread-safe, never try to do *anything* with it from multiple threads at a time. Otherwise, you're just asking for trouble.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How can I not block hotkey from other apps
On 23 Nov 2009, at 07:17, Symadept wrote: I managed to get my app support for registering hotkeys and using it. But unfortunately if I register Cmd P as hot key in my app, no one in the system can use this hotkey to print unless I deregister it. How can I make it not block others. If you don't want to make your hotkey active in all applications, RegisterEventHotKey is probably the wrong approach. Is there any specific reason you can't set this up as a menu keyboard shortcut, or by catching the event in -[NSApplication sendEvent:]?___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Keeping NSView square
On 19 Nov 2009, at 00:10, Kyle Sluder wrote: 2009/11/18 Andrew Farmer andf...@gmail.com: Don't. Arbitrarily changing the size of your view in setFrame: makes AppKit lose track of what size your view was, making it impossible to restore the original size later. Cut the view down to square at draw time instead. This sounds like an even worse idea. To be more specific - I wasn't suggesting adjusting the size of the view at draw time, or refusing to draw the entire dirty rect, but simply performing the min(frame width, frame height) calculation at draw time and drawing the view's content into the minimized rect. -resizeWithOldSuperviewSize: sounds like an excellent alternative, though, and probably more on-target.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Keeping NSView square
On 18 Nov 2009, at 04:38, Henri Häkkinen wrote: I'm making a custom NSView derived class and I need the view to have a fixed width/height ratio at all times, specifically I would like the view to stay square. I am trying to override the setFrame: method like this... Don't. Arbitrarily changing the size of your view in setFrame: makes AppKit lose track of what size your view was, making it impossible to restore the original size later. Cut the view down to square at draw time instead.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Multiple variable rules in for() statement
On 12 Nov 2009, at 11:50, David Ross wrote: GCC does not like declaring variables in a for statement. Adding -std=c99 or -std=gnu99 to the compiler flags will fix that. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Close/Minimize the app
On 11 Nov 2009, at 21:23, kirankumar wrote: this will help you keep this 3lines of code in awakeFromNib, and mpwindow is you are window name. id closeButton = [mpWindow standardWindowButton:NSWindowCloseButton ]; [closeButton setAction:@selector(closeapp:)]; [closeButton setTarget:self]; No, don't do that. See -[NSApplication applicationShouldTerminateAfterLastWindowClosed:] for the correct approach. - (IBAction)closeapp:(id)sender { exit(0); } I'm pretty sure that this will end up skipping most cleanup routines (including important ones, like syncing dirty preferences). NSApplication has a terminate: method for a reason.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Drag-Move the Transparent windowed app over the screen
On 12 Nov 2009, at 01:58, kirankumar wrote: goto attributes for your window ,enable the texture checkbox so that you can drag your window. While this does have the desired effect, there is a much more direct approach available (which Dave Keck has hinted at).___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: beginner question, NSNumber, NSDecimalAsNumber
On 9 Nov 2009, at 10:49, Jeffrey Oleander wrote: Last I looked, 1-bit count was an assembly/ hardware instruction. Getting the highest order on-bit required a little cleverness. Take a look at __builtin_clz(). (It maps to 'bsr' on x86.) ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: beginner question, NSNumber, NSDecimalAsNumber
On 8 Nov 2009, at 08:53, Jay Swartzfeger wrote: Hi all, I'm an absolute beginner to Objective-C (and programming in general). I have lots of books on order, but I've been messing with Xcode/Cocoa/iPhone SDK with online resources while I wait. My question -- for my next project, I want to do a simple number - binary converter. Is this handled via the superclass NSNumber, or the more specific NSDecimalAsNumber? I've been looking for examples online and have come up empty handed. Thanks! NSNumber, if anything. The conversion to and from binary is probably best done by hand using the C bitwise operators, though. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Getting a handle on inf
On 26 Oct 2009, at 12:11, Ian Piper wrote: ...and I still get a failed build with this message: Expecting inf; we got inf Which seems odd. And internally, this is because the IEEE float machinery guarantees that all infinite and NaN values compare as not-equal to each other, so that 1/0 != 2/0, 1e100 != 1e100 + 1, and so on. Sadly, this also means that some floats will compare as not equal to themselves -- an unfortunate, but necessary result. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Crash drawing image
On 24 Oct 2009, at 10:36, slasktrattena...@gmail.com wrote: And after the crash, gdb is confused and can't get info about the process? Sort of. I think the problem is no app can have keyboard focus as long as the screensaver is running/frontmost. So Xcode is not responding to keyboard events until I terminate the process. Try SSHing in from another machine and attaching to the process that way? ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Getting a view's size?
On 18 Oct 2009, at 22:45, patrick wrote: Thank you! That was exactly the problem. :) While we're at it, don't forget about NSStringFromRect(). No need to write format strings yourself when Apple's done it for you -- and written a parser to go with (NSRectFromString). ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSURLRequest SSL Mac vs iPhone
On 16 Oct 2009, at 00:48, Greg Hoover wrote: I have the same piece of code making a secure request to a server in a Mac application and in an iPhone app. Both use an NSURLRequest with exactly the same settings, message, body, etc. On the Mac, the request succeeds, returning the data expected. On the iPhone however, the request fails with an untrusted server certificate error (NSURLErrorDomain -1202). My guess is the root certificates are different on the two platforms. Just a guess, but if the server you're connecting to is using a cert signed by a weird authority, that might be it. I suspected that the iPhone implementation somehow doesn't have access to the root certificates, so I checked on the servers SSL cert using openssl. Openssl says: unable to verify the first certificate. So now I figure that the Mac (10.6.1) implementation just allows the request to proceed when the verification fails (it doesn't return an error of any kind actually). Can anyone shed some light on this? OpenSSL is a red herring. NSURLRequest doesn't use openssl to verify certificates. In fact, openssl has no root certs installed at all by default on OS X, so it'll fail to verify any certificate at all. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: UITextField formatting for IP Address
On 16 Oct 2009, at 17:54, Alex Kac wrote: Here is my code, btw. It works OK, but it still has the issue of moving the cursor to the end. Perhaps there is no way to do this on the iPhone - I just don't want to bang my head for hours. - (void)formatForIP:(UITextField*)textField string:(NSString*)string { long long ip = [[string stringByReplacingOccurrencesOfString:@. withString:@] longLongValue]; NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init]; [numberFormatter setNumberStyle:NSNumberFormatterNoStyle]; [numberFormatter setPositiveFormat:@###,###,###,###]; [numberFormatter setGroupingSize:3]; [numberFormatter setSecondaryGroupingSize:3]; [numberFormatter setGroupingSeparator:@.]; [numberFormatter setUsesGroupingSeparator:YES]; textField.text = [numberFormatter stringFromNumber:[NSNumber numberWithLongLong:ip]]; [numberFormatter release]; } This isn't a valid approach to formatting IP addresses - it considers 12.34.56.78 to be equal to 12.345.678, which isn't even a valid address, let alone equivalent. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: A good Obc-C framework for sending email?
On 15 Oct 2009, at 13:34, Ben Haller wrote: Hi all. I need a good Obj-C framework for sending email. I used to use the Message.framework associated with Apple's Mail, but they killed that a long time ago, sadly. Then I used Pantomime; but it seems to also be abandoned, now, and it is crashing on 10.5 (and it was never terribly reliable anyway). Does anybody know of a good replacement? I haven't had any luck trying to find one using Google. Keep in mind that many users may not have any SMTP server configured -- an increasing number of users use webmail for everything, and don't have a desktop client set up. And, in many of these cases, they may be behind a firewall or ISP that blocks connections to port 25 (SMTP) on all servers other than their own. If you need to reliably deliver email from a user's machine, you'll probably need to set up a gateway of some sort yourself, or have them input SMTP settings manually. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSString vs. encoding
On 16 Sep 2009, at 22:55, Johan Kool wrote: Thanks so much!! That is indeed the case! I now use strunvis and it's all done in just 4 lines of code. (Well, except that I should still handle a returned error code.) int len = [stringA lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; char dst[len]; strunvis(dst, [stringA UTF8String]); return [NSString stringWithUTF8String:dst]; Not to burst your bubble, but that doesn't look quite right. It fails in the case where stringA contains no escaped characters (including the case where it's empty) -- the terminating null byte isn't counted by lengthOfBytesUsingEncoding:, so it ends up writing one byte off the end of dst[]. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Making a new ICNS file with NSImage
On 17 Sep 2009, at 19:39, Squ Aire wrote: My problem is this: I want to derive a new icon file (simulated by an NSImage somehow) which has some margins applied to it. The margins on each side should be the size of the area being drawn on divided by 100. So for instance, if we are drawing the icon on a 300x300 area, the top,bottom,left,right margins should all be 3. If drawing on a 30x30 area the margins are .3 or simply negligible. In other words, I somehow want to make an instance of NSImage such that if drawn on a 300x300 rect, it will look slightly smaller than that because of the margins, i.e. it will not fill out the whole rect as the original ICNS would. Correct me if I'm missing something, but can't this be accomplished by simply adding a 10% margin to the original image and scaling that down as necessary? The behavior you're describing is scale-invariant, after all. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: sprintf and 64-bit integers
On 14 Sep 2009, at 11:48, Sean McBride wrote: On 9/13/09 12:01 PM, Jens Alfke said: It would be best to convert all your sprintf calls to snprintf, which is a safer equivalent that won't overflow the buffer. Yes, sprintf is pure evil. snprintf is less evil. Also, I recommend adding -fstack-protector -D_FORTIFY_SOURCE=2, they can help catch some of these problems. And valgrind would probably have caught this problem immediately. Sadly, valgrind hasn't yet been updated to run under Snow Leopard. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSString and UIWebView load
On 11 Sep 2009, at 06:59, Dragos Ionel wrote: Is the following code supposed to run correctly? NSString* *htmlContent* = ...;// very long html content UIWebView* webView = [[UIWebView alloc] initWithFrame:...]; [webView loadHTMLString:*htmlContent* baseURL:...]; //assume this will take some time *htmlContent* = @different text; My question is if the memory space for *htmlContent* will be preserved until the webView finishes loading it, considering the fact that it will run in a different thread. Assigning a new value to a NSString * pointer does not mutate the original string. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Create VNC Client iPhone
On 24 Aug 2009, at 07:49, Joe Turner wrote: I've wanted to switch from bonjour to something more universal for a while now. And, I'm wondering about how to do VNC. I've seen that many apps on the iPhone use Apple's Screen-Sharing functionality as a VNC Server, and I would like to do the same. I have looked around for any sample code for VNC, but cannot find any. So, how do I connect to a Mac with Screen-Sharing on (password set or not), and then how do I tell it to type something? I'm fairly new to VNC, so any help would be much appreciated :) You'll need to write some code implementing the RFB protocol... read this: http://www.realvnc.com/docs/rfbproto.pdf If you aren't comfortable with network programming, now is the time to start looking that stuff up. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Help needed with ConvertCocoa64 script
On 24 Aug 2009, at 19:17, Graham Cox wrote: Trying to run the ConvertCocoa64 script. /Developer/Extras/64BitConversion/ConvertCocoa64 'find . -name '*. [hm]' | xargs' this comes up 'no match' Try this: find . -name '*.[hm]' | xargs /Developer/Extras/64BitConversion/ ConvertCocoa64 ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: debug control not reaching init method
On 20 Aug 2009, at 04:20, Navneet Kumar wrote: AppController is not coming from an archive. Dragged an NSObject to MainMenu.xib, set its class to AppController, made AppController the delegate of File's Owner. Er, that IS coming from an archive. (Nib files are archives.) ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSAlternateKeyMask is not working
On 20 Aug 2009, at 04:54, Nikhil Khandelwal wrote: In my application I am setting shortcut key for a menu item as [Menuitem setKeyEquivalentModifierMask:NSAlternateMask]; [Menuitem setKeyEquivalent:@1]; But it is not working with alt key though it is working fine if I press Fn + option + 1 or control + option + 1. Is option key is not supposed to make as shortcut key alone ? No. In the US keyboard layout, Option+1 is the shortcut for ¡ (inverted exclamation point). Keyboard shortcuts should contain either the Command or the Control key.___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Table view with multiple columns
On 21 Aug 2009, at 03:53, Massimiliano Gargani wrote: I have a mutable array with inside something like luke,l...@luke.com ,mark,m...@mark.com, .. ... - (id) tableView: (NSTableView*) tableView objectValueForTableColumn: (NSTableColumn *) tableColumn row: (int) row { id record, result; record = [namesList objectAtIndex:row]; result = [record objectForKey:[tableColumn identifier]]; return result; } when I run the app I get TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION Well... yes. NSString doesn't have an objectForKey method, so it throws an exception. I'd recommend restructuring your data store as an array of dictionaries, or an array of arrays - anything, really, besides an interleaved array. If you're dead-set on storing things that way, though, you'll need to handle that properly in your objectValueForTableColumn method. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: int to bytes(value in NSString)
On 17 Aug 2009, at 23:21, bosco fdo wrote: Hi graham Thanks for the reply. I have tried %i.1 but i am getting 0.10.10.10.1 , but i need it in binary byte value Wait, you're trying to construct a NSString with null bytes in it? I'm pretty sure that doesn't work correctly in a lot of circumstances - NSString is primarily intended for representing a sequence of characters, not an arbitrary set of bytes. What you probably want instead is NSData. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [iPhone] Webview stringByEvaluatingJavaScriptFromString
On 5 Aug 2009, at 12:08, Development wrote: NSString * aString =[theWebView stringByEvaluatingJavaScriptFromString :@document.getElementsByName(\encrypted\).value]; This Javascript will never work correctly, no matter whether it's from HTML or from ObjC. getElementsByName returns a collection, not an element. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cocoa Document-Based App v. Windows MDI App
On 26 Jul 2009, at 22:57, Jeff Biggus wrote: If you want it to look like Safari tabs across the top you'll just have to do a little work to make that top bar view behave how you want. Side tabs are much easier to get up and running, and are often a better solution GUI-wise, depending on your app. Check out PSMTabBar. Turns a standard NSTabView into a Safari-style tab view, with tabs on any side you want - including all the tricky functionality like draggable tabs. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to display the information in the columns of the table view?
The crash you're seeing is almost certainly occuring because you aren't retaining infoDictionary correctly. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableView - populating from C procedure
On 25 Jul 2009, at 03:56, Uli Kusterer wrote: I don't think you can use sizeof() on a pointer passed as a parameter, though. That only works on variables in the current scope. That pointer could point at anything, so the compiler has no idea whether it points at the stack or the heap. Even if it generated specialized code for the stack case, what code would it generate for the heap case? sizeof() is independent from malloc(), NewPtr() and all the other allocator schemes the OS knows, sizeof() wouldn't know which one to use. sizeof() does exactly one thing, which is return the amount of storage allocated *by the compiler* for its argument. Despite appearances, it is not a function: it's a compiler directive, and compiles to a constant value. For example: char charArray[24]; sizeof(charArray) = 24 int intArray[16]; sizeof(intArray) = 64 char *charArrayPointer = charArray; int *intArrayPointer = intArray; sizeof(charArrayPointer) = sizeof(intArrayPointer) = 4 (8 on 64-bit builds) What's happened here? Taking the sizeof() a pointer doesn't tell you anything about the size of the object it's pointing to - all it can tell you is how big *the pointer itself* is. You can dereference a pointer in a sizeof() expression, but only in a limited fashion: sizeof(*charArrayPointer) = 1 sizeof(*intArrayPointer) = 4 Confused? Keep in mind that *charArrayPointer is equivalent to charArrayPointer[0] - it returns the first element, not the whole original array. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Screen Saver test button click notification
On 23 Jul 2009, at 03:57, Santosh Sinha wrote: I have developing a calibration tool , but there is a little issue, When i have done the calibration and go into the system preferences and click screen saver test button , after that calibration is gone, What kind of calibration are you attempting to perform, and how are you applying it? If this is for a screen color profile, you you're probably either not using ColorSync or using it incorrectly. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: missing vertical scroll bar
On 17 Jul 2009, at 13:36, Joel Norvell wrote: I believe the recipe you want involves shoe-horning the scrollViewRect into its containing window. Also, I might just be missing something, but isn't there usually a NSClipView in the hierarchy somewhere? ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Problems displaying an image in UIWebView [solved]
On 16 Jul 2009, at 09:55, M.S. Hrishikesh wrote: img align=center src=/file://Users/hrishi/Library/Application Support/iPhone Simulator/User/Applications/87888BAB-2F9D-44F6-BEB8- FB7D65D2F1CC/Epicures.app/myImage.png / Although it may display correctly, that's still not correct. The URI scheme goes first, like this: img align=center src=file:///Users/hrishi/like/this / ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Windowed Video
On 16 Jul 2009, at 05:15, Eric E. Dolecki wrote: I would like to play a m4v from my bundle and I am using MPMoviePlayerController to do this. Works great. However in my view the designer would like the video to playback overlaid on top of a graphic of a television set. I don't seem to be able to do this with MPMoviePlayerController. How can I play that asset from my main bundle in a windowed fashion? (ie. I give the x,y and width, height), etc.? In the absence of any API for framing a video, how about just making the television set graphic part of the video? As long as it's not changing, it shouldn't impact file size too severely. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Trouble with binary data and byte buffers
On 13 Jul 2009, at 22:02, Chase Meadors wrote: Hi, I'm having some confusion here over displaying raw binary data. I have my NSMutableData object that I'm getting the bytes from. As I understand it, there are different ways to get the bytes. The -getBytes:range: method NSRange r = NSMakeRange(x, y); char buf[y]; [data getBytes:buf length:r]; getBytes:length: takes a scalar argument for length, not a NSRange object. You're probably thinking of getBytes:range:. However, I'd recommend strongly against using stack allocation (particularly variable-length stack allocation) for a buffer of unknown, potentially large size. Or the -bytes or -mutableBytes methods char buf = [data bytes]; What is the generally accepted method of doing this? I'm using the first method, as the other one sometimes crashes. It won't crash if you assign it to a variable of the proper type: char *buf = [data bytes]; Second, I'm testing the data with the following code: for (int i = 0; i aNumber; i ++) { NSLog(@%02X, buf[i]); } This is what's really bothering me because I'll get normal bytes, like 2E 00 AA, but sometimes, seemingly randomly, there are six leading F's. Hardly random. It's occurring for every value with the high bit set (0x80 - 0xff). Read: http://en.wikipedia.org/wiki/Sign_extension Then switch char to unsigned char and you'll get the results you're expecting. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Intercepting console in an app
On 8 Jul 2009, at 03:48, Angelo Chen wrote: I use NSTask to run a command line program(ffmpeg in this case), NSPipe can't get the output from the program, but I can see those messages from the Console during runtime, is there a way to grab the Console output from a running cocoa app? Thanks, Are you capturing the program's standard error (stderr) output as well as its standard output (stdout)? ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: The code limit to the media type to .mp3 and .aiff
On 8 Jul 2009, at 00:56, Bright wrote: { if(UTTypeConformsTo(uti, CFSTR(public.aiff-audio))) You're looking for the wrong thing here. % mdls /System/Library/Sounds/Morse.aiff ... kMDItemContentType = public.aifc-audio kMDItemContentTypeTree = ( public.aifc-audio, public.audio, public.audiovisual-content, public.data, public.item, public.content ) But if what you're actually trying to accomplish is limiting your listing to sound files, public.audio may be more appropriate. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CGSRegisterNotifyProc and unlock screen notification
On 8 Jul 2009, at 09:53, Austin wrote: I am wondering if anybody could provide a little details on how to register through CGSRegisterNotifyProc for an unlock screen notification. Basically I would like my application to get notified when the user successfully unlock the screen from screensaver. You're probably thinking of my post from back in 2007, right? A little birdie told me shortly afterwards that CGSRegisterNotifyProc is unrelated. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: EXC_BAD_ACCESS on returning an int?
On 4 Jul 2009, at 17:39, Ian Havelock wrote: @synthesize numberOfSides; @synthesize minimumNumberOfSides; @synthesize maximumNumberOfSides; - (int)numberOfSides { return numberOfSides; } - (void)setNumberOfSides:(int)value { numberOfSides = value; } Let me guess: does your stack trace (type tb in the gdb console) indicate infinite recursion? Either synthesize accessors or write your own - but don't try to do both at once. Down that road lies madness. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: looks like my syntax is wrong. Does not compile
On 3 Jul 2009, at 21:29, Agha Khan wrote: Aobject is type of Myobject* it has an array for 6 intergers Aobject.myArray = [NSArray arrayWithObjects:[NSNumber numberWithInt: 1], [NSNumber numberWithInt: 2],[NSNumber numberWithInt:3], [NSNumber numberWithInt:4], [NSNumber numberWithInt:5],[NSNumber numberWithInt:6], nil]; Now I would like to randomize it. for (int j = 0; j 6; j++) { NSNumber* aNumber = [Aobject _Edge] numberWithInt:j; // looks like my syntax is wrong. Does not compile } Your syntax is indeed incorrect - you may want to review Apple's Objective-C documentation [1]. Moreover, it's not clear how this is supposed to randomize the array, as no random numbers are involved. [1]: http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Determining OS at Runtime
On 2 Jul 2009, at 16:29, Steve Christensen wrote: If you want to make sure that you don't include any old code in your executable when you decide to make 10.5 (for example) your base OS version, you could arrange your code like this: #if MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_5 if (SomeLeopardFunction == NULL) TigerFunction(); else #endif SomeLeopardFunction(); Preprocessor directives take effect at compile time, not at runtime. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Window not displaying
On 30 Jun 2009, at 22:28, rethish wrote: @implementation SendWindowClass -(void)openNew { [ScheduleWindow makeKeyAndOrderFront:self]; } What is ScheduleWindow, and how is it allocated? The code you've provided here never initializes a window - I'm assuming that it's sometimes initialized by a nib, but that doesn't work when you allocate an instance manually! As a side point, names beginning with capital letters are generally used for classes, and names which begin with lower case are used for everything else. Naming an instance variable ScheduleWindow, or a class controller, is very likely to confuse readers of your code. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Raw Infrared Data
On 30 Jun 2009, at 07:03, Mr. Gecko wrote: Is there anyway to get raw Infrared data from the Apple IR Controller? I'll like to be able to see data from remotes that are not the Apple Remote and also see the raw data of the apple remote so I could make a generic game controller or something like that. Along with what jcr pointed out, keep in mind that not all infrared remotes are made alike. There is a significant chance that the Apple IR receiver was never designed to communicate with anything other than an Apple remote. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: UITextView symbols
On 27 Jun 2009, at 16:26, DKJ wrote: I'm using this method: textView:shouldChangeTextInRange:replacementText: to let users put special symbols into a UITextView. I detect the Return key by checking whether the input string is equal to @\n. But how would I detect the back-delete key? @\b doesn't do it. And I can't seem to find any docs that list these codes. I haven't done any iPhone development myself, but I'd imagine that your problem is that you're looking for the wrong sort of change. Pressing Return inserts a newline, but pressing backspace doesn't insert a backspace. It removes a character. At a blind guess, maybe it'll show up as a range of length 1 being replaced with @? ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Tool-tips on NSTabViewItem
On 26 Jun 2009, at 08:01, PKameo wrote: How do you add a tool-tip to a NSTabViewItem? I tried the following, but that didn't work right. [[tabViewItem view] setToolTip:toolTip]; //Where tabViewItem is of type NSTabViewItem* and toolTip is of type NSString* [tabViewItem view] returns the content view of the tab (i.e, what gets displayed when the tab is selected), not a view representing the tab itself. Tab view items don't support attributed labels, so I suspect there isn't any easy way of accomplishing this task. If you really need it, you can probably subclass NSTabView and do something awful with mouse- moved events and/or tracking rects. However, given as how there aren't any other applications out there where NSTabViews have tooltips, I wouldn't sweat it. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bonjour over the web
On 27 Jun 2009, at 21:58, Development wrote: I was reading the docs and did not see the answer to this so I am hoping that I can get some help through the list. Is it possible to publish a bonjour service on the web? No. Bonjour depends on the availability of local network broadcasts to do its thing. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cocoa and email (SMTP/POP3)
On 23 Jun 2009, at 20:42, Dave DeLong wrote: 3.5: Use /usr/sbin/sendmail: Create an NSTask that launches /usr/ sbin/sendmail, configures the headers, and then just pipes your email through the task's standardInput. That doesn't work for users behind residential ISPs that block port 25, or for destinations that block mail from residential ISPs. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cocoa and email (SMTP/POP3)
On 23 Jun 2009, at 21:52, Jeff Laing wrote: Ok, I'll bite. How does the mail server that Mail.app is talking to distinguish between Mail.app and /usr/sbin/sendmail ? They both presumably just talk SMTP ? Mail.app is configurable by the user to connect to a specific relay mail server, potentially using login credentials, SSL, and/or an alternate port. Sendmail, by contrast, is not configurable (without cracking open the terminal, at least), and will by default always connect directly to the destination mail server. It's this exact behavior that makes it unlikely to work properly. Consider also that not all users even have Mail.app configured. An increasing number of users use online mail services such as GMail exclusively. In their case, not even scripting Mail.app will help you. If you really need to deliver email notifications from an application, the only reliable solution is to put together a properly secured web- to-email gateway for your application somewhere and use that. Sending email directly from the desktop is no longer a viable solution without explicit configuration. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Possible to set tab stops in an NSTextView?
On 21 Jun 2009, at 15:44, Ken Tozier wrote: Here's how I interpreted your code NSArray *tabStops = [[[NSArray alloc] initWithObjects: [NSNumber numberWithInt: 70], [NSNumber numberWithInt: 400], [NSNumber numberWithInt: 460], nil] autorelease]; style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [style setTabStops: tabStops]; setTabStops takes an array of NSTextTab objects, not an array of integers. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Show the dock icon's context menu:
On 19 Jun 2009, at 16:37, Ian was here wrote: I think the best way to show an application dock icon's context menu from within the application itself is to write an AppleScript that can find the desired application's dock icon, then ask it to show its context menu. And how would you propose to do that? AppleScript isn't magic (sadly). It can't do anything that you can't do from code already. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Weird dyld loader crash
On 20 Jun 2009, at 20:27, Erg Consultant wrote: I suddenly started getting a weird loader crash when launching my app. Has anyone seen any errors similar to this one: Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x Crashed Thread: 0 Thread 0 Crashed: 0 ??? 00 0 + 0 1 X 0x00010c89 0x1000 + 64649 2 X 0x00011970 0x1000 + 67952 3 X 0x0004ef07 0x1000 + 319239 4 X 0x0004efb9 0x1000 + 319417 This error is in your code. It has nothing to do with dyld, save that it occurred in code that was called at initialization time. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Jerky/juttery (core-)animation in a screensaver
On 17 Jun 2009, at 11:51, Phillip B Oldham wrote: Also, I'm quite sure its not a problem with the hardware. I've tested the built-in screensavers which use core-animation, and downloaded a few free CA-based for comparison, and they run without issue on both machines. None of the standard screensavers use Core Animation (at least, not that I'm aware of). There are a few that use Quartz Composer, but that's rather different. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Problem with capturing active state of the application
On 17 Jun 2009, at 22:49, Srinivasa Prabhu wrote: In our application we want to capture a selected area similar to Apple's Cmd+Shift+4 i.e during selection capture, the active state of another application has to be captured. ... Is there any workaround to capture the active state of the applications? Yes: CGWindow. http://developer.apple.com/documentation/Carbon/reference/CGWindow_Reference/Reference/Functions.html#/ /apple_ref/doc/uid/TP40008073-CH2-DontLinkElementID_53 ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to fill rectangle under vertical scroller?
On 16 Jun 2009, at 21:40, Sumin Kim wrote: That's not part of the scroller. Assuming you're working with NSTableView, this is the cornerView, which you can set up separately. Yes, you are right. I am working with table. Of course I tried to use cornerView. But as far as I understood with my experience dealing with cornerView, it was not I want to handle. I think the cornerView is the upper right corner of the tableView -I mean, above of the vertical scroller- but what I want to fill with my color is right bottom corner, under the vertical scroller. Am I understanding wrong? No, you're correct - I was mistaken about the purpose of cornerView. Carry on. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to fill rectangle under vertical scroller?
On 16 Jun 2009, at 16:43, Sumin Kim wrote: I am drawing custom scroller for my application and could change color and looks of knob, arrows, and knob slot. But I still cannot change the color of a rectangle located in right bottom corner under vertical scroller. I could not find out how to handle the area. Any advice will be appreciated. That's not part of the scroller. Assuming you're working with NSTableView, this is the cornerView, which you can set up separately. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Serial port access from C / Objective C
On 15 Jun 2009, at 15:10, Vansickle, Greg wrote: With the write / read in place, although the write appears to work (numbytes returns 5), the photometer does not respond (I get no REMOTE indication on the instrument panel. The subsequent read fails (returns -1). This indicates that an error is occurring when you try to read from the device. What shows up in errno when this occurs? ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Putting files in an flat-file executable
On 13 Jun 2009, at 14:35, KK wrote: Well, I'm making a command-line tool that uses another tool, and it would be convenient if that other tool could be packaged right inside the first tool. So, the bundle structure is basically out... Right? You can't execute a binary that doesn't exist as a distinct file on disk without some really egregious hacks. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: searching a string in big file
On 13 Jun 2009, at 00:27, Angelo Chen wrote: Hi Stephen, Thanks for the quick reply, it is a binary file, coming from Quicktime's mov, I need to search backward for a string 'free', then change it to 'moov', so search should start from the end of file, any ideas? Thanks, Angelo This is not a safe way to alter video files. If you really want to modify QT atoms like this (why?!), parse the file properly - there's a format spec online somewhere. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Drop dowm status menubar item while hovering cursor over it
On 10 Jun 2009, at 23:02, Arjun SM wrote: Pardon me for i din't understand (still a novice). I did try adding a tooltip for the menu item, but when i clicked on the menu bar and hovered the mouse over my Menulet drop down didn't appear even though menuitem of Time Machine, Bluetooth and other applications did drop down. any help is much appreciated. Oh, what he's asking is why you can't single-click to drop down one menu, then switch over to a statusbar item's menu without clicking again. This behavior is common to all status bar items, and is arguably a bug. You can try reporting it to Apple, but it's unlikely to be fixed for a while yet. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: crashing web browser with openURL call
On 6 Jun 2009, at 08:37, iseecolors wrote: What I am doing is a single sign on to an web service. I send the URL (with cert and nounce) to the server and get back a re-direct to the actual page, which does start to load. I see all of this take place. Than before the page finishes loading, the browser quits. The interesting note is that what little the log shows is that Debugger() is called just before the browsers quit. It seems odd that both browsers would call Debugger() when loading the same page, but only when the browser didn't already have a page open - suggestion some common code is actually calling Debugger(). If I recall correctly, this is a bug in the Flash plugin, which contains a number of calls to Debugger() for some reason. Under normal circumstances, they're ignored and just generate a log message - I'm curious why they appear to be actually interrupting the program here. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTask curl
On 6 Jun 2009, at 14:18, Ammar Ibrahim wrote: I'm using NSTask to spawn a process to do some work as per the code below: snip [task setLaunchPath:@/usr/bin/curl]; Why on earth are you shelling out to do that? NSURLDownload exists for a reason. In any case, the reason you aren't ending up with a file where you expect it is this: [NSString stringWithFormat:@-o %@, [downloadFilePath lastPathComponent]], Given downloadFilePath /foo/bar/baz, this'll create a file called baz - with a leading space. Either use -o%@ or use two separate arguments. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTask curl
On 6 Jun 2009, at 15:05, Ammar Ibrahim wrote: On Sun, Jun 7, 2009 at 12:29 AM, Andrew Farmer andf...@gmail.com wrote: Given downloadFilePath /foo/bar/baz, this'll create a file called baz - with a leading space. Either use -o%@ or use two separate arguments. Thanks that fixed it! Although when you call it directly from the command line, it's fine to have the space there! No, it's not. Invoking NSTask with an argument like that is equivalent to typing: curl -s -o foo http://url/ which is not equivalent to curl -s -o foo http://url/ ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSAppleScript's compileAndReturnError always succeeds
On 3 Jun 2009, at 19:47, Paul J. Lucas wrote: Given that NSAppleScript objects are always supposed to run on the main thread, I created a small proxy object to use: snip If I compile a valid script, it works as expected; however, if I compile a gibberish script, e.g., foo, compileAndReturnError doesn't fail, i.e., it returns YES and errorDict is still nil. Why? Have you tried it with any other gibberish scripts? foo is a syntactically valid script which returns the value of the variable foo - it just happens to error out at runtime because the variable isn't defined. A better choice would be something like $ which actually fails to parse. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Can't set header on NSURLRequest
On 1 Jun 2009, at 23:44, Chris wrote: I'm having an issue with setting two headers for my NSURLRequest: [theRequest setValue: [NSString stringWithFormat:@/principals/ __uids__/%@/\r\n,self.userGUID] forHTTPHeaderField:@Originator]; [theRequest setValue: [NSString stringWithFormat:@/principals/ __uids__/%@/\r\n,roomGUID] forHTTPHeaderField:@Recipient]; Lose the \r\n. They're part of the HTTP protocol, not part of your value, and NSURLRequest will add them for you. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Validation of toolbaritem based on certain action is encountered?
On 2 Jun 2009, at 19:48, archana udupa wrote: I m havin a list of toolbar.I m working on application similar to winmerge in windows,which shows difference between 2 files.When i click toolbar item Previous difference ma cursor ll move to previous difference.But after it reaches the first difference, i want to disable that toolbar item. How can do that?can i use setEnabled method? If so for wot i should assign? whether for toolbar itemidentifier or toolbar action? http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSToolbarItemValidation_Protocol/Reference/Reference.html ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSURLConnection sendSynchronousRequest: crashes since, upgrading to 10.5.7
On 27 May 2009, at 18:20, Dennis Hartigan-O'Connor wrote: I have a very similar problem: my simple program that downloads stock prices has been working fine but intermittently crashes on 10.5.7, whether I use sendSynchronousRequest or stringWithContentsOfURL. For me, too, everything is fine for 10-15 minutes and then the program crashes. Here is the crash log from the crashed thread: Thread 1 Crashed: 0 libobjc.A.dylib 0x965c3688 objc_msgSend + 24 1 com.apple.CoreFoundation0x946cc581 _CFStreamSignalEventSynch + 193 2 com.apple.CoreFoundation0x946ba595 CFRunLoopRunSpecific + 3141 3 com.apple.CoreFoundation0x946bac78 CFRunLoopRunInMode + 88 4 com.apple.Foundation0x9058c530 + [NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 320 5 com.apple.Foundation0x90528e0d -[NSThread main] + 45 6 com.apple.Foundation0x905289b4 __NSThread__main__ + 308 Any ideas out there? I can't believe this isn't happening to lots of people. The symptoms described in the original thread all pointed strongly to a latent memory management issue that's being triggered by changes in the URL loading code. Does your application print any console output before (or as) it's crashing? If this doesn't point straight at anything, try running your application under MallocDebug. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Question about NSFileHandle class
On 30 May 2009, at 00:14, Graham Cox wrote: On 30/05/2009, at 5:09 PM, Adil Saleem wrote: Does the class NSFileHandle implements endianness checks or is it the responsibility of the programmer? I am using its method - (NSData *)readDataOfLength:(NSUInteger)length I want to read binary data from files and i want it to be same every time in my application (no endianness issues) whether it is an Intel based Mac or PPC based Mac. If NSFileHandle does not implement these checks itself, then please suggest some other Cocoa method that does it automatically. It's your responsibility. It's not possible to hide endian issues for an arbitrary binary file, because there is no way to know what its contents represent. Moreover, NSData is endian-neutral - it's just a bag of bytes. Endian issues only appear when you impose an interpretation on those bytes. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: sending continues NSImage data to iPhone
On 28 May 2009, at 06:31, sheen mac wrote: I am doing a screen sharing app for iPhone and Mac.I captured the Mac Screen as NSImage using OpenGL and send it to iPod as Gif data. But sending and restoring to UIImage process make delay because of Image size.The image size of capture is 320 x 388. Is any better way available for compressing the Image data?. Yes, there are a number of better compression algorithms out there. (See [1] for a comprehensive list.) However, you will find it impossible to write a screen sharing application which works in the way you're proposing - in order to make it use a reasonable amount of bandwidth, you'll need to limit it to transferring changing regions of the screen, rather than the whole thing every time. You can do this using the Quartz Display Services API (CGRegisterScreenRefreshCallback et. al). You may also want to look at the Quartz Window Services (CGWindow) API for taking screenshots. It's supposed to be considerably faster than the old OpenGL method, as well as more flexible. [1]: http://en.wikipedia.org/wiki/Comparison_of_graphics_file_formats ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Performance, Efficiency - Coding practice
On 28 May 2009, at 16:57, John Ku wrote: snip Is this a more efficient way to code? Which coding practice is better in terms of efficiency, memory, performance? The update method will get called often. So Im thinking there is no need to create 'NSPoint drawAtOrigin' everytime. Your thoughts? NSPoint is a structure, not an object, so creating it is practically free - there is literally no measurable difference in performance between the two approaches. However, you have an unrelated but serious problem in your original class: NSString *title = [[NSString alloc] init]; title = @TEST; This leaks a NSString object. Also, it's almost never correct to call NSString's init method, as the object created is immutable. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sending keycode to stdin
On 22 May 2009, at 15:54, Marc Tecles wrote: i'm trying to write a Cocoa application that launch a command line tool for example top. I've used NSTask with 2 NSPipe to launch the command line tool and to redirect the stdout and stderr to an NSTextview in my applycation asynchronously with Notification center. Now i want to send to the top application the keycode corresponding to the keyboard Q to terminate the task. I tried to write to the stdin without success. Do you have any idea how to send key code to a command line tool launch with NSTask ? (Quick reminder: command line tools take strings of characters as input, not keycodes.) Unfortunately, top doesn't accept keyboard input when it isn't attached to a terminal. Your best bet is to just kill() the child process. (The alternative is creating a pty, which involves all sorts of painful issues like parsing VT100 control sequences.) ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Escaping white space in an NSString
On 20 May 09, at 23:26, Bruce Johnson wrote: char mdfile[PATHSIZE]; strncpy(mdfile, pathToFile, MAXREAD); FILE * stream = fopen(pathToFile, rt); the rest of the c-code iterates over a rather large text file getting a line at a time, (fgets(inbuff,MAXREAD,stream)) make some calculations and then go onto the next line. So as you can see, a non-escaped, white space laden pathToFile will return a bogus FILE *stream. Where are you getting this idea from? fopen performs no special parsing on the path argument. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Unknown Host: Operation timed out Error
On 15 May 09, at 04:54, Shraddha Karwan wrote: I am writing an iPhone application. When I traverse from the main screen to a second screen, an AlertView is displayed. If the user clicks on the Cancel button of this alert view I am traversing back to the main screen. I used this [self.navigationController popToViewController: [self.navigationController.viewControllers objectAtIndex:0] animated:YES]; But I get an error Unknown Host: Operation timed out on the debugger and the application crashes. I searched on the internet and got to know that this error is related to SNMP. No, you're on the wrong track. SNMP is not involved at all here - the fact that a similar error message appears on the net-snmp-users mailing list is a coincidence. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Hex to NSString or NSData
On 09 May 09, at 18:58, Gwynne Raskind wrote: c = hexCharToNibble(i % 255); May want to use the operator instead of %. IIRC, modulus needs integer division, and may be taking more time than the inlined hexCharToNibble. Yeah, but since that was only done as part of a benchmark, it didn't much matter. It may have skewed the numbers upwards unnecessarily, but wouldn't have changed their relation to each other since the same sequence was calculated for all three versions. It's irrelevant, though, because i % 255 is wrong. It should be i % 256, which the compiler will optimize to i 255 (which is much faster). ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSString to bit pattern
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 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 dataUsingEncoding: method. If all you're working with is standard ASCII characters, though, this shouldn't be an issue. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSApplication and command line args
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, I am seeing a new behavior where, in some circumstances, NSApplication is passing certain arguments to openFiles, which is undesirable. For example, there may be a command line argument '-logfile /foo/bar', where '/foo/ bar' is also being passed to openFiles. My proposed solution is to detect when an argument is being passed to openFiles during startup (i.e., when the arguments are being processed), and filter it out. I do this by using a boolean flag which is initialized to false and set to true when applicationDidFinishLaunching is called on my delegate. If openFiles is called when sIsRunning is false, I perform this extra check if it's on the command line and ignore it if it is. snip... 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 and pass that to AppKit. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cancel NSThread - cocoa/mysql database search...
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 query??? any command or API!!! No. The MySQL C API [1] is synchronous, and provides no method to cancel a query that's in progress. Indeed, the network protocol doesn't either - the only way to stop a query that's running is by using the MySQL KILL command to terminate the connection. If you are ending up with queries that run for 15 to 20 minutes, you probably need to do one or more of the following: 1. Adjust your database schema to make these queries run faster 2. Fetch smaller chunks of data at a time using the LIMIT modifier on queries 3. Change your application so that it performs more efficient queries All of these are really outside the scope of Cocoa development, though. You may have better results asking on a MySQL-specific mailing list or forum. [1]: http://dev.mysql.com/doc/refman/5.1/en/c.html ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: HFS Format API?
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 diskutil command-line utilities. And be careful. ___ 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(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com