QTMovie Load Percent.

2009-11-08 Thread Mr. Gecko
Hello, I'm trying to find out how much the QTMovie have loaded so I can get a Percent of it and draw a progress bar. I know it's possible as QTMovieView's controls shows gray in the middle of how much was loaded. I've done some looking around and found this hidden method of QTMovie loadedRa

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-08 Thread Andrew Farmer
On 8 Nov 2009, at 08:53, Jay Swartzfeger wrote: Hi all, I'm an absolute beginner to Objective-C (and programming in general). I have lots of books on order, but I've been messing with Xcode/Cocoa/iPhone SDK with online resources while I wait. My question -- for my next project, I want to do a si

Re: code data export import strategies

2009-11-08 Thread Martin Hewitson
Thanks, Rob. I do have this book, but I sort of skipped the section about multithreading (where the export example is buried), but I've found it now. Thanks to the others who replied as well. I think this has set me on the right track. @Jerry: I chose not to use a document-based design be

Re: NSTreeController and object retain counts

2009-11-08 Thread Greg Guerin
Mads Paulin wrote: #import @interface MyDocument : NSDocument { NSMutableArray *array; } @property (readonly) NSMutableArray* array; @end All I changed in the doc impl is @synthesize array and array =[ [NSMutableArray]alloc init]; in the init method. Does your MyDocument implemen

Simulating mouse events

2009-11-08 Thread Sami Nopanen
I'm trying to send simulated mouse events to a foreign application. I found example code to do this from the mailing list archive, but have had some unexpected behaviour when playing around with it. The example creates a window that forwards mouse events to another (foreign) window. But for some r

Re: principle classes from two bundles get confused

2009-11-08 Thread Bill Bumgarner
On Nov 8, 2009, at 5:47 AM, Shai Shasag wrote: > How could this be? I think the problem is that both bundle_A & bundle_B have > principle class with the same name. Somehow Cocoa gets confused. No "somehow" about it. Objective-C does not support namespaces; all classes (and selectors) exist wi

Re: NSTreeController and object retain counts

2009-11-08 Thread Mads Paulin
Hi, will do.. not much to it though: The document class header: #import @interface MyDocument : NSDocument { NSMutableArray *array; } @property (readonly) NSMutableArray* array; @end All I changed in the doc impl is @synthesize array and array =[ [NSMutableArray]alloc init]; in the

iPhone: NSOperation and UITableVIews

2009-11-08 Thread John Michael Zorko
Hello, all ... I have an indexed table view with -- surprise -- images that take a long time to load. So, I put the loading into an NSOperation-derived subclass and have the main() method send a "refresh" msg to my main thread, telling it to reload the table. This works, but the problem

beginner question, NSNumber, NSDecimalAsNumber

2009-11-08 Thread Jay Swartzfeger
Hi all, I'm an absolute beginner to Objective-C (and programming in general). I have lots of books on order, but I've been messing with Xcode/Cocoa/iPhone SDK with online resources while I wait. My question -- for my next project, I want to do a simple number <-> binary converter. Is this handled

principle classes from two bundles get confused

2009-11-08 Thread Shai Shasag
The following code loads two different bundles and gets their principle classes. NSString* path_A = @"/My/Bundles/Folder/A.bundle"; NSBundle* bundle_A = [NSBundle bundleWithPath: path_A]; Class class_A = [bundle_A principalClass]; NSString* path_B = @"/My/Bundles/Folder/B.bundle"; NSBundle* b

communicating between nibs

2009-11-08 Thread SRD
I have a document based application where I have an outlet in controllerA of A.nib (which is really MyDocument) and I'd like to reference controllerB of B.nib. controllerB is subclassed from NSWindowController where it will either be a sheet or just a window. I'm using xcode 3.2.1. What I'm trying

Re: NSString of selected text in NSTextView

2009-11-08 Thread Todd Heberlein
[[myTextView string] substringWithRange:[myTextView selectedRange]; (Warning, composed in Mail. Potential thorny issues with text attachment characters, surrogate pairs, composed characters, marked text… "the selected text" isn't as simple of a concept as it may seem.) Yeah, one of the concern

Re: Best implementation for iTunes-like playlist structure?

2009-11-08 Thread Dave DeLong
That's good to know. I've decided to put them in while the schema is still malleable. Thanks for the advice. =) Dave On Nov 8, 2009, at 4:48 PM, Graham Cox wrote: On 08/11/2009, at 1:32 PM, Dave DeLong wrote: It has the same data hierarchy as iTunes' playlists (except that I'm not all

Re: code data export import strategies

2009-11-08 Thread Rob Keniger
On 09/11/2009, at 5:18 AM, Martin Hewitson wrote: > I've been digging around for export and import strategies to allow me to > export parts of a core data model. In more detail, I have a set of > categories, each of which contains a set of meetings. Each meeting has a > fairly complex object g

Re: Window setTitle Ignored at Launch?

2009-11-08 Thread Chunk 1978
i've added NSLogs to both methods i've listed, and while it's the windowControllerDidLoadNib: method that launches the app with the first view within the viewControllers array (objectAtIndex:0), the console will print "windowControllerDidLoadNib method called" after it prints "displayViewController

Re: [iPhone] Custom UIView like in iPhone Messages App

2009-11-08 Thread Luke Hiesterman
The idea is that the cap width represents the part of your image that won't be stretched when the image is scaled. For example, take a circle and set the leftCapWidth to half the circles width. Then stretch horizontally and you end up with something that looks like a typical UIslider track

Re: [iPhone] Custom UIView like in iPhone Messages App

2009-11-08 Thread Tharindu Madushanka
Hi I have been trying to figure out whether UIImage method stretchableImageWithLeftCapWidth:topCapHeight:coul

Re: Best implementation for iTunes-like playlist structure?

2009-11-08 Thread Graham Cox
On 08/11/2009, at 1:32 PM, Dave DeLong wrote: It has the same data hierarchy as iTunes' playlists (except that I'm not allowing groups of "playlists" to keep things simple). I'm afraid I don't have much to contribute to your question, but I do think you should reconsider this. In the long

Re: Xcode can't find cpu_capabilities.h?

2009-11-08 Thread Kyle Sluder
On Nov 8, 2009, at 3:31 PM, Chase Meadors wrote: Apparently, the issue was just an error in my code. Somehow one of my arguments to memcpy was set to an astronomical number, and caused this cryptic error... But the issue is resolved, anyway. Inability to find cpu_capabilities.h isn't a bug

Re: Window setTitle Ignored at Launch?

2009-11-08 Thread Graham Cox
But you're merely guessing. Try stopping in the debugger and PROVE whether the method gets called. There's also the strong possibility that something else changes the title after your code does, so you need to find out about that also. The first time you can be sure that an outlet actually

Re: Xcode can't find cpu_capabilities.h?

2009-11-08 Thread Chase Meadors
Apparently, the issue was just an error in my code. Somehow one of my arguments to memcpy was set to an astronomical number, and caused this cryptic error... But the issue is resolved, anyway. On Nov 8, 2009, at 12:52 PM, Jerry Krinock wrote: The first thing I'd try would be to run the pro

Re: Hardware UUID

2009-11-08 Thread Grigutis, John A
Also look at gethostuuid: int gethostuuid(uuid_t id, const struct timespec *wait) I don't think it was around when that technote was last updated. -- John Anthony Grigutis Systems Analyst/Programmer/Mac Specialist Indiana University : UITS : Communication & Support : SDD On Nov 8, 2009, at 3:

Re: Best implementation for iTunes-like playlist structure?

2009-11-08 Thread Kyle Sluder
On Sun, Nov 8, 2009 at 2:24 PM, Dave DeLong wrote: > Looking through the documentation, I see that I can retrieve the > NSPropertyDescription for a fetched property and change its fetch request. >  However, I would imagine that that would change the fetch request in all > instances of that entity

Re: Best implementation for iTunes-like playlist structure?

2009-11-08 Thread Dave DeLong
On Nov 8, 2009, at 2:31 PM, Jerry Krinock wrote: On 2009 Nov 08, at 13:10, Dave DeLong wrote: I've come across several guides and documentation that say the fetched properties can be used to mimic smart playlists in iTunes, but I've yet to see any example or explanation on how that can a

Re: Compile error using @synchronized on methods that return values

2009-11-08 Thread Clark Cox
On Sun, Nov 8, 2009 at 12:11 PM, Stuart Malin wrote: > On Nov 8, 2009, at 2:56 PM, Adam R. Maxwel wrote: > >> On Nov 8, 2009, at 3:03 AM, Ken Tozier wrote: >> >>> "Control reaches end of non-void function" >>> >>> I Googled for "Objective-C accessors and @synchrinized" which seemed to >>> indicate

Re: Best implementation for iTunes-like playlist structure?

2009-11-08 Thread Jerry Krinock
On 2009 Nov 08, at 13:10, Dave DeLong wrote: I've come across several guides and documentation that say the fetched properties can be used to mimic smart playlists in iTunes, but I've yet to see any example or explanation on how that can actually be implemented. I thought that's why they

Re: Best implementation for iTunes-like playlist structure?

2009-11-08 Thread Dave DeLong
I've come across several guides and documentation that say the fetched properties can be used to mimic smart playlists in iTunes, but I've yet to see any example or explanation on how that can actually be implemented. I understand that a fetched property is basically a stored fetch request

Re: Hardware UUID

2009-11-08 Thread Brent Smith
Thanks Jerry, This is exactly what I needed. On Nov 8, 2009, at 12:14 PM, Jerry Krinock wrote: On 2009 Nov 08, at 11:05, Brent Smith wrote: Is there a simple way to obtain and hardware uuid of the mac? Read this first: http://developer.apple.com/mac/library/technotes/tn/tn1103.html __

Re: NSTreeController and object retain counts

2009-11-08 Thread Greg Guerin
Mads Paulin wrote: ... big description ... Can't debug descriptions. Post your code. -- GG ___ 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 c

Re: Pausing an NSThread

2009-11-08 Thread Ron Fleckner
Many thanks to all who helped with this. I've had some very useful discussion off-list with Roland King and I'm on my way to threading nirvana. Ron ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or modera

Re: code data export import strategies

2009-11-08 Thread Kyle Sluder
On Sun, Nov 8, 2009 at 12:21 PM, Jerry Krinock wrote: > Looks like a document to me.  Why not make this a document-based > application?  NSPersistentDocument.  This has been done before :) It sounds to me more like Martin wants to export a fragment of his document, much like someone might send a

NSTreeController and object retain counts

2009-11-08 Thread Mads Paulin
Hi All, I am working on integrating a NSOutlineView and NSTreeController into my application and have bumped into some problems related to objects not being release when remove from the NSTreeController. I have boiled the problem down to the following very basic setup - working in a non-g

Re: code data export import strategies

2009-11-08 Thread Jerry Krinock
On 2009 Nov 08, at 11:18, Martin Hewitson wrote: I want to allow the user to export a meeting which can then be imported by someone else using the same application. Looks like a document to me. Why not make this a document-based application? NSPersistentDocument. This has been done befo

Re: Hardware UUID

2009-11-08 Thread Jerry Krinock
On 2009 Nov 08, at 11:05, Brent Smith wrote: Is there a simple way to obtain and hardware uuid of the mac? Read this first: http://developer.apple.com/mac/library/technotes/tn/tn1103.html ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Ple

Re: NSDocumentController typeForContentsOfURL - inAbsoluteURL is null when path has space in it?

2009-11-08 Thread aaron smith
I figured it out. There was a couple places where I was creating NSURL with [NSURL URLWithString:[@"file:// stringByAppendingString:@"whatever"]]; I switched it to use [NSURL fileURLWithPath:path isDirectory:true] On Sun, Nov 8, 2009 at 11:53 AM, aaron smith < beingthexemplaryli...@gmail.com>

Re: Compile error using @synchronized on methods that return values

2009-11-08 Thread Stuart Malin
On Nov 8, 2009, at 2:56 PM, Adam R. Maxwel wrote: On Nov 8, 2009, at 3:03 AM, Ken Tozier wrote: "Control reaches end of non-void function" I Googled for "Objective-C accessors and @synchrinized" which seemed to indicate that the following was the correct way to handle it - (id) someMeth

NSDocumentController typeForContentsOfURL - inAbsoluteURL is null when path has space in it?

2009-11-08 Thread aaron smith
Hey All, quick question. Has anyone ever run across null parameters being passed to the typeForContentsOfURL when a directory has a space in it? My app uses directories as the document types, but when a space is in the path I get null parameters. Any ideas? Thanks ___

Re: Window setTitle Ignored at Launch?

2009-11-08 Thread Chunk 1978
haven't tried that. i guess i'm struggling with the idea of initiating objects before use. currently (i hope i'm correct) i believe that IB objects which have IBOutlets do not need to be initiated in code prior to use, as the connected outlet has already created a context to the object. so if i

code data export import strategies

2009-11-08 Thread Martin Hewitson
Dear list, I've been digging around for export and import strategies to allow me to export parts of a core data model. In more detail, I have a set of categories, each of which contains a set of meetings. Each meeting has a fairly complex object graph below it (agenda, agenda items, locat

Re: [iPhone] Custom UIView like in iPhone Messages App

2009-11-08 Thread Luke Hiesterman
Sounds like your main problem is not using a background that looks good with scaling. I suggest a new background. Luke Sent from my iPhone. On Nov 7, 2009, at 11:53 PM, Tharindu Madushanka wrote: Hi I have been currently doing something like this. In my chat view I have a scroll view

Hardware UUID

2009-11-08 Thread Brent Smith
Is there a simple way to obtain and hardware uuid of the mac? The only method I have found is it run an NSTask of system_profiler, generate XML, and then read in the dictionary. I am hoping theres some framework Im just missing, and a much easier way to do this. TIA

Re: Xcode can't find cpu_capabilities.h?

2009-11-08 Thread Jerry Krinock
The first thing I'd try would be to run the program without Xcode, and read the system console. ___ 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 coc

Re: Window setTitle Ignored at Launch?

2009-11-08 Thread Kyle Sluder
On Nov 8, 2009, at 10:05 AM, Chunk 1978 wrote: the method does get called at launch, so that is why i don't understand why the window isn't setting it's title. i've even moved the code to set the window title to - (void)windowControllerDidLoadNib:(NSWindowController *)windowController with no

Re: Window setTitle Ignored at Launch?

2009-11-08 Thread Chunk 1978
the method does get called at launch, so that is why i don't understand why the window isn't setting it's title.  i've even moved the code to set the window title to - (void)windowControllerDidLoadNib:(NSWindowController *)windowController with no luck. also, i've added an IBOutlet to the window wi

Re: AHGoToPage function

2009-11-08 Thread Matt Neuburg
On Sun, 08 Nov 2009 02:20:34 +, Ian Piper said: >On 8 Nov 2009, at 01:47, Ian Piper wrote: > >> Hi all, >> >> I hope someone can illuminate me. > >Erm, I just illuminated myself. First, I was typing AHGoToPage, not >AHGotoPage (though I think my version looks nicer). Second, I hadn't >added th

Re: Xcode can't find cpu_capabilities.h?

2009-11-08 Thread Chase Meadors
There appears to be nothing on the console except the normal Xcode spamming that always happens (malloc free garbage... non-zero refcount...). Could this error come from some mistake in using memcpy()? On Nov 8, 2009, at 7:50 AM, John Cebasek wrote: Chase: I had something like this in a C

Re: Compile error using @synchronized on methods that return values

2009-11-08 Thread Adam R. Maxwell
On Nov 8, 2009, at 3:03 AM, Ken Tozier wrote: > "Control reaches end of non-void function" > > I Googled for "Objective-C accessors and @synchrinized" which seemed to > indicate that the following was the correct way to handle it > > - (id) someMethod > { > @synchronized(self) > {

Re: NSTextView won't update via NSThread

2009-11-08 Thread Dalton Hamilton
On Nov 6, 2009, at 5:08 PM, Stephen J. Butler wrote: On Fri, Nov 6, 2009 at 3:50 PM, Dalton Hamilton wrote: Well, from the code you've shown us, you call "[outHandle readDataToEndOfFile]". Which means it waits for all the data before updating the view. So yes, the view will be empty until t

Re: Best implementation for iTunes-like playlist structure?

2009-11-08 Thread Jerry Krinock
Maybe you want a "fetched property". See near bottom of this document: http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/CoreData/Articles/cdRelationships.html#/ /apple_ref/doc/uid/TP40001857 Test performance early and often, though, because often in Core Data, "fetch" =

Re: Compile error using @synchronized on methods that return values

2009-11-08 Thread Dave Keck
What version of GCC are you using? I don't recall seeing that warning since I started using GCC 4. ___ 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 coco

Compile error using @synchronized on methods that return values

2009-11-08 Thread Ken Tozier
Hi I wrote a MySQL connection class and have found that when I use the accessors in multiple threads, the query results seem to be stomping on each other. I looked into using @synchronized(self) to bracket the calls to the lower level socket calls, I'm getting the following warning: "Co

Re: Pausing an NSThread

2009-11-08 Thread Roland King
On 08-Nov-2009, at 5:37 PM, Ron Fleckner wrote: Hi Greg, thanks for the link. I think I've learned that the effect of pausing a thread can be just as easily and more safely achieved by simply stopping it depending on a BOOL on the main thread. Yes? So, in my situation, I would send

Re: Pausing an NSThread

2009-11-08 Thread Ron Fleckner
On 08/11/2009, at 4:34 PM, Greg Guerin wrote: Ron Fleckner wrote: I've finally worked out a way to pause a thread and would like to know if what I'm doing is dangerous or bad or...? Exactly what problem are you trying to solve? Pausing a thread is always potentially dangerous. Any locks

Re: [iPhone] Custom UIView like in iPhone Messages App

2009-11-08 Thread Damien Cooke
Tharindu, I did this by subclassing UITableView and overriding - (void) setBackgroundImage:(UIImage*)image This gives me a static background that the tableView will scroll over the top. Next you need to create a custom cell for your messages and pop them into the UItableView subclass in t