Re: Core Data/IB questions

2008-03-28 Thread Ian Jackson
From a quick look at the app in action, I'd say no. Say for example a school wanted to organise various clubs (chess club, debating club, objective-C club, etc). They could have an entity for each of the clubs, with venue, time, motto etc attributes. Since the members of each club will

Re: C functions and instance variables

2008-03-28 Thread Hamish Allan
On Fri, Mar 28, 2008 at 9:14 AM, Trygve Inda [EMAIL PROTECTED] wrote: I have a Cocoa object with .m and .h files and need to include in this a series of about 30 C functions which all all in their own .c file. Is it possible to give functions in the .c file access to the .m files instance

Re: Is @constantstring pointer equal to @constantstring aguarantee?

2008-03-28 Thread Chris Hanson
On Mar 27, 2008, at 8:39 PM, Jens Alfke wrote: @ strings are actually instances of an immutable private NSString subclass. I think it's called _NSConstantString or some such. Yup. And they're not allocated on the heap; they're stored in the executable itself, although their memory layout is

NSNotifications getting lost in the post

2008-03-28 Thread Nick Forge
I've got a project that is exhibiting some incredibly strange behaviour. A few days ago, my Mac Pro crashed (due to the dreaded Nvidia driver channel exception issue) while I had Xcode and IB open. Ever since then, I've been having an issue where certain instances will not receive certain

QTMovie delegate method with 64 bit

2008-03-28 Thread Holger Hanstein
hi, the QTMovie delegate method: - (BOOL)movie:(QTMovie *)movie shouldContinueOperation:(NSString *)op withPhase:(QTMovieOperationPhase)phase atPercent:(NSNumber *)percent withAttributes:(NSDictionary *)attributes seems not to be called when compiling for 64 bit. For a quick test,

Re: Is @constantstring pointer equal to @constantstring aguarantee?

2008-03-28 Thread Ken Ferry
On Mar 28, 2008, at 2:36 AM, Chris Hanson [EMAIL PROTECTED] wrote: Yup. And they're not allocated on the heap; they're stored in the executable It's slightly more complicated than that -- there's also GCC's -fno-constant-cfstrings option, which will cause at least CFSTR() constants (I'm

Re: setMenuVisible

2008-03-28 Thread Uli Kusterer
On 27.03.2008, at 08:24, Wesley Smith wrote: I'm trying to make an NSWindow that takes up the entire screen including the menu bar but is not actually a fullscreen window. I know this is possible with Carbon, but I can't figure it out with Cocoa. Whenever I call [NSMenu setMenuVisible:TRUE],

Re: Bitmaps and color shift

2008-03-28 Thread glenn andreas
On Mar 28, 2008, at 6:09 AM, Trygve Inda wrote: Why the shift? This is not a jpg file. Is there a better choice over NSDeviceRGBColorSpace? Try NSCalibratedRGBColorSpace Since NSBitmapImageRep's initWith[...] doesn't include a device for device-specific colorspaces, I'd avoid using them

Re: PoseAsClass and NSColorWell (what Apple giveth, Apple taketh away...)

2008-03-28 Thread glenn andreas
On Mar 28, 2008, at 7:14 AM, Graham Cox wrote: Looking through the latest docs I see that as of 10.5, +poseAsClass has been deprecated. This gives me a problem which it previously solved quite neatly. Perhaps someone can help me figure out a different solution... NSColorWell is a handy

changing NSNumber from within another function

2008-03-28 Thread Nick Rogers
Hi, I have: - (void)function1 { NSNumber *moveUp = [NSNumber numberWithBool:NO]; [self function2:moveUp]; //value of moveUp after returning from function2 is the previous one and not the value thats changed in function2 // so the value [moveUp boolValue] here is

Re: Daemon vs. Keychain

2008-03-28 Thread Karl Moskowski
On 28-Mar-08, at 11:22 AM, Derek Chesterfield wrote: If this is Leopard, then signing the executable should avoid this problem. Yes, it's Leopard-only. I was going to put off signing until I got further along in development. I guess I'm going to have to dig into that now. I believe that

Re: QTMovie delegate method with 64 bit

2008-03-28 Thread Nick Zitzmann
On Mar 28, 2008, at 4:36 AM, Holger Hanstein wrote: Does anybody have an explanation or workaround for this behavior? Have you filed a bug? I've found that QTKit 64-bit, as of 7.4.1, has some interesting bugs when you try to do more with it than just play movies. Nick Zitzmann

Re: Daemon vs. Keychain

2008-03-28 Thread Karl Moskowski
On 28-Mar-08, at 11:41 AM, Kyle Sluder wrote: On Fri, Mar 28, 2008 at 10:00 AM, Karl Moskowski [EMAIL PROTECTED] wrote: Is the System keychain an appropriate place to keep a daemon's credentials? If so, how can I get access to the item even after a new version of the daemon executable? Are

Re: changing NSNumber from within another function

2008-03-28 Thread Nick Zitzmann
On Mar 28, 2008, at 9:33 AM, Nick Rogers wrote: - (void)function2:(NSNumber *)value { value = [NSNumber numberWithBool:YES]; } How to change a parameter's value this way from inside a second method. The same way you'd do it in C: (warning - written in Mail, untested, use

Re: CoreAnimation weird problems with NSView animator

2008-03-28 Thread Milen Dzhumerov
Hi, On 27 Mar 2008, at 21:03, Troy Stephens wrote: On Mar 26, 2008, at 9:12 AM, Milen Dzhumerov wrote: [snip] This should produce a fade transition, as long as self.generalView's superview, or an ancestor view higher up, has wantsLayer == YES. This seems to be the problem. The NSView

CATextLayer and subpixel anti-aliasing

2008-03-28 Thread Milen Dzhumerov
Hi all, I've noticed that when using layer backing on a NSTextField the font becomes fuzzy - it seems that it switches from subpixel anti-aliasing to normal. And indeed this seems to be the case. After reading CATextLayer's documentation (assuming that NSTextField uses it to draw its

Re: Cant get Garbage Collection to work

2008-03-28 Thread Quincey Morris
On Mar 28, 2008, at 04:15, Dominik Pich wrote: First then I set the GCC Flag: Garbage Collection _required_: -fobj- gc-only I coded my cocoa document based application as if there were GC... no retain/release and no dealloc.. I started and bigidibam... over-releases -- guess something

iPod Notifications

2008-03-28 Thread Matt Mashyna
I'm trying to detect when an iPod Touch is connected or disconnected. I can see all kinds of stuff in the console when I connect it. Can anyone recommend an notification to listen for when it's connected or disconnected ? I need to keep a list updated with all the connected iPods. If a new

Re: iPod Notifications

2008-03-28 Thread Clark Cox
On Fri, Mar 28, 2008 at 9:27 AM, Matt Mashyna [EMAIL PROTECTED] wrote: I'm trying to detect when an iPod Touch is connected or disconnected. I can see all kinds of stuff in the console when I connect it. Can anyone recommend an notification to listen for when it's connected or disconnected

Re: NSScroller question

2008-03-28 Thread Troy Stephens
As Hamish Allan pointed out, a scroller has logical parts, but they are not subviews. -rectForPart: returns the bounding rects that are used for hit-testing those parts. In the olden days of OpenStep-style Scrollers and their purely rectangular parts, these were exact and the same rects

Re: changing NSNumber from within another function

2008-03-28 Thread Nick Zitzmann
On Mar 28, 2008, at 10:00 AM, Alastair Houghton wrote: To answer your actual question, you might write: - (void)function2:(NSNumber **)value { *value = [NSNumber numberWithBool:YES]; } Careful about that - if value is NULL, then that will cause a crash. That's why you have to check

sharedSpellChecker of an other application?

2008-03-28 Thread Guillaume CERQUANT
Hi all, How can I get the sharedSpellChecker of an other running application? My goal is to get the language used in spell checking by the active application. Thank you, -- Guillaume Cerquant [EMAIL PROTECTED] Tél : +33 (0)6 14 31 18 53 ___

Re: Subverting the first responder chain

2008-03-28 Thread Allen Smith
On Mar 27, 2008, at 8:12 PM, John Stiles wrote: Wow, this sounds like a disaster. Maybe in my -keyDown: call I can walk the menus in the menu bar and call -performKeyEquivalent on all of them. It's probably not fast :| I was in the process of writing code that stores the menu bar's key

iPhone Interface builder

2008-03-28 Thread Ben Densmore
Hi everyone, I'm new to doing iPhone development and trying to get up to speed on the interface builder for iPhone. I see some basic tutorials on doing Cocoa based apps but can't seem to find anything on Cocoa touch and the interface builder. I know it was just released in Beta 2 but are

How to ^set^ preferred localizations?

2008-03-28 Thread Jerry Krinock
Even though I have included six .lproj/Localizable.strings directories in my framework's Resources, -localizedStringForKey:value:table: always ignores my System Preferences or MiniGlot setting and returns results from the English. From reading the remarks of Douglas Davidson,

Re: cocoa http client library

2008-03-28 Thread Jens Alfke
On 28 Mar '08, at 10:59 AM, C Sandeep wrote: Im trying to access a custom http server via my cocoa app. I have looked at various libraries, mainly CFNetwork, available from apple, however Im not sure which one of them to use(Im comfortable using Objective-C over C) . Then why not use

Re: changing NSNumber from within another function

2008-03-28 Thread Alastair Houghton
On 28 Mar 2008, at 17:29, Nick Zitzmann wrote: On Mar 28, 2008, at 10:00 AM, Alastair Houghton wrote: To answer your actual question, you might write: - (void)function2:(NSNumber **)value { *value = [NSNumber numberWithBool:YES]; } Careful about that - if value is NULL, then that will

Re: cocoa http client library

2008-03-28 Thread Greg Titus
Hi Sandeep, Look some more. :-) NSMutableURLRequest, which is the request you pass to the NSURLConnection should allow you to set whatever custom headers you need. - Greg On Mar 28, 2008, at 11:27 AM, C Sandeep wrote: Hi Jens, Thanks. I looked at NSURLConnection docs. It

Re: cocoa http client library

2008-03-28 Thread Alastair Houghton
On 28 Mar 2008, at 18:27, C Sandeep wrote: Hi Jens, Thanks. I looked at NSURLConnection docs. It doesn't allow me to set certain custom headers, while connecting to the http server. Yes it does. Look at NSMutableURLRequest. Kind regards, Alastair. -- http://alastairs-place.net

Re: Cant get Garbage Collection to work

2008-03-28 Thread Sherm Pendley
On Fri, Mar 28, 2008 at 7:15 AM, Dominik Pich [EMAIL PROTECTED] wrote: Hi, I started a simple xcode project and wanted to play with GC but cant get it to work. First then I set the GCC Flag: Garbage Collection _required_: -fobj-gc- only Have you tried using Xcode's build settings instead

Re: CATextLayer and subpixel anti-aliasing

2008-03-28 Thread Troy Stephens
On Mar 28, 2008, at 9:19 AM, Milen Dzhumerov wrote: Hi all, I've noticed that when using layer backing on a NSTextField the font becomes fuzzy - it seems that it switches from subpixel anti- aliasing to normal. And indeed this seems to be the case. After reading CATextLayer's documentation

Re: Cant get Garbage Collection to work

2008-03-28 Thread Quincey Morris
On Mar 28, 2008, at 11:20, Dominik Pich wrote: exactly my point :) there shouldn't be 'any' memory related errors. GC seems to be OFF like my 2. 'check' showed: I also added this 'check' to my awakeFromNib if([[NSGarbageCollector defaultCollector] isEnabled]) NSLog(@GC on);

Re: Cant get Garbage Collection to work

2008-03-28 Thread Robert Douglas
Where do you have GC enabled? My experience has been that you have to set it for each target as the project-level setting gets overridden. On 28-Mar-08, at 11:20 AM, Dominik Pich wrote: exactly my point :) there shouldn't be 'any' memory related errors. GC seems to be OFF like my 2. 'check'

Re: PoseAsClass and NSColorWell (what Apple giveth, Apple taketh away...)

2008-03-28 Thread Jean-Daniel Dupas
Le 28 mars 08 à 13:33, Jeff Johnson a écrit : Graham, If you're just overriding one or two methods of NSColorPanel, you could use the technique I describe here: http://lapcatsoftware.com/blog/2007/11/25/working-without-a-nib-part-6-working-without-a-xib/ It uses the Apple-documented

Re: Cant get Garbage Collection to work

2008-03-28 Thread Quincey Morris
On Mar 28, 2008, at 11:42, Robert Douglas wrote: Where do you have GC enabled? My experience has been that you have to set it for each target as the project-level setting gets overridden. FWIW, I haven't noticed any problem with this on newly-created projects. But Xcode is so

Core Data and NSOperation

2008-03-28 Thread Daniel Thorpe
Hello everyone, I'm a bit of a Core Data newbie, so any thoughts on this would be much appreciated... I have some objects, where each performs calculations, so I've subclassed NSOperation so that I can configure their dependencies and execute them on an NSOperationQueue. I want to store

re: Core Data faulting and bindings: recursive KVO notifications?

2008-03-28 Thread Ben Trumbull
The problem I'm having arises when selecting all images at once (Command+A), if they are fairly large in number (in my store: ~2000). This takes an enormous time that is definitely O(n). Command-A should be instantaneous, even for selections 10x larger. The typical performance problems I've

Re: Core Data and NSOperation

2008-03-28 Thread Quincey Morris
On Mar 28, 2008, at 12:09, Daniel Thorpe wrote: I want to store the objects using Core Data, but have come up with a possible problem. I've not used Core Data before, so I may have understood this incorrectly, but the entities must be subclasses of NSManagedObject, which NSOperation is

Table Header-Style View for a Label

2008-03-28 Thread Andrew Merenbach
Hi, all, I would like to make a header view that looks like an NSTableHeaderView (i.e., with the gradient of such a table header view) for an NSTextView and possibly an NSCollectionView. This view would label the view in question, but also would look like a part of it by virtue of being

Core Data IB in prefs pane (Cannot perform operation without a managed object context)

2008-03-28 Thread Rick Mann
I didn't get any responses, so I'm trying again. I'm clearly missing some link in the whole Core Data thing. I'm trying to use it in a Prefs Pane. I've written no code, just set things up with the data model editor and IB. Is there something NSDocument does to support Core Data that an

Re: iPhone Interface builder

2008-03-28 Thread Conrad Taylor
Hi Ben, the iPhone SDK and all its associated tools are under Non-Disclosure Agreement (NDA). Thus, they cannot be discussed in a public forum at this time. Lastly, I would recommend using the resources located at the following location: http://developer.apple.com/iphone Thank you, -Conrad On

Centering NSTable column titles

2008-03-28 Thread Rick Mann
I'm having some trouble getting my NSTable columns to center. They center nicely in IB, but not in the runtime simulator or my running app. Tried to search the archives, but the Apple list pages aren't cooperating right now. TIA, -- Rick ___

Re: better way to search list archives?

2008-03-28 Thread Rick Mann
On Mar 28, 2008, at 2:34 PM, Milen Dzhumerov wrote: Try http://www.cocoabuilder.com/ Oh that work very well, thank you! -- Rick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: Table Header-Style View for a Label

2008-03-28 Thread Laurent Cerveau
On Mar 28, 2008, at 8:52 PM, Andrew Merenbach wrote: I would like to make a header view that looks like an NSTableHeaderView (i.e., with the gradient of such a table header view) for an NSTextView and possibly an NSCollectionView. This view would label the view in question, but also

Re: better way to search list archives?

2008-03-28 Thread Milen Dzhumerov
Try http://www.cocoabuilder.com/ Milen On 28 Mar 2008, at 21:30, Rick Mann wrote: I'm trying to search for posts on centering NSTable column titles, but search seems to be busted. Even when it's not, it's very slow. Can anyone suggest a better way to search the archives? Some google

Re: machine with null serial number?

2008-03-28 Thread Horst Hösel
Hi All. I am working on a software licensing system that keys itself to the serial # of a particular machine. This has been working fine, except we bumped into a machine with no serial #. It even shows as a blank on Apple System Profiler. Has anybody bumped into this, or know the reason

fixed width of a pane in NSSplitView

2008-03-28 Thread Vladimir Sokolov
Hi All. How can I make fixed width of the left pane in the NSSplitView? I want to make it as in iTunes. When user resize a window only right pane should change width. Thanks! - Vladimir ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: machine with null serial number?

2008-03-28 Thread Kenny Leung
This is a G5 machine, so it must be new enough. Maybe it has been in for repairs. Thanks for the tip! -Kenny On Mar 28, 2008, at 3:33 PM, Horst Hösel wrote: Hi All. I am working on a software licensing system that keys itself to the serial # of a particular machine. This has been working

Re: fixed width of a pane in NSSplitView

2008-03-28 Thread Jens Alfke
On 28 Mar '08, at 3:34 PM, Vladimir Sokolov wrote: How can I make fixed width of the left pane in the NSSplitView? You need to implement the method - (void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize: (NSSize)oldSize in the splitview's delegate. To do what you want, you

Re: fixed width of a pane in NSSplitView

2008-03-28 Thread Milen Dzhumerov
On 28 Mar 2008, at 22:34, Vladimir Sokolov wrote: Hi All. How can I make fixed width of the left pane in the NSSplitView? I want to make it as in iTunes. When user resize a window only right pane should change width. Hi Vladimir, Your split view delegate should implement the following

Re: machine with null serial number?

2008-03-28 Thread Scott Ribe
Some Macs don't have a serial number on the logic board, but rather just stored on the disk. In that case, just reformatting or replacing the hard disk will wipe the serial number. You should read this: http://developer.apple.com/technotes/tn/tn1103.html -- Scott Ribe [EMAIL PROTECTED]

App Crashing when remove an Object

2008-03-28 Thread Mario Gajardo Tassara
Hi to all, In a portion of code of my app (collision detection part) i need to remove an object from an array of objects, when two distinct objects crashed i decrement a life counter, and if this is equal to zero the object must be destroyed, but when the counter reach de zero and the

Re: machine with null serial number?

2008-03-28 Thread Matt Burnett
What macs store their serial number on disk instead of on the logic board? Where did you find this information? On Mar 28, 2008, at 7:32 PM, Scott Ribe wrote: Some Macs don't have a serial number on the logic board, but rather just stored on the disk. In that case, just reformatting or

Re: App Crashing when remove an Object

2008-03-28 Thread Andrew Farmer
On 28 Mar 08, at 18:37, Mario Gajardo Tassara wrote: In a portion of code of my app (collision detection part) i need to remove an object from an array of objects, when two distinct objects crashed i decrement a life counter, and if this is equal to zero the object must be destroyed, but

Re: App Crashing when remove an Object

2008-03-28 Thread Sherm Pendley
On Fri, Mar 28, 2008 at 8:49 PM, Andrew Farmer [EMAIL PROTECTED] wrote: On 28 Mar 08, at 18:37, Mario Gajardo Tassara wrote: In a portion of code of my app (collision detection part) i need to remove an object from an array of objects, when two distinct objects crashed i decrement a life

NSDictionary with bool and float

2008-03-28 Thread Mr. Gecko
Hello I am wondering if there is a way to have a BOOL or a Float in an NSDictionary I know you can in an NSUserDefaults but I need it for NSDictionary so I can save it in a package for themes or whatever. is this possible? Here is my code I tried. NSMutableDictionary *plist =

Re: NSDictionary with bool and float

2008-03-28 Thread Jeff LaMarche
Take a look at NSValue and NSNumber http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSValue_Class/Reference/Reference.html http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/Reference/Reference.html They can be used to store

Re: NSDictionary with bool and float

2008-03-28 Thread Mr. Gecko
Thanks it works with this code NSMutableDictionary *plist = [NSMutableDictionary dictionary]; [plist setObject:@Bob forKey:@name]; [plist setValue:[NSNumber numberWithBool:YES] forKey:@theme]; [plist setValue:[NSNumber numberWithFloat:4.0] forKey:@version]; [plist writeToFile:@/file.plist

Re: Core Data faulting and bindings: recursive KVO notifications?

2008-03-28 Thread Dennis Lorson
On 28 Mar 2008, at 20:24, Ben Trumbull wrote: The problem I'm having arises when selecting all images at once (Command+A), if they are fairly large in number (in my store: ~2000). This takes an enormous time that is definitely O(n). Command-A should be instantaneous, even for selections

Getting view to update from changes made in thread using Core Data

2008-03-28 Thread Jeff LaMarche
I'm detaching a thread to handle some processing. In that thread, I create a new NSManagedObjectContext using the same NSPersistentStoreCoordinator from the main thread. I pass into the thread the NSManagedObjectID of an entity and my thread creates new entities and adds them as children

Re: machine with null serial number?

2008-03-28 Thread David Rogers
Almost the only time that a machine won't report that it has a serial number is after the logic board has been replaced and some technician forgot to reset the serial number. Dave On Mar 28, 2008, at 7:38 PM, Matt Burnett wrote: What macs store their serial number on disk instead of on the

What's a good way to tell contextual menu apart from main menu?

2008-03-28 Thread Graham Cox
I'd like to treat the Paste command that comes from the main Edit menu and a contextual menu slightly differently - in the latter case I want to position the object based on the mouse, for the main menu it just centres it in the view. What's a good way to tell them apart? -- S.O.S.

Re: machine with null serial number?

2008-03-28 Thread Jerry Krinock
Apple recommends using the primary MAC (Media Access Layer) address instead of the machine serial number to uniquely identify a computer for this purpose. Read: http://developer.apple.com/technotes/tn/tn1103.html You can find some code on developer.apple.com named GetPrimaryMACAddress.c

Re: machine with null serial number?

2008-03-28 Thread John Joyce
Indeed it is almost always when a mac has had the logic board replaced/repaired. It does occur. Sometimes even a new batch of macs may ship without serial numbers or even with a system profiler depicting the wrong system. It's pretty rare, but does happen, so it may not be the best thing to

Re: machine with null serial number?

2008-03-28 Thread Graham Cox
How about using a UUID? CFUUID is very easy to use. -- S.O.S. On 29 Mar 2008, at 9:15 am, Kenny Leung wrote: Hi All. I am working on a software licensing system that keys itself to the serial # of a particular machine. This has been working fine, except we bumped into a machine with

Re: What's a good way to tell contextual menu apart from main menu?

2008-03-28 Thread Graham Cox
OK, found a really easy solution - I just use a magic number in the contextual menu item's tag. I'm guessing that for commands such as Paste the tag would generally not have much to do. -- S.O.S. On 29 Mar 2008, at 2:51 pm, Graham Cox wrote: I'd like to treat the Paste command that

Re: machine with null serial number?

2008-03-28 Thread Dave Hersey
On Mar 29, 2008, at 12:26 AM, Graham Cox wrote: How about using a UUID? CFUUID is very easy to use. That and the MAC address are not recommended either, at least by themselves. Same link: http://developer.apple.com/technotes/tn/tn1103.html Neither the getifaddrs nor

Re: Table Header-Style View for a Label

2008-03-28 Thread Andrew Merenbach
Hi, Laurent, Thank you for your response! What you suggested is what I have been doing, and it seems to work, but it still seems just a wee bit like a kludge to me. I'll keep thinking about it. :) Cheers, Andrew On Mar 28, 2008, at 3:00 PM, Laurent Cerveau wrote: On Mar 28,

Re: Core Data faulting and bindings: recursive KVO notifications?

2008-03-28 Thread Ben Trumbull
On Mar 28, 2008, at 7:38 PM, Dennis Lorson wrote: On 28 Mar 2008, at 20:24, Ben Trumbull wrote: The problem I'm having arises when selecting all images at once (Command+A), if they are fairly large in number (in my store: ~2000). This takes an enormous time that is definitely O(n).

Re: Core Data faulting and bindings: recursive KVO notifications?

2008-03-28 Thread Ron Lue-Sang
On Mar 28, 2008, at 10:08 PM, Ben Trumbull wrote: Binding to .selection.a is going to call -valueForKeyPath:@a on the array that's selected, which is 10,000 objects. Since the text field can only show one of those values, this is kinda pointless. This is the source of the recursion.

Re: Core Data and NSOperation

2008-03-28 Thread Daniel Thorpe
Oooh, that might work... But how do you assign independent operations using NSInvocationOperation objects? On 28 Mar 2008, at 19:49, Quincey Morris wrote: On Mar 28, 2008, at 12:09, Daniel Thorpe wrote: I want to store the objects using Core Data, but have come up with a possible