Re: maximum theoretical speedup with dual quad processors
On Jan 31, 2009, at 2:04 PM, jurin...@eecs.utk.edu wrote: There IS a know bug with the NSInvocationQueue method on intels using 10.5.6 which I have read will be fixed on 10.6. Please do not say things like this without citing a specific source. Otherwise you are spreading rumors. In general, Apple does not comment on future products or product plans. -- Chris ___ 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
elementary CAAnimationGroup question
Just as an experiment, learning about Core Animation, I tried using the implicit animator proxy to make a picture (an image well, iw) drop and tumble to the bottom of the window. So I want it to move (frameOrigin) and turn over (frameRotation) simultaneously. To do that, I tried making an animation group: NSPoint p = iw.frame.origin; CABasicAnimation* anim1 = [CABasicAnimation animationWithKeyPath:@frameOrigin]; p.y = iw.frame.size.height; p.x += iw.frame.size.width; anim1.toValue = [NSValue valueWithPoint: p]; CABasicAnimation* anim2 = [CABasicAnimation animationWithKeyPath:@frameRotation]; anim2.fromValue = [NSNumber numberWithFloat: 0.0f]; anim2.toValue = [NSNumber numberWithFloat: 180.0f]; CAAnimationGroup* g = [CAAnimationGroup animation]; g.animations = [NSArray arrayWithObjects: anim1, anim2, nil]; g.duration = 3.0; [iw setAnimations:[NSDictionary dictionaryWithObject:g forKey:@frameOrigin]]; [[iw animator] setFrameOrigin: p]; It works okay. But here's my question. When I give the window contentView a layer (with setWantsLayer:YES or with the checkbox in the nib), it stops working - the rotation never happens and the duration is ignored. Why? Is it because I'm doing this wrong, and it was just dumb luck that it ever worked in the first place? Why would the existence of the layer make a difference? And what's the right way to do this when there is a layer? Thx - m. -- matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/ pantes anthropoi tou eidenai oregontai phusei Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf AppleScript: the Definitive Guide, http://tinyurl.com/2ouo3b Take Control of Customizing Leopard, http://tinyurl.com/2t9629 TidBITS, Mac news and reviews since 1990, http://www.tidbits.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: What alternatives exist for objc_setClassHandler?
Thanks... I think I'm with you... kinda of. So, let's say for the sake of argument I have some NSView subclass implemented in Java: MyView. In interface builder I drag in a custom view and I set its type to MyView by typing in the name of this class, which doesn't exist as an Objective C class. When I load that nib file, I'm going to get an error message on the console complaining correctly that MyView doesn't exist. What I was looking for was a hook from the runtime so I could step in and define some kind of forwarding proxy, which would be the MyView class as far as the objective C runtime was involved, but would delegate all functionality to the actual Java class. objc_setClassHandler would have provided just such a hook. (assuming the name is sufficient to know which class to load, which it usually but not always would be). Are you proposing instead that the programmer, knowing MyView needs to exist, calls objc_allocateClassPair, class_addMethod and objc_registerClassPair in advance of loading the nib to ensure the classes exist? That's OK but its a mite clunky. Seems like with most things in obj-c you get notified before a failure occurs so you can step in (e.g. class doesn't respond to message). And indeed this used to exist for undefined classes, but they removed it :( Unless there's an API to examine a NIB file and see what classes are required to load it? Can NSBundle do that? AndyT On Jan 31, 2009, at 5:51 PM, Michael Ash wrote: On Sat, Jan 31, 2009 at 3:36 PM, Andrew Thompson lordpi...@mac.com wrote: Hi all, I was looking for a way to define Objective-C classes at runtime... specifically to be able to supply class definitions when a Nib file is loaded. This search soon led me to objc_setClassHandler, but that's listed as deprecated without replacement here: http://developer.apple.com/documentation/Cocoa/Reference/ObjCRuntimeRef/Articles/ocr10_5delta.html What's the story here? Is there a new, preferred way to do this? What are the Ruby etc. bridges doing? The bridges don't need this functionality, as they can build the bridging classes as they are created, rather than doing lazy loading. If you can do that as well, that would seem to be an obvious approach. The contents of a nib file shouldn't be a mystery, but should be known ahead of time, so you ought to be able to create all of your classes before you load the nib. Mike ___ 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/lordpixel%40mac.com This email sent to lordpi...@mac.com AndyT (lordpixel - the cat who walks through walls) A little bigger on the inside (see you later space cowboy, you can't take the sky from me) ___ 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: maximum theoretical speedup with dual quad processors
On 31 Jan 09, at 15:11, Chris Hanson wrote: On Jan 31, 2009, at 2:04 PM, jurin...@eecs.utk.edu wrote: There IS a know bug with the NSInvocationQueue method on intels using 10.5.6 which I have read will be fixed on 10.6. Please do not say things like this without citing a specific source. Otherwise you are spreading rumors. This developer appears to have isolated a concurrency error in NSOperationQueue: http://www.mikeash.com/?page=pyblog/dont-use-nsoperationqueue.html As noted on that page, it appears to be triggered by attempting to make use of more than one NSOperationQueue in an application. ___ 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-dev Digest, Vol 6, Issue 183
On Jan 31, 2009, at 5:57 PM, cocoa-dev-requ...@lists.apple.com wrote: Can anyone tell me if the maximum speedup using parallel programming on multicore processors is BOUNDED by: (A) number of processers (as on a single core processor). (B) number of processors X number cores / processor. If each processor runs numCore threads SIMULTANEOUSLY the answer would be (B). If each procssor run numCore threads non-concurrently the answer is (A). If anyone REALLY knows please help a frustrated cocoa developer out. Thanks, Ron Jurincie jurin...@eecs.utk.edu Ron, try the 'performance optimization' list ( http://lists.apple.com/mailman/listinfo/perfoptimization-dev ) for more info in this domain. ___ 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: NSToolbar and constrolling visible items
On 2009 Jan 31, at 8:07, Ferhat Ayaz wrote: I need ... to control whether a toolbar item is visible or not. How can I do this? I don't think you can do that, and it might look kind of weird. Use -[NSToolbar -removeItemAtIndex:] to remove the item. Retain it if desired and then later use -insertItemWithItemIdentifier:atIndex: if you want to restore 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: Core Data relationship disappears
On 2009 Jan 31, at 8:33, Ivan C Myrvold wrote: But later on, the transponder relationship have been set to nil, and I don't know why. There is probably something missing in my core data code. Or, something that should not be in your code that is in your code Do anyone know what I am missing? Certainly I cannot tell from the information you provided. Possibly you did not save the managed object context? Another possibility is that it got cascade-deleted: http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdRelationships.html#/ /apple_ref/doc/uid/TP40001857-SW1 Delete Rule is shown in the .xcdatamodel when inspecting a relationship. ___ 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
Anyone actually used OpenMP with cocoa on leopard 10.5?
I am attempting to multi-process an cocoa application I developed last year. I have a MacPro with dual-quads, using xcode 3.1. Trying to use openMP to concurrently run a loop via the #pragma omp for command (yes I have taken care of ALL necessary setup to ensure entire loop can be run concurrently). Has anyone actually used openMP with xcode 3.1 using cocoa? I cannot find any information on placing files in proper location etc. I am in fact using the LLVM gcc 4.2 compiler as the limited information I have found instructs. Any assistance would be greatly appreciated. Sincerely, Ron Jurincie jurin...@eecs.utk.edu ___ 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 draw text with fade out effect?
All else aside, yes you can do this in Cocoa and/or Quartz. Here are a couple different ways. For instruction's sake, here's it done with a compositing operation, NSCompositeDestinationIn. Result color = what's already in the context but with additional alpha taken from the new drawing. - (void)drawRect:(NSRect)dirtyRect { NSRect bounds = [self bounds]; NSImage *textLayerImage = [[NSImage alloc] initWithSize:bounds.size]; { [textLayerImage lockFocus]; { NSRect textLayerBounds = {NSZeroPoint, [textLayerImage size]}; [@I am a string drawAtPoint:textLayerBounds.origin withAttributes:nil]; NSGradient *alphaGradient = [[NSGradient alloc] initWithStartingColor:[NSColor blackColor] endingColor:[NSColor clearColor]]; { [[NSGraphicsContext currentContext] setCompositingOperation: NSCompositeDestinationIn]; [alphaGradient drawInRect:textLayerBounds angle:0]; } [alphaGradient release]; } [textLayerImage unlockFocus]; [textLayerImage drawInRect:bounds fromRect:NSZeroRect/*whole thing*/ operation:NSCompositeSourceOver fraction:1.0]; } [textLayerImage release]; } That works, but it loses the LCD antialiasing, as others have noticed. The text is drawn into a transparent layer, which defeats subpixel rendering. Also, most people will not understand your code, because of the use of NSCompositeDestinationIn. A more understandable method that will also preserve the LCD text is to set a clip that has partial transparency. This requires mixing CoreGraphics calls in with the Cocoa. - (void)drawRect:(NSRect)dirtyRect { CGContextRef ctx = [[NSGraphicsContext currentContext] graphicsPort]; NSRect bounds = [self bounds]; CGImageRef maskImage = CreateMaskImage(bounds.size); { CGContextClipToMask(ctx, NSRectToCGRect(bounds), maskImage); } CFRelease(maskImage); [@I am a string drawAtPoint:[self bounds].origin withAttributes:nil]; } CGImageRef CreateMaskImage(NSSize size) { CGImageRef maskImage; CGContextRef maskContext = CGBitmapContextCreate(NULL, size.width, size. height, 8/*bitsPerComponent*/, 0/*bytesPerRow - 0 means CG picks*/, [[ NSColorSpace genericGrayColorSpace] CGColorSpace], kCGImageAlphaNone); { CGGradientRef grayGradient = CGGradientCreateWithColors([[ NSColorSpace genericGrayColorSpace] CGColorSpace], (CFArrayRef)[NSArray arrayWithObjects:(id)CGColorGetConstantColor(kCGColorWhite), (id) CGColorGetConstantColor(kCGColorBlack), nil], NULL/*locations - NULL means colors evenly distribute*/); { CGContextDrawLinearGradient(maskContext, grayGradient, CGPointZero, CGPointMake(CGBitmapContextGetWidth(maskContext), 0), 0 /*options*/); } CFRelease(grayGradient); maskImage = CGBitmapContextCreateImage(maskContext); } CFRelease(maskContext); return maskImage; } CoreImage is likely to not perform well for a small task like this. CoreImage incurs some per-use costs that it makes up for with awesome per-pixel performance. If you don't have very many pixels and your effect is simple enough to do with Cocoa/CoreGraphics, the CoreGraphics approach is likely to perform better. -Ken On Thu, Jan 29, 2009 at 12:27 AM, Oleg Krupnov oleg.krup...@gmail.comwrote: Yeah, the question is however how do I technically (e.g. in Cocoa) composite the appropriate alpha with an image, whether the background image, as you suggest, or with text image, as Ricky suggested. AFAIU, there is not such NSCompositingOperation to do this trick. It appears that I need to iterate all pixels of the intermediate bitmap, and multiply the transparency value by the mask. This is quite low-level, is there a better way? On Thu, Jan 29, 2009 at 8:32 AM, Kyle Sluder kyle.slu...@gmail.com wrote: On Wed, Jan 28, 2009 at 10:57 AM, Thomas Davie tom.da...@gmail.com wrote: This solution will also throw sub-pixel anti-aliasing in the bin. Perhaps the better solution is to draw the text as normal and then re-draw the background with the appropriate alpha on top. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/kenferry%40gmail.com This email sent to kenfe...@gmail.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: Rating-style LevelIndicator not showing dots
The dots show in the cell's highlighted state. If you send, [cell setHighlighted: YES]; then you'll get dots... until it gets clicked on, then it automatically un-highlights itself. The solution is thus to subclass NSLevelIndicatorCell and override isHighlighted to always return YES. Seems to work. I realize this is 10 months late, but I needed the answer to this myself, figured it out, and thought I should share. Jeffrey On Mar 23, 2008, at 11:10 PM, Jens Alfke wrote: I've put an NSLevelIndicator into a panel, configured it to show iTunes-style star ratings, and made it editable. Unfortunately it doesn't draw the dots where stars would go; so if the current rating is zero stars, the control is completely invisible. This presents a UI problem, as the user has no idea there's something there to click. I remember I previously ran into this a few years ago and reported it — it turned out to be a bug in the cell's implementation in AppKit. The cell suppresses the dots when it's in a table view and the row it's in isn't selected [as in iTunes], but the code for this didn't consider the case where it _wasn't_ in a table view, with the result that it always suppresses the dots. Unfortunately I can't remember the workaround, or whether there even is one. Has anyone else dealt with this? —Jens___ 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/jeffrey%40jeffreyearly.com This email sent to jeff...@jeffreyearly.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: Flowing text between text fields
John Murphy (johncmurp...@yahoo.com) on 2009-01-31 4:19 PM said: On many applications, when you enter in a serial number, there are several text fields in a row, and as the user enters in the serial number the cursor automatically jumps to the next text field at the appropriate time. I am assuming that this is a long string being displayed across several text fields. How is this done? Personally, I would not mimic that UI. It introduces an inconsistent behaviour to a very standard control. What if I mistype a letter and the app jumps to the next field? Will the delete key jump back to the previous field? What if the user does not expect this jumping and presses tab? Then he is one field too far. I'd suggest just letting the user type the serial number in one big field. You can then disgard any invalid characters, like '-', and so it doesn't even matter if the user enters dashes or not. Also, I'd suggest you exclude '0', 'O', '1', 'i', and 'l' from your serial numbers. Sean -- When the winds of change are blowing, some people are building shelters and others are building windmills - Chinese proverb ___ 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
NSTextField with an date formatting
I have an NSTextField that is bound to a date in a Core Data program. The text field has an NSDateFormatter attached to it. All connections are set up using IB. The odd thing is that the user needs to enter the date into the text field twice for the text field to correctly update to the new date. Using key value observing, the text field object correctly updates it's data on the first enter. The text field simply does not display the new value. Calling setNeedsDisplay or any other similar method does not do anything. Interestingly, when I modify the program to add a second text field (ie now have two text fields, both with date formatters and bound to the same date in Core Data), when the user changes the date in text field 1, it will result in text field 2 but not text field 1 correctly updating to the new date, and vice versa. I suspect this may be a bug, has anyone else experience anything similar and what is the process of reporting to Apple if it is a bug? Kind Regards ___ 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
Using NSAppleScript With AXMakeProcessTrusted -- and/or, How To Indirectly Launch A Secure Agent
I have a somewhat complex problem I am hoping the list can help me with. Ultimately, what I am trying to do is grant my application rights to use the Accessibility API without forcing users to turn on ³Enable access for assistive devices². My application uses AppleScripts (primarily calling System Events) to move the front window of any application between displays. So, I have read up on the AXMakeProcessTrusted function, and seen the example at http://caffeinatedcocoa.com/blog/?p=12 on how to use this function. The problem is, using that approach causes the AppleScripts in my application to fail with the error 2709 (can¹t access dictionary). First question: I have seen a message saying that AXMakeProcessTrusted was broken in Tiger. Was it fixed in Leopard? It seems to work correctly, save causing my AppleScripts to fail. Next question: Are the AppleScripts failing because the application process has elevated rights due to AXMakeProcessTrusted, or is it because the application links to the Security Framework? I have seen posts/messages that suggest both. If I can get my application the status of AXProcessIsTrusted without linking to the Security Framework, will the AppleScripts work? (And is this a bug or a security feature?) Third question: Assuming the answers to the first two questions are favorable, how would you more experienced and wise developers go about doing something like this? How can I do a one-time operation as root without linking the Security Framework into my main application? It seems to me I need to include two separate agents in my app one that is run with normal permissions from the main app (thus, no need to link to the Security Framework or give the main app generally elevated permissions), and then a second one, called from the first agent with privileges, that actually executes the AXMakeProcessTrusted function on the main app. Does this seem right? I am a novice programmer, but I have looked at both NSTask and the NSWorkspace - launchedApplication: method and can¹t discern the easier way to go in terms of passing the main app¹s path to the first, and then the second agent applications. I am not even sure of the proper build settings for a project using two helpers in this manner. Could I use a shell/perl script as the middle agent? Sorry for the longwinded/semi-ranging question(s), but any and all advice the more experienced can offer would be really really appreciated. (I have looked at AuthSample, MoreAuthSample, BetterAuthorizationSample and AuthorizedTasksInCocoa¹ (from http://www.sheepsystems.com/sourceCode/authTasksCocoa.html) and none of them suggested an easy and straight forward solution to me.) ___ 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
[Announce] DropKit 1.0 Obj-C library
Hello Cocoa developers! This is my formal announcement of the release of version 1.0 of my Objective-C library wrapper around the Drop.io API, which I have dubbed DropKit. Drop.io is an easy to use, online file sharing service that provides users with a simple and private way to share images, video, audio, documents and other digital content through unique, user-created and controlled sharing points called 'drops.' Each 'drop' is non-searchable, non-networked, does not require any type of account registration and can be password-protected and set to expire after a period of time. http://drop.io/ http://api.drop.io/ DropKit is a lightweight set of classes that allows iPhone and Mac OS developers to create apps that interface with the Drop.io API, allowing those apps to easily do things such as: * Post photos, messages and audio to the web, * Send emails with attachments via Drop.io, * Create mobile blogs or podcasts on-the-go, * Share documents and links with friends or coworkers, * integrate all the great features of Drop.io! You can get more information about DropKit, read the documentation, and download the source code, from the official DropKit drop, at: http://drop.io/DropKit Right now, DropKit has only been extenstively tested on the iPhone OS. In particular, there is one dependency on the UIImage class (a category), which can be removed from Mac OS projects. I'd love to hear developer feedback, especially if you end up using DropKit in your project! Chris Patterson chris dot s dot patterson at gmail dot com The only problem with Microsoft is they just have no taste. -- Steve Jobs http://www.youtube.com/watch?v=WfALGcDNEDw ___ 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: maximum theoretical speedup with dual quad processors
Easily reproduced doesn't always translate into guaranteed to occur. In my experience, using a single queue in your application is a sufficient safeguard as no system framework I've encountered causes an issue. That isn't to say that the API is without quirks but they can usually be adjusted to easily enough... (in short, one can endlessly debate whether or not it's safe to use NSOperationQueue or one can use it and ship a product a great deal quicker than if they hadn't and join a number of other applications churning data in large installation bases). If you really dislike the idea of it that much, I'd suggest adopting a similar approach to the API while implementing your own queue. Mike Ash has done so previously though I don't believe it's a good fit for what's being talked about here (http://www.mikeash.com/?page=pyblog/raoperationqueue-an-open-source-replacement-for-nsoperationqueue.html ). As bbum pointed out, the biggest issue that needs to be addressed is how flexible your code is w/r/t running across multiple cores. In my experience, thinking in terms of operation objects tends to yield a high return on investment and enables you to more efficiently structure your code for parallel execution without shared data dependencies. And please remember, 10.6 is unreleased and discussion of what may or may not be fixed in it is a no-no. -rob. On Jan 31, 2009, at 6:34 PM, Andrew Farmer wrote: On 31 Jan 09, at 15:11, Chris Hanson wrote: On Jan 31, 2009, at 2:04 PM, jurin...@eecs.utk.edu wrote: There IS a know bug with the NSInvocationQueue method on intels using 10.5.6 which I have read will be fixed on 10.6. Please do not say things like this without citing a specific source. Otherwise you are spreading rumors. This developer appears to have isolated a concurrency error in NSOperationQueue: http://www.mikeash.com/?page=pyblog/dont-use-nsoperationqueue.html As noted on that page, it appears to be triggered by attempting to make use of more than one NSOperationQueue in an application. ___ 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/wisequark%40gmail.com This email sent to wisequ...@gmail.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: Anyone actually used OpenMP with cocoa on leopard 10.5?
Are you compiling with the -fopenmp flag? -rob. On Jan 31, 2009, at 8:30 PM, jurin...@eecs.utk.edu wrote: I am attempting to multi-process an cocoa application I developed last year. I have a MacPro with dual-quads, using xcode 3.1. Trying to use openMP to concurrently run a loop via the #pragma omp for command (yes I have taken care of ALL necessary setup to ensure entire loop can be run concurrently). Has anyone actually used openMP with xcode 3.1 using cocoa? I cannot find any information on placing files in proper location etc. I am in fact using the LLVM gcc 4.2 compiler as the limited information I have found instructs. Any assistance would be greatly appreciated. Sincerely, Ron Jurincie jurin...@eecs.utk.edu ___ 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/wisequark%40gmail.com This email sent to wisequ...@gmail.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
[MEET] CocoaHeads Mac Developer Meetings
Greetings, CocoaHeads is an international Mac programmer's group. Meetings are free and open to the public. We specialize in Cocoa, but everything Mac programming related is welcome. Upcoming meetings: Canada Ottawa/Gatineau- Thursday, December 11, 2008 19:00. Germany Aachen- Thursday, February 26, 2009 19:00. Berlin- Thursday, February 12, 2009 19:00. Frankfurt - Monday, February 2, 2009 20:00. Munich- Thursday, February 19, 2009 20:00. Mexico Mexico City- Thursday, February 5, 2009 19:00. South Africa Johannesburg- Thursday, February 5, 2009 18:30. Sweden Stockholm- Tuesday, February 3, 2009 19:00. United States Boston- Thursday, February 12, 2009 19:00. Boulder- Tuesday, February 10, 2009 19:00. Chicago- Tuesday, February 13, 2007. Colorado Springs- Thursday, February 12, 2009 19:00. Des Monies- Thursday, February 12, 2009 19:00. Lake Forest- Wednesday, February 11, 2009 19:00. Madison- Thursday, February 12, 2009. Minneapolis- Thursday, February 12, 2009 18:00. Nashville- Thursday, February 12, 2009 19:00. New York- Thursday, February 12, 2009 18:00. Philadelphia- Thursday, February 12, 2009 19:00. San Diego- Thursday, February 12, 2009 18:00. United Kingdom Swindon- Monday, February 2, 2009 20:00. Please check the web site at http://cocoaheads.org for more information including last-minute changes. Some chapters may have yet to post their meeting for this month. Steve Silicon Valley CocoaHeads http://cocoaheads.org ___ 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: What alternatives exist for objc_setClassHandler?
On Sat, Jan 31, 2009 at 6:33 PM, Andrew Thompson lordpi...@mac.com wrote: Thanks... I think I'm with you... kinda of. So, let's say for the sake of argument I have some NSView subclass implemented in Java: MyView. In interface builder I drag in a custom view and I set its type to MyView by typing in the name of this class, which doesn't exist as an Objective C class. When I load that nib file, I'm going to get an error message on the console complaining correctly that MyView doesn't exist. What I was looking for was a hook from the runtime so I could step in and define some kind of forwarding proxy, which would be the MyView class as far as the objective C runtime was involved, but would delegate all functionality to the actual Java class. objc_setClassHandler would have provided just such a hook. (assuming the name is sufficient to know which class to load, which it usually but not always would be). Are you proposing instead that the programmer, knowing MyView needs to exist, calls objc_allocateClassPair, class_addMethod and objc_registerClassPair in advance of loading the nib to ensure the classes exist? That's OK but its a mite clunky. Seems like with most things in obj-c you get notified before a failure occurs so you can step in (e.g. class doesn't respond to message). And indeed this used to exist for undefined classes, but they removed it :( Unless there's an API to examine a NIB file and see what classes are required to load it? Can NSBundle do that? Yes, I just meant that you register ahead of time. I agree that it's clunky and annoying, but it seems to me that it's not *too* bad, and I don't see a better way. Hopefully you know which classes can get bridged, so you can bridge them ahead of time. As far as I know there is no API to get the classes out of a nib at runtime. You *might* be able to do it with ibtool at compile time and thus somewhat automate it that way, with some scripting and such to build some data you can use to load your classes, but I really haven't look at it. And as always, file an enhancement request at bugreport.apple.com about this missing API. They may have removed it thinking that nobody actually uses it, and if you inform them otherwise there is a chance (however slight) that they will change their minds for some future OS release. Mike ___ 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: maximum theoretical speedup with dual quad processors
On Sat, Jan 31, 2009 at 10:15 PM, Robert Marini wisequ...@gmail.com wrote: Easily reproduced doesn't always translate into guaranteed to occur. In my experience, using a single queue in your application is a sufficient safeguard as no system framework I've encountered causes an issue. That isn't to say that the API is without quirks but they can usually be adjusted to easily enough... (in short, one can endlessly debate whether or not it's safe to use NSOperationQueue or one can use it and ship a product a great deal quicker than if they hadn't and join a number of other applications churning data in large installation bases). Or one can waste days tracking down an intermittent bug that only shows up rarely, only to discover that it's entirely out of your control. There are many choices! Of course, now that the problem is known, hopefully googling the error message will actually get results, leading to a much faster debugging session. If you really dislike the idea of it that much, I'd suggest adopting a similar approach to the API while implementing your own queue. Mike Ash has done so previously though I don't believe it's a good fit for what's being talked about here (http://www.mikeash.com/?page=pyblog/raoperationqueue-an-open-source-replacement-for-nsoperationqueue.html). RAOperationQueue's single-threaded nature means that an individual queue will get no speedup from multiprocessing. If you can, through whatever means, involve multiple RAOperationQueues in your computation simultaneously, each one will potentially run on a separate core. However, RAOperationQueue is meant as more of a synchronization/background processing mechanism rather than a performance enhancer, so its design does not do much in that direction. And please remember, 10.6 is unreleased and discussion of what may or may not be fixed in it is a no-no. Technically, you can discuss it (although probably not here) as long as you're uninformed about it. Which means the best you can hope for is unsubstantiated rumor, which is not generally a good idea. As I said in another thread today, those who know can't say, and those who can say don't know. Unless you see it coming from an apple.com address, don't believe it! Mike ___ 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: maximum theoretical speedup with dual quad processors
On 31 Jan 09, at 19:15, Robert Marini wrote: Easily reproduced doesn't always translate into guaranteed to occur. In my experience, using a single queue in your application is a sufficient safeguard as no system framework I've encountered causes an issue. That isn't to say that the API is without quirks but they can usually be adjusted to easily enough... (in short, one can endlessly debate whether or not it's safe to use NSOperationQueue or one can use it and ship a product a great deal quicker than if they hadn't and join a number of other applications churning data in large installation bases). That's true. However, there are some surprisingly easy ways to end up with multiple queues - one example might be if one queue is associated with each document object in a document-based application. (In this case, the bug might manifest as rare crashes when multiple documents are open and doing stuff.) ___ 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
Drawing Invalidation Question
When inside of -[NSView drawRect:], what's the difference between - (void)drawRect:(NSRect)rect; { if ([self needsToDrawRect:someRect]) } ... and ... - (void)drawRect:(NSRect)rect; { if (NSIntersectsRect(rect, someRect)) } ... ? AFAICT from the documentation, there isn't a difference. Am I misreading something important? -- Seth Willits ___ 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: maximum theoretical speedup with dual quad processors
If your original algorithm is scalar, you can get upto 4x increase by moving to SIMD (SSE2/3) if your algorithms can be paralleled. Add that to the 7 extra cores and you can get upto 32x speed up. In the real world you're very (very) unlikely to reach max throughput because of data dependencies, memory bandwidth limits, cache capacity limits, and thread preemption to name a few. And you can manage threads with pthread functions (pthread_create) or NSThread class (+[detachNewThreadSelector:toTarget:withObject:]). On Jan 31, 2009, at 3:04 PM, jurin...@eecs.utk.edu wrote: I have a bullet-proof scientific app I developed using cocoa. I just purchased a new MacPro with the dual quad processors. Earlier posts attempting to determine MAXIMUM theoretical speedup have gotten bogged down with semantic differencea between a corea and a CPUa. Having done EXTENSIVE multi-processing on UNIX machines using MPI, I was hoping I could achieve a speedup on my application exceeding 2 times and hopefully approachig numcores - 1 times (7 in this case). There IS a know bug with the NSInvocationQueue method on intels using 10.5.6 which I have read will be fixed on 10.6. my question are: (1) Is the ANYONE out there who has actually done scientific computing on the quad-core intel machines? (2) Have you achieved a speedup beyond number of CPU's (2)? (3) Has anyone used OpenMP with optional (LLVM or gcc 4.2) compilers? (4) If so where do I install the xomp foler I downloadd which is compatible with my machine and OS. (5) Please don't waste your time explaining the semantic differences between cores and cpu's, I don't care what you call them, all I need to know is MAXIMUM speedup. Anyone who can point me in the right direction for running concurrent methods NOT using NSOperationQueue with NSInvocationOperations would make me VERY VERY happy. Thanks again everyone. ___ 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
+[NSColor highlightColor] returns white instead of actual color
I'm overriding -[NSTableView highlightSelectionInClipRect:] because I don't want all the columns of the selected row to be highlighted. Works fine except +[NSColor highlightColor] returns white instead of actual highlight color I have set in System Preferences Appearance, which is green. Here's the code: color = [NSColor highlightColor] ; color = [color colorUsingColorSpaceName:@NSDeviceRGBColorSpace] ; NSLog(@highlight color = %0.2f %0.2f %0.2f %0.2f, [color redComponent], [color greenComponent], [color blueComponent], [color alphaComponent]) ; Here's the console output: highlight color = 1.00 1.00 1.00 1.00 {1,1,1,1} is solid white, not green. What am I doing wrong? Thank you, Jerry Krinock ___ 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: +[NSColor highlightColor] returns white instead of actual color
On Sun, Feb 1, 2009 at 1:11 AM, Jerry Krinock je...@ieee.org wrote: I'm overriding -[NSTableView highlightSelectionInClipRect:] because I don't want all the columns of the selected row to be highlighted. Works fine except +[NSColor highlightColor] returns white instead of actual highlight color I have set in System Preferences Appearance, which is green. From the docs: Returns the system color that represents the virtual light source on the screen. You want +[NSColor controlHighlightColor]. ___ 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: NSTextFieldCell editing text that is an attribute of the bound object - EVIL HACK
The docs that do exist concerning the way to map arbitrary objects (such as ones that contain a 'name' attribute in my case) onto text cells have to do with NSFormatter. The latter is clearly how one converts 'simple' values from an object form to a stringified form and v.v. The problem with using a subclass of NSFormatter in my case is that I only want to affect a change to the 'name' attribute on an otherwise persistent object (actually a Core Data object). I don't want to be creating new 'value' objects every time the user edits a character in the cell. NSFormatter's getObjectValue:forString:errorDescription: method is really supposed to return a new object if parsing of the string is successful. Nevertheless, it is possible to make a subclass of NSFormatter that is constructed explicitly to deal with the object that becomes set on the cell (via setObjectValue:) from the column binding. The aforementioned method can then forward the received strings to this object as changes to its name attribute. This is a pretty nasty abuse of NSFormatter, but it 'works' so long as the object can stomach 'continuous' updates as the user types. What this doesn't do though, is fix the KVC error mentioned below. This can be suppressed by implementing -setValue:forUndefinedKey: on MyClass and handling the empty string key that gets sent - essentially to ignore the value (which is curiously the cell's placeholder string Text Cell) further indicating that things are pretty screwed up! So, I really think there must be a 'proper' way to get the editor to pick up and return the value (name) I need editing from my cell's model object, but I'm still searching for the white magic, having dabbled in the darker sort. -- Luke On 30-Jan-09, at 9:32 PM, Luke Evans wrote: The Cocoa docs seem silent on how to achieve this. I have an NSTextFieldCell subclass that gets sent an object from bindings. The reason for sending it an object is that I want the cell to display a number of the object's attributes - which it does nicely through custom drawing. Now I need to allow editing of the text in the cell. I have overridden: editWithFrame:inView:editor:delegate:event: and its buddy: selectWithFrame:inView:editor:delegate:start:length: These bring up the text editor nicely. However, as I have an object at the cell, I need to present a string to this mechanism (the name property of my object), and similarly I need to somehow obtain the value from the editor when editing has finished. At the moment, the default behaviour has the editor coming up with placeholder text, and when editing is finished I get an KVC error, e.g.: Error setting value for key path of object MyClass: 0x1b385c0 (...) from bound object NSTableColumn: 0x1b1ab20(null)): [MyClass 0x1b385c0 setValue:forUndefinedKey:]: the entity MyClass is not key value coding-compliant for the key . Does anyone know how to wire up the editing so that I can provide initial text to the editor and prevent whoever it is from attempting to set the final value directly onto the bound object (which it clearly doesn't know how to do as it's a particular attribute of the object at the cell)? ___ 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
Reverting Address Book changes
Hi, I'm writing an app that provides 'added value' to the Address Book database. I'm having a problem with allowing the user to Revert to the last saved state, if I discard my copies of the person and group records and reload them from the Address Book database all is well except that group membership is always preserved - if my app has added a person to a group they stay in there despite reloading the details. If I quit and restart the app all is well, but it's a bit awkward! I realise I could just do a multiple undo but I hope there's a simpler way. Andy ___ 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
[SOLVED] Re: NSTextFieldCell editing text that is an attribute of the bound object
So, I really think there must be a 'proper' way to get the editor to pick up and return the value (name) I need editing from my cell's model object, but I'm still searching for the white magic, having dabbled in the darker sort. OK, I think I finally (mostly) grokked it. The NSCell subclass can pretend it was given a string object (the name of the actual bound object) and palm this off on its superclass (NSTextFieldCell). The actual object given can be stashed in 'representedObject', so long as you remember to copy this in copyWithZone: and this can be used to drive all the extras in any custom drawing code for the cell. You can pick up the string at the end of editing, with the cell's endEditing: So I have code like this: - (id)copyWithZone:(NSZone *)zone { NSCell *newCell = [super copyWithZone:zone]; [newCell setRepresentedObject:[self representedObject]]; return newCell; } - (void)setObjectValue:(id)object { if ([object isKindOfClass:[Thing class]]) { [self setRepresentedObject:object]; [super setObjectValue:[object name]]; } } - (void)endEditing:(NSText *)textObj { [super endEditing:textObj]; // Set the representedObject's text [[self representedObject] setValue:[textObj string] forKey:@name]; } Thankfully there's no messing with (abusing?) NSFormatter subclasses this way, The only remaining fly in the ointment is that the model object (Thing class here, the object stored in representedObject) still gets a KVC message to set the OLD value of cell to the (empty string) key, which I currently just defend against, ignoring the value. I'd love to know how to prevent this from happening. -- lwe ___ 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
Can we render QCRenderer in CAOpenGLLayer..?
I am trying to play QCComposition in CAOpenGLLayer According to the documentation of QCRenderer this should work fine. but at final output nothing is displayed. Can anyone tell me where i am going wrong...? but at final output nothing is displayed. Can anyone tell me where i am going wrong. - (id) init { self = [super init]; if (self != nil) { [self setAsynchronous:YES]; } return self; } - (CGLPixelFormatObj)copyCGLPixelFormatForDisplayMask:(uint32_t)mask { CGLPixelFormatAttribute attributes[] = { kCGLPFADisplayMask, mask, kCGLPFAAccelerated, kCGLPFAColorSize, 2, kCGLPFAAlphaSize, 8, kCGLPFADepthSize, 16, kCGLPFANoRecovery, kCGLPFAMultisample, kCGLPFASupersample, kCGLPFASampleAlpha, 0 }; CGLPixelFormatObj pixelFormatObj = NULL; GLint numPixelFormats = 0; CGLChoosePixelFormat(attributes, pixelFormatObj, numPixelFormats); if (pixelFormatObj == NULL) NSLog(@Error: Could not choose pixel format!); return pixelFormatObj; } - (void)releaseCGLPixelFormat:(CGLPixelFormatObj)pixelFormat { CGLDestroyPixelFormat(pixelFormat); } - (CGLContextObj)copyCGLContextForPixelFormat: (CGLPixelFormatObj)pixelFormat { CGLContextObj object = [super copyCGLContextForPixelFormat:pixelFormat]; NSString *path = [[NSBundle mainBundle] pathForResource:@Blob ofType:@qtz]; QCComposition *aComposition = [QCComposition compositionWithFile:path]; CGColorSpaceRef colorRef = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); qcRenderer = [[QCRenderer alloc] initWithCGLContext:object pixelFormat:pixelFormat colorSpace:colorRef composition:aComposition]; return object; } - (BOOL)canDrawInCGLContext:(CGLContextObj)glContext pixelFormat: (CGLPixelFormatObj)pixelFormat forLayerTime: (CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp { BOOL success = [self renderAtTime:timeStamp]; if (texture) CVOpenGLBufferRelease(texture); texture = [qcRenderer createSnapshotImageOfType:@CVOpenGLBuffer]; if (texture) return YES; else return NO; return success; } - (BOOL) renderAtTime:(const CVTimeStamp*)time { NSTimeInterval videoTime; if (time) { videoTime = (NSTimeInterval)time-videoTime / (NSTimeInterval)time- videoTimeScale; NSLog(@%f %f %f,videoTime,time-videoTime,time- videoRefreshPeriod); return [qcRenderer renderAtTime:videoTime arguments:nil]; } else NO; } - (void)drawInCGLContext:(CGLContextObj)glContext pixelFormat: (CGLPixelFormatObj)pixelFormat forLayerTime: (CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp { glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glEnable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); if (CFGetTypeID(texture) == CVOpenGLTextureGetTypeID()) { GLenum target = CVOpenGLTextureGetTarget(texture); GLint name = CVOpenGLTextureGetName(texture); GLfloat topLeft[2], topRight[2], bottomRight[2], bottomLeft[2]; CVOpenGLTextureGetCleanTexCoords(texture, bottomLeft, bottomRight, topRight, topLeft); glPushMatrix(); glColor4f(1.0f, 1.0f, 1.0f, 1.0); glEnable(target); glBindTexture(target, name); glBegin(GL_QUADS); glTexCoord2fv(bottomLeft); glVertex2i(-1, -1); glTexCoord2fv(topLeft); glVertex2i(-1, 1); glTexCoord2fv(topRight);glVertex2i( 1, 1); glTexCoord2fv(bottomRight); glVertex2i( 1, -1); glEnd(); glDisable(target); glPopMatrix(); } glDisable(GL_BLEND); glDisable(GL_DEPTH_TEST); [super drawInCGLContext:glContext pixelFormat:pixelFormat forLayerTime:timeInterval displayTime:timeStamp]; } Thanks ! Anshul ___ 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
NSToolbar and constrolling visible items
Hello, I have added - (BOOL)validateToolbarItem:(NSToolbarItem *)toolbarItem to my code, which will control whether a toolbar item is enabled or not. However, I need a something similar to control whether a toolbar item is visible or not. How can I do this? Thank you, Ferhat ___ 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
-stringByEvaluatingJavaScriptFromString: return value iphone
Hi, i'm trying to execute a javascript function on the iPhone and get the return value. The function is simple: return hello; I'm using a UIWebView and the -stringByEvaluatingJavaScriptFromString: method but, while it works on os x, it doesn't on the iPhone. How can i solve? Thanks Marco ___ 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: Newbie Object Sharing Question
On Jan 30, 2009, at 9:47 PM, Ken Thomases wrote: On Jan 30, 2009, at 2:46 PM, Brian Slick wrote: It starts to occur to me that I don't actually want an instance, I want the real deal. That statement is nonsensical. There is no real deal. An instance is real. It's not some pale reflection of something else. You do want an instance. I suspect that perhaps you don't understand the difference between an object and a pointer to an object. The reason I suspect that is because the simple solution to your dilemma, the thing you're not seeing, is that you want a single instance referenced from multiple places using multiple pointers. It may be a nonsensical statement here (good to know), but in the 3D CAD world that I'm used to, which I have been leveraging in my attempts to understand OOP, there is a distinction between instances and the source item. And I believe that I do understand the difference between objects and pointers (I could be mistaken). The part I'm missing is what this needs to look like in code. I'm afraid I need some handholding here. If I knew what I needed to do in order for there to be only a single data object referenced from multiple places, I wouldn't have asked the question in the first place. I read through some documentation about model objects and objects in general, and stumbled upon the concept of Singletons. Some additional searching lead me to this blog post: http://cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html ...which seems to describe exactly what I want. I reconfigured MyListItemArray as a singleton, and remapped my data source methods accordingly, and everything seemingly works perfectly. Items added in one view are displayed in the other, and so on. It works so well that I have to assume there is a catch. I can't shake the feeling that this seems more difficult than in ought to be, and generally when I feel that way there tends to be a single line of code solution that I haven't found yet. Are singletons really the only way (that doesn't involve saving to a file, I suppose) to share a model object across multiple view controllers? I think I'm missing something really fundamental. Yes, I think your are missing something fundamental -- the ability to share references to an object simply by assigning multiple pointers to point to the same thing. Yes, exactly. How do I do that? A singleton implementation is _one_ solution to the issue you're having, but it's not necessary, and not even recommended for something as simple as this. Can you expand upon why not? Based on the blog post I linked, it sounds like this is exactly the situation in which to do this. One stumbling block is that you have two view controllers, but evidently no central application controller. View controllers should have logic and state specific to a view and that view's relationship to the model. An application controller manages your application overall. It manages the other controllers, including your view controllers. It has the primary responsibility for managing the application-global (as opposed to, for example, document-specific) model, and for providing access to that model to other parts of the program. Well, I just used the Tab Bar Application template, and other than the AppDelegate that doesn't contain very much, there is no provided application controller. The need to create one was not immediately obvious to me, as none of the examples in the book I'm reading through have dealt with accessing the same data set in different tabs. I also do not yet see how this solves my problem. I need to see some code. From my view controllers, I don't believe that I know how to send messages to the AppDelegate (say, for the table data source methods) without creating an instance, which I believe brings me back around to the same problem I started with. If your application has one central list of items, then it would be the application controller's job to create and load that model. It would hold references to the model objects in instance variables. It would provide access to those model objects to other parts of the program. One way would be to pass the references in to the view controllers when those view controllers are initialized. Another way would be for the application controller to expose those references through properties and have the view controllers reference those properties -- the view controllers would need a reference to the application controller to do that. Again, they could get such a reference by being passed it, or if your application controller is your application delegate, they can obtain the reference using [NSApp delegate]. Regards, Ken Thank you for the explanation, but I'm afraid I still have no idea what I specifically need to do, or even what help topic to go search on for
Core Data relationship disappears
I have an Entity named ServiceItem which have a relationship to another Entity named Transponder. I am creating the ServiceItem by looping through a text file, scanning for a service item pattern, and create the object with a newObject message to an NSArrayController. ServiceItem *serviceItem = [oservicesArrayController newObject]; The Transponder entity I have created similarly, and saved into an NSDictionary. Setting the transponder relationship for a ServiceItem, I do: Transponder *transponder = [transDict objectForKey:transString]; [serviceItem setTransponder:transponder]; I can see that the transponder relationship is set in an NSLog: 2009-01-31 16:57:05.596 MyrDream[14520:10b] serviceItem: ServiceItem: 0x173086f0 (entity: ServiceItem; id: 0x17308750 x-coredata:///ServiceItem/t252F7A01-BE3C-4945-B3F3-11FE1CE644892269 ; data: { channel = nil; channelName = TV 2 Norge; package = Telenor,c:000202,c:01029c,c:020242,c:030202,C:0b00; serviceType = 1508; serviceTypeString = TV; sid = 1508; specialFlags = 0; transponder = 0x16d3b9f0 x-coredata:///Transponder/t252F7A01-BE3C-4945-B3F3-11FE1CE64489141 ; }) But later on, the transponder relationship have been set to nil, and I don't know why. There is probably something missing in my core data code. Do anyone know what I am missing? 2009-01-31 16:57:05.751 MyrDream[14520:10b] makeTransponders 2 serviceItem: ServiceItem: 0x173086f0 (entity: ServiceItem; id: 0x17308750 x-coredata:///ServiceItem/t252F7A01-BE3C-4945-B3F3-11FE1CE644892269 ; data: { channel = nil; channelName = TV 2 Norge; package = Telenor,c:000202,c:01029c,c:020242,c:030202,C:0b00; serviceType = 1508; serviceTypeString = TV; sid = 1508; specialFlags = 0; transponder = nil; }) ___ 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 we render QCRenderer in CAOpenGLLayer..?
Just curious - are you using garbage collection? We recently determined there is a bug in QCCompositionLayer with garbage collection that prevents the composition from playing. QCCompositionLayer is a subclass of CAOpenGLLayer. Maybe you hit the same bug? On 1/31/09 10:09 AM, cocoa-dev-requ...@lists.apple.com cocoa-dev-requ...@lists.apple.com wrote: I am trying to play QCComposition in CAOpenGLLayer According to the documentation of QCRenderer this should work fine. but at final output nothing is displayed. Can anyone tell me where i am going wrong...? but at final output nothing is displayed. Can anyone tell me where i am going wrong. ___ 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: Core Data, Garbage Collection and SQL Store
I've been trying in vain to reproduce this bug on my computer (c2duo) and my wife's computer (G4) to no avail. Also the output from - com.apple.CoreData.SQLDebug 1 doesn't seem unusual at all. Maybe I'll try some tests with using large photos and see it there's a significant slowdown when writing atomically versus w/ SQL. -K On Jan 30, 2009, at 3:09 PM, Kevin Ross wrote: On Jan 30, 2009, at 3:02 PM, Sean McBride wrote: On 1/30/09 2:49 PM, Kevin Ross said: If it's not too much trouble are you able to send me your repro project? I'm wondering why it's not happening with my project anymore. I'm afraid the bug I filed contains not a simple test project, but my entire (unreleased) application. I wanted to be sure they fixed my exact case. Sorry, -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada No problem, thanks anyway Sean! Kevin Ross Feng Shui Software cocoabeans.heliohost.org ___ 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/cocoa.beans%40sbcglobal.net This email sent to cocoa.be...@sbcglobal.net ___ 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: Disabling sorting in a programatically generated table
On Jan 30, 2009, at 10:39 AM, Ken Tozier wrote: On Jan 30, 2009, at 10:52 AM, Keary Suska wrote: When you call -bind: do you pass NSCreatesSortDescriptorBindingOption NO? I'm not calling bind, because the array controller and array are created inside the same function, so it just seemed bass ackward to write an accessor for something I can just set directly with [controller setContent: tableData]. I looked at the NSArrayController docs again and didn't see any method that approximates NSCreatesSortDescriptorBindingOption other than [controller setSortDescriptors: nil]; [controller setAutomaticallyRearrangesObjects: NO]; You don't have a binding between the table view and the array controller? Keary Suska Esoteritech, Inc. Demystifying technology for your home or business ___ 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
How many processors?
On Jan 30, 2009, at 8:31 PM, jurin...@eecs.utk.edu wrote: I am developing a computationally intense application which I need to multi-process to take advantage of the 8 cpu's on my new MacPro with dual quads. I am using Leopard 10.5 OS. Your machine has two CPU's, not eight. Really?? I ALWAYS thought quad-core means 4 processors as are shown when I bring up the Activity Monitor CPU usage window which shows (8)??? Am I incorrect? THank you, Ron ___ 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 many processors?
Core != CPU. Your machine has 8 cores, but 2 CPUs (since it has 4 cores per CPU) Dave On Jan 31, 2009, at 1:19 PM, jurin...@eecs.utk.edu wrote: On Jan 30, 2009, at 8:31 PM, jurin...@eecs.utk.edu wrote: I am developing a computationally intense application which I need to multi-process to take advantage of the 8 cpu's on my new MacPro with dual quads. I am using Leopard 10.5 OS. Your machine has two CPU's, not eight. Really?? I ALWAYS thought quad-core means 4 processors as are shown when I bring up the Activity Monitor CPU usage window which shows (8)??? Am I incorrect? ___ 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: Disabling sorting in a programatically generated table [SOLVED]
On Jan 31, 2009, at 1:19 PM, Keary Suska wrote: You don't have a binding between the table view and the array controller? Yes, sorry, misread your post. I had been binding with options: nil but when I passed in an options dict with NSCreatesSortDescriptorBindingOption , it worked perfectly. Thanks -Ken ___ 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
What alternatives exist for objc_setClassHandler?
Hi all, I was looking for a way to define Objective-C classes at runtime... specifically to be able to supply class definitions when a Nib file is loaded. This search soon led me to objc_setClassHandler, but that's listed as deprecated without replacement here: http://developer.apple.com/documentation/Cocoa/Reference/ObjCRuntimeRef/Articles/ocr10_5delta.html What's the story here? Is there a new, preferred way to do this? What are the Ruby etc. bridges doing? AndyT (lordpixel - the cat who walks through walls) A little bigger on the inside (see you later space cowboy, you can't take the sky from me) ___ 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
New question about borken NSOperationQueue
I have a computationally intensive modeling application which I NEED to multi-process, I am trying to avoid low level calls to pthread and tcb block. In order to get my GUI running I had to create a NSOperationQueue and run my big method via a NSInvocationOperation. Previous post indicates that NSOperationQueue only seems to work with ONE queue. So it seems that I can either have GUI working OR do multi-processing... The key is the waitUntilAllOperationsAreFinished method of MSOperationQueue. I create a NSOperationQueue in my intialization process in my appController class. I have a method triggered by user pushing button which calls: - (IBAction)launchEvolveTask:(id)sender { NSInvocationOperation* bigOp = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(evolve:) object:nil]; [myOpQueue addOperation:bigOp]; } NOW in my evolve: method I have nested loops: for(i = 0; i MAX_GENS; i++) { for(j = 0; j NUM_MEMBERS; j++) { member = [someArray objectAtIndex:j]; NSInvocationOperation *concurrentOp = [NSInvocationOperation initWithTarger:member selector:processStuff: object:sharedDataArray]; [[appController opQueue] addOperation:concurrentOp]; } [opQueue waitUntilAllOperationsAreFinished]; - } * above method HAS to wait for the bigOp to finish too, which makes the wait operation useless. The only solution I have come up with so far is to launch my evolve: NSInvocationOperation directly with the start method, This means GUI locks. If I nest another NSOperationQueue instead of using appController's NSOperationQueue the BUG forces a crash every time. Evidently this is a KNOWN bug which is supposed to be fixed in 10.6 I am going to implement my own pthreads with a tcb block to go low-level on this problem, but would LOVE to be able to use Apples high-level tools. Any advice is welcomed. Thankyou, Ron ___ 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
New NSZombie warning on CFRunLoopTimer
SDK 10.4, target 10.3, environment 10.5.6 In the course of startup, my application creates one NSTimer and conducts one transaction through the Web Services Core framework (culminating in WSMethodInvocationScheduleWithRunLoop). NSZombieEnabled is YES. When the scheduled invocation returns with the server's response, I start getting this message -- it repeats periodically: == 2009-01-31 14:15:21.769 MyApp[53942:813] *** -[CFRunLoopTimer _cfTypeID]: message sent to deallocated instance 0x15a3bbb0 == There is only one NSTimer I create before this point. Here is the print-object of that timer. You see it's not the instance the zombie message complains about: == Printing description of _splashScreenTimer: CFRunLoopTimer 0x1a4550 [0xa03a81a0]{locked = No, valid = Yes, interval = 0, next fire date = 255125688, order = 0, callout = ??? (0x9506cd90), context = CFRunLoopTimer context 0x1ab550} == My application appears to run fine. Should I be worried? — F -- Fritz Anderson -- Xcode 3 Unleashed: Now in its second printing -- http://x3u.manoverboard.org/ ___ 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: -stringByEvaluatingJavaScriptFromString: return value iphone
hi Marco, are you waiting for WebView to report load finished before calling javascript? e.g. see example snippet (loads Google api and calls it): #import UIKit/UIKit.h @class UIWebView; @interface WebViewController : UIViewControllerUIWebViewDelegate {} @property (nonatomic, readonly) UIWebView *webView; @end #import WebViewController.h @implementation WebViewController @dynamic webView; -(UIWebView *)webView { return (UIWebView *)self.view; } - (void)viewDidLoad { [super viewDidLoad]; NSMutableString *htmlCode = [NSMutableString stringWithString:@htmlhead]; [htmlCode appendString:@script type=\text/javascript\ src=\http://www.google.com/jsapi \/script]; [htmlCode appendString:@script type=\text/javascript\]; [htmlCode appendString:@google.load(\language\, \1\);]; [htmlCode appendString:@/script/headbody/body/html]; [self.webView loadHTMLString:htmlCode baseURL:nil]; } - (void)webViewDidFinishLoad:(UIWebView *)webView { NSString *scriptCode = @google.language.isTranslatable(\en\); NSString *translatable = [webView stringByEvaluatingJavaScriptFromString:scriptCode]; NSLog(@isTranslatable: %@, (translatable) ? translatable : @error); } @end regards, Peter Blazejewicz On Jan 31, 2009, at 5:10 PM, Marco Cassinerio wrote: Hi, i'm trying to execute a javascript function on the iPhone and get the return value. The function is simple: return hello; I'm using a UIWebView and the - stringByEvaluatingJavaScriptFromString: method but, while it works on os x, it doesn't on the iPhone. ___ 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
Flowing text between text fields
On many applications, when you enter in a serial number, there are several text fields in a row, and as the user enters in the serial number the cursor automatically jumps to the next text field at the appropriate time. I am assuming that this is a long string being displayed across several text fields. How is this done? ___ 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
maximum theoretical speedup with dual quad processors
I have a bullet-proof scientific app I developed using cocoa. I just purchased a new MacPro with the dual quad processors. Earlier posts attempting to determine MAXIMUM theoretical speedup have gotten bogged down with semantic differencea between a corea and a CPUa. Having done EXTENSIVE multi-processing on UNIX machines using MPI, I was hoping I could achieve a speedup on my application exceeding 2 times and hopefully approachig numcores - 1 times (7 in this case). There IS a know bug with the NSInvocationQueue method on intels using 10.5.6 which I have read will be fixed on 10.6. my question are: (1) Is the ANYONE out there who has actually done scientific computing on the quad-core intel machines? (2) Have you achieved a speedup beyond number of CPU's (2)? (3) Has anyone used OpenMP with optional (LLVM or gcc 4.2) compilers? (4) If so where do I install the xomp foler I downloadd which is compatible with my machine and OS. (5) Please don't waste your time explaining the semantic differences between cores and cpu's, I don't care what you call them, all I need to know is MAXIMUM speedup. Anyone who can point me in the right direction for running concurrent methods NOT using NSOperationQueue with NSInvocationOperations would make me VERY VERY happy. Thanks again everyone. Sincerely, Ron Jurjincie jurin...@eecs.utk.edu ___ 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: maximum theoretical speedup with dual quad processors
At the risk of stating the obvious: it seems like your limiting factor in speedup will depend a lot more on your algorithm design than NSInvocationQueue, the number of cores/processors, etc. In other words, this isn't really an Apple-specific question. It's a matter of parallel algorithm design. On Jan 31, 2009, at 5:04 PM, jurin...@eecs.utk.edu wrote: I have a bullet-proof scientific app I developed using cocoa. I just purchased a new MacPro with the dual quad processors. Earlier posts attempting to determine MAXIMUM theoretical speedup have gotten bogged down with semantic differencea between a corea and a CPUa. Having done EXTENSIVE multi-processing on UNIX machines using MPI, I was hoping I could achieve a speedup on my application exceeding 2 times and hopefully approachig numcores - 1 times (7 in this case). There IS a know bug with the NSInvocationQueue method on intels using 10.5.6 which I have read will be fixed on 10.6. my question are: (1) Is the ANYONE out there who has actually done scientific computing on the quad-core intel machines? (2) Have you achieved a speedup beyond number of CPU's (2)? (3) Has anyone used OpenMP with optional (LLVM or gcc 4.2) compilers? (4) If so where do I install the xomp foler I downloadd which is compatible with my machine and OS. (5) Please don't waste your time explaining the semantic differences between cores and cpu's, I don't care what you call them, all I need to know is MAXIMUM speedup. Anyone who can point me in the right direction for running concurrent methods NOT using NSOperationQueue with NSInvocationOperations would make me VERY VERY happy. Thanks again everyone. Sincerely, Ron Jurjincie jurin...@eecs.utk.edu ___ 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/joshaber%40gmail.com This email sent to josha...@gmail.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: How many processors?
On Sat, Jan 31, 2009 at 3:21 PM, Dave DeLong davedel...@me.com wrote: Core != CPU. Your machine has 8 cores, but 2 CPUs (since it has 4 cores per CPU) This is one of those things that's true but mostly pointless. The question for which the answer is 2 here is really not a useful question. For nearly all purposes, what's interesting is the number of CPU cores. The number of actual discrete CPU chips is a hardware detail with essentially zero consequences for applications. Mike ___ 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: -stringByEvaluatingJavaScriptFromString: return value iphone
hi Marco, I'm not John Resig (http://ejohn.org/) but I would not assume that return o will actually evaluate to javascript object/function call, I would rather script: NSString *scriptCode = @\Hello\; or: NSString *scriptCode = @(function(){return \hello\;})();; but I would also fire up Safari (WebKit) script console (ALT+CMD+C) and take few trials with code. Because you're correct of differencies between UIWebView and WebView (@return \hello\ works in WebView) I would look into other place (webkitsk-dev list). Maybe that is because WebKit on OS X is bridged JavaScriptObjective-C while on Touch OS is not (return o does not work in WebKit/Safari interactive console while it works in WebView string code evaluating call). regards, Peter On Jan 31, 2009, at 10:23 PM, Marco Cassinerio wrote: Hi Peter, i tried: - (void)webViewDidFinishLoad:(UIWebView *)webView { NSLog(@finished: %@,[webView stringByEvaluatingJavaScriptFromString:@return \hello\]); } but it doesn't work, while on os x it does. Thanks Marco ___ 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
maximum speedup bound on multi-core processors
Can anyone tell me if the maximum speedup using parallel programming on multicore processors is BOUNDED by: (A) number of processers (as on a single core processor). (B) number of processors X number cores / processor. If each processor runs numCore threads SIMULTANEOUSLY the answer would be (B). If each procssor run numCore threads non-concurrently the answer is (A). If anyone REALLY knows please help a frustrated cocoa developer out. Thanks, Ron Jurincie jurin...@eecs.utk.edu ___ 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: What alternatives exist for objc_setClassHandler?
On Sat, Jan 31, 2009 at 3:36 PM, Andrew Thompson lordpi...@mac.com wrote: Hi all, I was looking for a way to define Objective-C classes at runtime... specifically to be able to supply class definitions when a Nib file is loaded. This search soon led me to objc_setClassHandler, but that's listed as deprecated without replacement here: http://developer.apple.com/documentation/Cocoa/Reference/ObjCRuntimeRef/Articles/ocr10_5delta.html What's the story here? Is there a new, preferred way to do this? What are the Ruby etc. bridges doing? The bridges don't need this functionality, as they can build the bridging classes as they are created, rather than doing lazy loading. If you can do that as well, that would seem to be an obvious approach. The contents of a nib file shouldn't be a mystery, but should be known ahead of time, so you ought to be able to create all of your classes before you load the nib. Mike ___ 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: New NSZombie warning on CFRunLoopTimer
On Sat, Jan 31, 2009 at 3:45 PM, Fritz Anderson fri...@manoverboard.org wrote: SDK 10.4, target 10.3, environment 10.5.6 In the course of startup, my application creates one NSTimer and conducts one transaction through the Web Services Core framework (culminating in WSMethodInvocationScheduleWithRunLoop). NSZombieEnabled is YES. When the scheduled invocation returns with the server's response, I start getting this message -- it repeats periodically: == 2009-01-31 14:15:21.769 MyApp[53942:813] *** -[CFRunLoopTimer _cfTypeID]: message sent to deallocated instance 0x15a3bbb0 == There is only one NSTimer I create before this point. Here is the print-object of that timer. You see it's not the instance the zombie message complains about: == Printing description of _splashScreenTimer: CFRunLoopTimer 0x1a4550 [0xa03a81a0]{locked = No, valid = Yes, interval = 0, next fire date = 255125688, order = 0, callout = ??? (0x9506cd90), context = CFRunLoopTimer context 0x1ab550} == My application appears to run fine. Should I be worried? Yes. You have a major bug. That it happens to be benign in this particular case is just an unfortunate coincidence. You should figure out why this object is being prematurely destroyed and fix it. Instruments and the malloc debug environment variables can help you figure it out. Mike ___ 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: maximum theoretical speedup with dual quad processors
On Sat, Jan 31, 2009 at 5:04 PM, jurin...@eecs.utk.edu wrote: I have a bullet-proof scientific app I developed using cocoa. I just purchased a new MacPro with the dual quad processors. Earlier posts attempting to determine MAXIMUM theoretical speedup have gotten bogged down with semantic differencea between a corea and a CPUa. [snip] (5) Please don't waste your time explaining the semantic differences between cores and cpu's, I don't care what you call them, all I need to know is MAXIMUM speedup. The maximum speedup is exactly equal to the number of cores (not CPUs, I know you don't care about the terminology but it's important) in your system. In your case, that is 8. The number of physical CPUs is completely irrelevant to nearly everything. When it comes to maximum speedup, look at the number of cores, and it's exactly like any other parallel system out there. Of course you'll only get a factor of 8 speedup on highly parallel code with no dependencies or shared resource contention (and note that memory counts as a shared resource on a multiprocessor PC), but the theoretical max is 8. Mike ___ 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: Flowing text between text fields
On 31 Jan 2009, at 3:19 PM, John Murphy wrote: On many applications, when you enter in a serial number, there are several text fields in a row, and as the user enters in the serial number the cursor automatically jumps to the next text field at the appropriate time. I am assuming that this is a long string being displayed across several text fields. How is this done? I assume it is not done that way. If I were attempting this (I haven't done it), I'd start with NSControl's controlTextDidChange: delegate method (or NSControlTextDidChangeNotification notification) and jump whenever a field holds the requisite number of characters after the change. — F -- Fritz Anderson -- Xcode 3 Unleashed: Now in its second printing -- http://x3u.manoverboard.org/ ___ 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: maximum speedup bound on multi-core processors
On Jan 31, 2009, at 2:48 PM, jurin...@eecs.utk.edu wrote: Can anyone tell me if the maximum speedup using parallel programming on multicore processors is BOUNDED by: (A) number of processers (as on a single core processor). (B) number of processors X number cores / processor. If each processor runs numCore threads SIMULTANEOUSLY the answer would be (B). If each procssor run numCore threads non-concurrently the answer is (A). If anyone REALLY knows please help a frustrated cocoa developer out. Of far more importance is the algorithm employed and, quite specifically, the dependencies between threads and exactly how the dependencies are managed. The question above can only be specifically quantified if your threads operates in total isolation, do no simultaneous I/O, and there is absolutely nothing else running on the system. In the real world, the algorithm itself will have far more to do with scalability than raw machine capabilities. b.bum ___ 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