Elapsed time vs sleep

2010-07-26 Thread Matt Gough
I need to calculate (with an accuracy of 0.1 of a second) a real-time time interval. This interval should: 1. Not be affected by whether the system has been put to sleep and woken up while timing. (i.e If I start the timer then sleep the Mac for an hour and wake it up again, my interval should

Re: Core Data conflict detection

2010-07-26 Thread Paulo Andrade
Hello, I did a small test to verify that indeed an error occurred. Here is the relevant part of the code: // Create our two peer editing contexts NSManagedObjectContext *moc1 = newManagedObjectContext(); NSManagedObjectContext *moc2 = newManagedObjectContext(); // Instantiat

Re: Core data images

2010-07-26 Thread Kyle Sluder
On Jul 25, 2010, at 11:41 PM, Amy Gibbs wrote: > I'm working on a core data app that has an entity called Product. I'd like to > have an image attribute for it but I'm expecting the app to have thousands of > products stored over time so storing the images in the app will bloat it out > and sl

Re: NSBox with a NSPopUpButton

2010-07-26 Thread Eric Gorr
Well, since NSBox does not support check-box or pop-up menu titles, I have filed a bug report: rdar://8233994 If anyone else thinks it would be useful for NSBox to offer such support, I would suggest that you do the same...it does make a difference. _

Re: iPhone orientation problems

2010-07-26 Thread Eric Giguere
Hi Matt Thanks for the advice. So, if I got it right, I have to remove the second controller from my main window nib file and put it elsewhere. Otherwise, it gets created at the same time as the other. I did that to go around a problem with the Navigation Controller. This guy doesn't get loade

Re: Transparent IKImageBrowserView

2010-07-26 Thread Rimas M.
My fault. I was sure, that I have checked everything and nothing. I have made a new empty Xcode project and that worked. Finally I have found strange bug in my NSScrollView subclass. Fixed it and looks like everything is OK now. Thank you. Best Regards, Rimas M. On Fri, Jul 23, 2010 at 4:39 PM

Re: Elapsed time vs sleep

2010-07-26 Thread Charlie Dickman
Try using an NSTimer with a repeating timeout interval of, say, .001 (or anything smaller than your required accuracy), and countdown your time delta by the same amount each time the NSTimer fires and when you get to zero you'll have what you need. On Jul 26, 2010, at 4:56 AM, Matt Gough wrote:

-resolveWithTimeout never completes . . .

2010-07-26 Thread Michael Crawford
I've been using the WiTap sample as a template for learning to use NSNetServiceBrowser and NSNetService. I have an iPhone server which appears to be working and is advertising a service using the -publish API. I basically lifted the TCPServer class from WiTap. I then created a client for the

Re: Elapsed time vs sleep

2010-07-26 Thread Kyle Sluder
On Jul 26, 2010, at 8:32 AM, Charlie Dickman <3tothe...@comcast.net> wrote: > Try using an NSTimer with a repeating timeout interval of, say, .001 (or > anything smaller than your required accuracy), and countdown your time delta > by the same amount each time the NSTimer fires and when you get

Re: Elapsed time vs sleep

2010-07-26 Thread Charlie Dickman
As long as the NSTimer firing interval is sufficiently small the NSTimer can be used. If the run loop is stalled for any "significant: time _all_ timers will be inaccurate to some degree. The NSTimer works fine for animation and , e.g., alarm timers and they are consistent across platforms such

Re: Elapsed time vs sleep

2010-07-26 Thread David Duncan
On Jul 26, 2010, at 9:27 AM, Charlie Dickman wrote: > As long as the NSTimer firing interval is sufficiently small the NSTimer can > be used. If the run loop is stalled for any "significant: time _all_ timers > will be inaccurate to some degree. The NSTimer works fine for animation and , > e.g.

Re: Elapsed time vs sleep

2010-07-26 Thread Kyle Sluder
On Mon, Jul 26, 2010 at 9:27 AM, Charlie Dickman <3tothe...@comcast.net> wrote: > As long as the NSTimer firing interval is sufficiently small the NSTimer can > be used. If the run loop is stalled for any "significant: time _all_ timers > will be inaccurate to some degree. This is untrue. mach_a

Re: Elapsed time vs sleep

2010-07-26 Thread Sherm Pendley
That depends on what you mean when you say "animation." NSTimer works fine for triggering screen updates. But if your animation is physics-based - a 3d "shooter" game, for instance - you'll want something like the aforementioned mach_absolute_time to keep the animation smooth. sherm-- On Mon, Jul

How to use contentHorizontalAlignment in a UIControl subclass?

2010-07-26 Thread Bill Garrison
I've also posted this at I have a UIControl subclass that manages a set of five subviews; each subview is a custom UIView subclass (i.e. not a UILabel or UIImageView). I'm expecting UICont

Re: shouldAutorotateToInterfaceOrientation not being called ...

2010-07-26 Thread Jay Reynolds Freeman
I have actually made a little progress on this, and hope no one minds if I ask for more advice. (Failing all else, this long message may help you sleep ...) First, as Matt suggested, I did set a breakpoint in the code -- and "shouldAutorotateToInterfaceOrientation" is indeed not being called. (A

Cannot Validate Property - ioValue

2010-07-26 Thread Chris Tracewell
Using GC, 10.6 and XCode 3.2.2 - I just implemented a validation method for the "myQuantity" property of one of my models and cannot get it to work. The problem is with the ioValue, it locks up the app whenever I try to read it. After much frustration I simplified the validation to below an it s

Re: Cannot Validate Property - ioValue

2010-07-26 Thread Quincey Morris
On Jul 26, 2010, at 12:06, Chris Tracewell wrote: > -(BOOL)validateMyQuantity:(id *)ioValue error:(NSError **)outError > { > NSLog(@"%@",ioValue); > > return YES; > } > > If I use an integer or float formatter in the NSLog it works, but it just > seems to be reading the

Re: NSBrowser and double click

2010-07-26 Thread mark
On 25/07/2010, at 9:00 AM, mark wrote: A problem which is driving me spastic: I have an NSBrowser that allowes multiple selection. When I double click one of the selected items, all other selected items deselect. I have set the doubleaction and action methods and correct target. These are

Re: NSBrowser and double click

2010-07-26 Thread Corbin Dunn
On Jul 26, 2010, at 12:32 PM, mark wrote: >> On 25/07/2010, at 9:00 AM, mark wrote: >> >>> A problem which is driving me spastic: >>> I have an NSBrowser that allowes multiple selection. >>> When I double click one of the selected items, all other selected items >>> deselect. >>> I have set the

Re: iPhone orientation problems

2010-07-26 Thread Matt Neuburg
On Mon, 26 Jul 2010 10:03:14 -0400, Eric Giguere said: >Hi Matt > >Thanks for the advice. > >So, if I got it right, I have to remove the second controller from my main window nib file and put it elsewhere. Otherwise, it gets created at the same time as the other. I did that to go around a problem

NSTask

2010-07-26 Thread koko
We a user inserts a USB Thumb Drive or a Floppy in a USB Floppy Drive I want to get the mount and remove two hidden directories: .fseventsd .Trashes What should the launchPath be for [NSTask setLaunchPath:path] ? ?usr/ bin/rm is not valid i.e. where is rm? NSTask *task1;

Re: NSTask

2010-07-26 Thread Bill Bumgarner
On Jul 26, 2010, at 1:39 PM, k...@highrolls.net wrote: > What should the launchPath be for [NSTask setLaunchPath:path] ? ?usr/bin/rm > is not valid i.e. where is rm? Why use a task to remove a file? Use NSFileManager's APIs. b.bum ___ Cocoa-dev m

Re: NSTask

2010-07-26 Thread Sherm Pendley
On Mon, Jul 26, 2010 at 4:39 PM, wrote: > > where is rm? Ironically, that's almost exactly the shell command you'd use to find it: "whereis rm". :-) Bill's right though - NSFileManager seems like a much better way to do this. sherm-- -- Cocoa programming in Perl: http://www.camelbones.org __

Re: shouldAutorotateToInterfaceOrientation not being called ...

2010-07-26 Thread Matt Neuburg
On Mon, 26 Jul 2010 11:35:20 -0700, Jay Reynolds Freeman said: >Investigation revealed, however, that though the desired >instance of my subclassed UIViewController was in fact getting >loaded and some of its code is running, the IBOutlets that >I hooked up from the File's Owner in the second xib

Re: iPhone orientation problems

2010-07-26 Thread Laurent Daudelin
On Jul 26, 2010, at 13:33, Matt Neuburg wrote: > On Mon, 26 Jul 2010 10:03:14 -0400, Eric Giguere > said: >> Hi Matt >> >> Thanks for the advice. >> >> So, if I got it right, I have to remove the second controller from my main > window nib file and put it elsewhere. Otherwise, it gets created

Re: NSTask

2010-07-26 Thread koko
OK. I thought I had to remove these hidden files this way since I could not remove them using the finder. -koko On Jul 26, 2010, at 2:51 PM, Sherm Pendley wrote: On Mon, Jul 26, 2010 at 4:39 PM, wrote: where is rm? Ironically, that's almost exactly the shell command you'd use to find

Re: NSTask

2010-07-26 Thread Kyle Sluder
On Mon, Jul 26, 2010 at 2:22 PM, wrote: > OK.  I thought I had to remove these hidden files this way since I could not > remove them using the finder. You shouldn't be removing them anyway. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.ap

Retrieving Uniform Type Identifiers

2010-07-26 Thread Dave DeLong
Hi everyone, I have the string "com.apple.iwork.*", and I need to expand that into any UTIs that match the string. In this case, it'd be: ( "com.apple.iwork.pages.pages", "com.apple.iwork.keynote.key", "com.apple.iwork.numbers.numbers" ) The root question I have is: How can I retrieve a list

Re: Retrieving Uniform Type Identifiers

2010-07-26 Thread Ken Thomases
On Jul 26, 2010, at 5:20 PM, Dave DeLong wrote: > I have the string "com.apple.iwork.*", and I need to expand that into any > UTIs that match the string. In this case, it'd be: > > ( > "com.apple.iwork.pages.pages", > "com.apple.iwork.keynote.key", > "com.apple.iwork.numbers.numbers" > ) > > T

Re: Retrieving Uniform Type Identifiers

2010-07-26 Thread Dave DeLong
Yeah, I'm actually trying to expand Spotlight queries into a different format so I can execute them on a SQLite database, and the process doing this is a root-level daemon, which means I can't use NSMetadataQuery, because it returns different results when run as root versus when run as a user.

Re: Retrieving Uniform Type Identifiers

2010-07-26 Thread Ken Thomases
On Jul 26, 2010, at 5:59 PM, Dave DeLong wrote: > Yeah, I'm actually trying to expand Spotlight queries into a different format > so I can execute them on a SQLite database Huh? I can't figure out what you mean by that. You want to let Spotlight find things from within a database? Then you wa

Re: NSTask

2010-07-26 Thread koko
Yes, these need to be removed or the floppy or usb thumb cannot be used in many embroidery machines. On Jul 26, 2010, at 4:12 PM, Kyle Sluder wrote: On Mon, Jul 26, 2010 at 2:22 PM, wrote: OK. I thought I had to remove these hidden files this way since I could not remove them using the

Re: Retrieving Uniform Type Identifiers

2010-07-26 Thread Dave DeLong
On Jul 26, 2010, at 5:22 PM, Ken Thomases wrote: > On Jul 26, 2010, at 5:59 PM, Dave DeLong wrote: > >> Yeah, I'm actually trying to expand Spotlight queries into a different >> format so I can execute them on a SQLite database > > Huh? I can't figure out what you mean by that. > > You want

Re: NSTask

2010-07-26 Thread Kyle Sluder
On Mon, Jul 26, 2010 at 4:27 PM, wrote: > Yes, these need to be removed or the floppy or usb thumb cannot be used in > many embroidery machines. Well you probably shouldn't be doing this while the volume is mounted; you have no guarantee that the directories won't be recreated. I'd be particular

Re: shouldAutorotateToInterfaceOrientation not being called ...

2010-07-26 Thread Jay Reynolds Freeman
Thanks much to Matt ... On Jul 26, 2010, at 1:51 PM, Matt Neuburg wrote: > What do you mean "there is supposed to be a mechanism"? Do you mean the > normal nib-loading KVC-based setting out outlets? If so, there is not > "supposed" to be a mechanism; there *is* a mechanism. If that is what the

Screen pixels changed notification?

2010-07-26 Thread Ryan Joseph
I'm making a window which captures a screen image then applies a filter to it for drawing effects (like the menus in the Dock). The problem I'm having is I can't be sure when anything in the screen changes underneath it changes so I don't know when to update the screen image. Are there any noti

Re: Screen pixels changed notification?

2010-07-26 Thread Dave Keck
You're probably interested in CGRegisterScreenRefreshCallback(). ___ 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 H

Re: Screen pixels changed notification?

2010-07-26 Thread Sherm Pendley
On Mon, Jul 26, 2010 at 8:37 PM, Ryan Joseph wrote: > > Are there any notifications I could get that would tell me if screen pixels > changed I don't know of any Objective-C methods - you might have a look at the Core Graphics function CGRegisterScreenRefreshCallback(). sherm-- -- Cocoa progr

Re: -resolveWithTimeout never completes . . .

2010-07-26 Thread Michael Crawford
Problem solved. You must retain the service returned with -[NSNetServiceBrowserDelegate didFindService:moreComing:]. -Michael On Jul 26, 2010, at 11:34 AM, Michael Crawford wrote: > I've been using the WiTap sample as a template for learning to use > NSNetServiceBrowser and NSNetService. I h

Re: NSTask

2010-07-26 Thread koko
Ok, that is a consideration worth looking into. For my testing, I have deleted the files at mount and then used my app to write files. Neither of the directories in question reappear. I will be testing with embroidery machines later this week. As a note, the home embroidery market is domin

Re: Screen pixels changed notification?

2010-07-26 Thread Ryan Joseph
This is perfect, thanks! On Jul 26, 2010, at 6:47 PM, Dave Keck wrote: > You're probably interested in CGRegisterScreenRefreshCallback(). Regards, Ryan Joseph thealchemistguild.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Window's controls receive mouse-down events, but the win stay unactive. How?

2010-07-26 Thread cocoa nick
Hello How could i implement such a window? Delving in documentation, i have found that the method -(BOOL)acceptsFirstMouse (of NSView) should return YES and the mouse down events will be sent directly to the control first (but the window still becomes active afterwards). Is there a way not to let w

How to fastly get the active window's title?

2010-07-26 Thread cocoa nick
What is the fastest (in terms of execution) way to get the active window's (of arbitrary application, not necessarily mine) title? I have found only the way involving AppleScript which doesn't seem fast Thanks! ___ Cocoa-dev mailing list (Cocoa-dev@lists

Re: How to fastly get the active window's title?

2010-07-26 Thread John Joyce
Look into NSWorkspace class and methods... On Jul 26, 2010, at 4:54 PM, cocoa nick wrote: > What is the fastest (in terms of execution) way to get the active window's > (of arbitrary application, not necessarily mine) title? > I have found only the way involving AppleScript which doesn't seem fas