Re: NSOutlineView Not Updating After Adding Items

2009-08-06 Thread Quincey Morris
On Aug 5, 2009, at 13:33, Mark Szymczyk wrote: I'm using NSOutlineView and NSTreeController to display and edit an NSXMLDocument on Mac OS X 10.5. The application uses bindings and is based on the Using Tree Controllers with NSXML Objects example in the Tree-Based XML Programming Guide. I

Re: Core Data completely unable to find the source object model for migration

2009-08-06 Thread Daniel DeCovnick
I had this exact problem. I did exactly what he did, and to continue this, yes, I did create a mapping model. Never got it to work, but I had a user base of 1 and a database of about 10 objects at the time, so I just abandoned attempting migration entirely and recreated the DB with the new

defining NSColor constants

2009-08-06 Thread Arie Pieter Cammeraat
In my app, I use several colors many times. I'd like to define them in a separate file or class. Is there another way to do this than: #define kNiceBlueColor [NSColor colorWithRed: 20 green: 20 blue: 240 alpha:1]; I would like a more obj-c style, like globals.h:

Re: NSMenuItem addTarget retain

2009-08-06 Thread Remko Tronçon
Hi Graham, Yes, NSMenuItem does not retain its target. From the docs: That's exactly the documentation I was looking for, but couldn't find. Thanks! cheers, Remko ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Two right buttons on UINavigationBar?

2009-08-06 Thread Arie Pieter Cammeraat
you might: * change the buttons programmatically every time. * drag 2 UIBarButtonItems in your InterfaceBuilder file, set the connections and the captions in IB. Then in XCode, you can change the buttons by using NSArray * topLevelObjs = nil; topLevelObjs = [[NSbundle mainBndle]

Re: [iPhone] networking

2009-08-06 Thread James Lin
How does Bonjour handle the task of introducing 2 iPhones (located in 2 parts of the world) to each other? The documentations i've found so far all point to Bonjour working on local network only, (even on Apple's website). Can you please point me to the documentation where it explains how

Re: General approach to networking/server problem?

2009-08-06 Thread Alastair Houghton
On 6 Aug 2009, at 04:16, Graham Cox wrote: A general question. Suppose I wanted to write a Cocoa application that could be accessed via a PHP script running on another machine on the local network, what would the general shape of the solution look like? :-) That's kind of a general

Re: [iPhone] networking

2009-08-06 Thread James Lin
My goal: 1. 1 iPhone running my app working as a server waiting for connection from another iPhone from the internet. 2. Another iPhone running my app working as a client connects to the server iPhone and send a string hi, I am James. 3. The server iPhone, upon receiving this string reply

Re: [iPhone] networking

2009-08-06 Thread Keith Duncan
On 6 Aug 2009, at 09:13, Roland King wrote: I've never seen any. I assume that as well as multicast dns there are ways to configure bonjour to point to some central DNS server which would enable something like that to work Yes, you can use regular unicast DNS, and query a specified DNS

Re: defining NSColor constants

2009-08-06 Thread Alastair Houghton
On 6 Aug 2009, at 07:58, Arie Pieter Cammeraat wrote: I would like a more obj-c style, like globals.h: extern NSColor * const kNiceBlueColor globals.m: #import globals.h NSColor * const kNiceBlueColor = [NSColor colorWithRed: 20 green: 20 blue: 240

Re: [iPhone] networking

2009-08-06 Thread Keith Duncan
On 6 Aug 2009, at 09:27, James Lin wrote: [...] keeps querrying the php/mysql server for message left for it with a querry to php/mysql server inside a NSTimer (say querry once every 30 seconds). [...] Is this my best option given what I want to accomplish? I'm afraid it isn't,

Re: [iPhone] networking

2009-08-06 Thread James Lin
Can you please elaborate a bit more? What technology option do I have when it comes to a messaging server? What's involved on the iPhone's side? Thank you in advance... James On 2009/8/6, at 下午 4:33, Keith Duncan wrote: On 6 Aug 2009, at 09:27, James Lin wrote: [...] keeps querrying the

Re: Bonjour over WAN

2009-08-06 Thread Roland King
is there actually any code for that anywhere? And is there any support built into the OSX (or iPhone) Bonjour implementation to do that so you could do say (totally made up code on classes which don't exist) [ CFBonjour useUnicastDNSWithServer:your server here ] or are you just saying

Re: Core Data completely unable to find the source object model for migration

2009-08-06 Thread Matteo Manferdini
Did you create a mapping model? If not, did you specify the NSInferMappingModelAutomaticallyOption option? Yes, I did create one. But I think that the problem is not there, since not knowing the source model, Core Data cannot infer the correct mapping model. For the manual migration I'm sure of

Re: defining NSColor constants

2009-08-06 Thread Graham Cox
Maybe the issue is avoiding a lot of typing for a longish list of colours? Back in the day when struct RGBColor was the mechanism, it was fairly easy to set up long lists of const values and refer to an item by name. Doing this with NSColor is not so straightforward, and making each colour

Re: Generating random numbers

2009-08-06 Thread Mahaboob
Yeah, you are right. I did my own code and is working well for me. My code is : srandom(time(NULL)); BOOL val; val = FALSE; array = [[NSMutableArray alloc]initWithCapacity:15]; firstNo = random()%15+1; [array addObject:[NSNumber numberWithInt:firstNo]];

Accessor methods in Category

2009-08-06 Thread Mahaboob
Is it possible to use accessor methods in category? I need to add one for UIButton class. How can I do it? Thanks in advance Mahaboob. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: Accessor methods in Category

2009-08-06 Thread Graham Cox
On 06/08/2009, at 10:11 PM, Mahaboob wrote: Is it possible to use accessor methods in category? I need to add one for UIButton class. How can I do it? You can add any methods in a category. What you can't add are additional ivars, so if the base class doesn't have the ivar you need,

Re: Accessor methods in Category

2009-08-06 Thread Mahaboob
I subclassed the UIButton class like: @interface MoveButton : UIButton { BOOL canMove; } @property(readwrite) BOOL canMove; @end @implementation MoveButton @synthesize canMove; My main class contains a number of UIButton outlets. How can I use this function with my outlets ? On 8/6/09

Re: Accessor methods in Category

2009-08-06 Thread Graham Cox
On 06/08/2009, at 10:32 PM, Mahaboob wrote: I subclassed the UIButton class like: @interface MoveButton : UIButton { BOOL canMove; } @property(readwrite) BOOL canMove; @end @implementation MoveButton @synthesize canMove; My main class contains a number of UIButton outlets. How can I use

Re: Accessor methods in Category

2009-08-06 Thread Alastair Houghton
On 6 Aug 2009, at 13:32, Mahaboob wrote: I subclassed the UIButton class like: @interface MoveButton : UIButton { BOOL canMove; } @property(readwrite) BOOL canMove; @end @implementation MoveButton @synthesize canMove; My main class contains a number of UIButton outlets. How can I use

Re: [iPhone] networking

2009-08-06 Thread Jeremy Pereira
On 6 Aug 2009, at 09:27, James Lin wrote: Is this my best option given what I want to accomplish? Thanks in advance... Stepping back a little bit. Are you trying to build some sort of real time messaging service? Or does it matter if the second phone doesn't receive the message

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Sean McBride
On 8/5/09 7:39 PM, Pierce Freeman said: Which version of OS X are you using? With the latest of Leopard, it just doesn't seem to work. Are you using the same flags are Ricky? I use SetSystemUIMode (kUIModeAllSuppressed, 0) and Exposé is allowed (which I want). Or do you mean this broke in

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Pierce Freeman
Hi Sean: Yeah, I completely copied his code and inserted it into my project. Even odder, it doesn't allow the Apple-Tab function (which is what it is supposed to do) but lets Exposé work just fine. I don't mean that it broke in the latest version of Leopard, as the old version I was using still

Re: [iPhone] Webview stringByEvaluatingJavaScriptFromString

2009-08-06 Thread Development
It's always the smallest mistake that can frustrate a person no end. Several people caught what I did not. getElementByName was what I wanted... getElementsByName is what I typed. Thank you every one for the catch and I'm sorry for using up bandwidth over a typo. On Aug 5, 2009, at 8:44

Re: defining NSColor constants

2009-08-06 Thread Sean McBride
On 8/6/09 8:38 PM, Graham Cox said: Then add a class method to NSColor in a category: + (NSColor*) calibratedRGBColorWithValues:(const float*) values; Nitpick: use CGFloat instead of float to match NSColor. Especially since you're passing an array of float/doubles. --

Re: [iPhone] networking

2009-08-06 Thread James Lin
well...I guess you can call it some sort of real time messaging service... I just need to send a string from iPhoneA to iPhoneB. And allow iPhoneB to reply with another string back to iPhoneA. That's all I am trying to do. I had no idea it is so difficult and involves so much. given my state

Re: [iPhone] Webview stringByEvaluatingJavaScriptFromString

2009-08-06 Thread Pavel Dudrenov
I dunno about that. Ether give the element an id and use getElementById, or use getElementsByName(theName)[0]. On Thu, Aug 6, 2009 at 8:20 AM, Development developm...@fornextsoft.comwrote: It's always the smallest mistake that can frustrate a person no end. Several people caught what I did

[OT] Re: Generating random numbers

2009-08-06 Thread Alastair Houghton
On 6 Aug 2009, at 17:21, Mac First wrote: Not strictly Cocoa, but a trick I recently incorporated to remove the mod-bias is (email code): float frand = (random() * 1.0) / (RAND_MAX * 1.0); // gives 0.0-0.9... int myRand = frand * 15; // to get a number from 0-14, inclusive. That

Change Opacity of Image

2009-08-06 Thread Pierce Freeman
Hi Everyone: I am looking for an easy way to fade into one photo from another photo. In other words, from the middle point, you can see both of the photos on top of each other to compare the changes. I am currently using Quartz to do this, but am running into a lot of trouble with that, so I am

How to change to the smoother single-stage animation

2009-08-06 Thread Agha Khan
Hi: I am getting this message. Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations. Any idea how to change to smoother single-stage animation? Agha ___

Re: Change Opacity of Image

2009-08-06 Thread Pavel Dudrenov
Look into NSImage and NSCompositingOperation. On Thu, Aug 6, 2009 at 10:17 AM, Pierce Freeman piercefreema...@comcast.net wrote: Hi Everyone: I am looking for an easy way to fade into one photo from another photo. In other words, from the middle point, you can see both of the photos on top

Re: Design Question

2009-08-06 Thread Quincey Morris
On Aug 6, 2009, at 07:46, Kaelten wrote: I guess what I'm wondering then is how do I handle the following case. I have several loosely coupled properties which can read somewhat like this. (ProjectInstall *)projectInstall { return [ProjectInstallController

Re: Core Data completely unable to find the source object model for migration

2009-08-06 Thread Matteo Manferdini
To further investigate the matter, I logged the contents of both the NSStoreModelVersionHashesKey dictionary from my store metadata and the dictionary returned by the entityVersionHashesByName: method of my source model. I did this both for my working app without versioning and the not working one

Re: How to change to the smoother single-stage animation

2009-08-06 Thread Hank Heijink (Mailinglists)
This is new in iPhone OS 3.0. From the documentation for UIViewController: - (void)willAnimateFirstHalfOfRotationToInterfaceOrientation: (UIInterfaceOrientation) toInterfaceOrientationduration: (NSTimeInterval)duration [...] The default implementation of this method does nothing. If you

Re: Two right buttons on UINavigationBar?

2009-08-06 Thread Hank Heijink (Mailinglists)
If one of your buttons is always hidden, why do you need two buttons? You can just use one button and change the title, target, and action when you need to. If necessary you can even replace the whole button. Hank On Aug 6, 2009, at 1:47 AM, Agha Khan wrote: Hi: I have a UINavigationBar

Re: adding a sub menu to multiple super menus?

2009-08-06 Thread Jerry Krinock
On 2009 Aug 05, at 22:08, Graham Cox wrote: On 06/08/2009, at 5:41 AM, David M. Cotter wrote: in carbon, you can have a sub menu that is used in more than one super menu. is there a trick to get this to go in Cocoa? As far as I know a menu has to be a distinct instance - you can't

Re: Could not support development. (after updating iPhone to 3.0.1)

2009-08-06 Thread Dennis Munsie
Kevin -- I've ran into this problem a few times and what ended up fixing it was rebooting the phone. It seems to happen more often after I sync my phone with iTunes, but I'm not 100% sure as to if that's the cause or not. dennis On Tue, Aug 4, 2009 at 9:28 PM, Kevin Callahan kc...@mac.com

Re: NSOutlineView Not Updating After Adding Items

2009-08-06 Thread Mark Szymczyk
How are you adding elements to the XML document? If you're calling add... methods on the NSXML... objects, you'd expect the sort of results you're seeing -- AFAIK the proxy tree maintained by the NSTreeController has no way of knowing that you changed the underlying data model, since AFAIK KVO is

Re: Change Opacity of Image

2009-08-06 Thread douglas welton
Core Image Filters are your friend. Check out the CIFilter reference documentation and you'll find bunches of filters to handle compositing. On Aug 6, 2009, at 1:29 PM, Pavel Dudrenov wrote: Look into NSImage and NSCompositingOperation. On Thu, Aug 6, 2009 at 10:17 AM, Pierce Freeman

Re: NSOutlineView Not Updating After Adding Items

2009-08-06 Thread Quincey Morris
On Aug 6, 2009, at 12:19, Mark Szymczyk wrote: I was calling the NSXML add methods. Thanks for pointing that out. Well, I gave you the wrong answer. That may have been the correct way after all. I tried creating the NSXML objects I want to add and adding them to the tree controller

Re: Change Opacity of Image

2009-08-06 Thread Pierce Freeman
Hi Pavel: Thanks for the suggestion. How would you suggest I get the NSImage to the screen, a custom NSView, NSImageWell, etc? On 8/6/09 10:29 AM, Pavel Dudrenov dudre...@gmail.com wrote: Look into NSImage and NSCompositingOperation. On Thu, Aug 6, 2009 at 10:17 AM, Pierce Freeman

Mixing Objective-C and C++ classes; How?

2009-08-06 Thread Michael A. Crawford
Should the following work (assuming it is included in an Objective-C file with a .mm extension)? @interface CDBPMDetectOperation : NSOperation CDAudioTrackDelegate { class BPMDetect* bpmDetector; // C++ class as an objective-c class member } -Michael smime.p7s Description: S/MIME

Re: Mixing Objective-C and C++ classes; How?

2009-08-06 Thread Shawn Erickson
On Thu, Aug 6, 2009 at 1:51 PM, Michael A. Crawfordmichaelacrawf...@mac.com wrote: Should the following work (assuming it is included in an Objective-C file with a .mm extension)? @interface CDBPMDetectOperation : NSOperation CDAudioTrackDelegate {    class BPMDetect* bpmDetector; // C++

Re: Change Opacity of Image

2009-08-06 Thread Pierce Freeman
Hi Douglas: Do you have one that you can suggest? It doesn't have to do much - just change the opacity. On 8/6/09 12:46 PM, douglas welton douglas_wel...@earthlink.net wrote: Core Image Filters are your friend. Check out the CIFilter reference documentation and you'll find bunches of

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Ricky Sharp
On Aug 5, 2009, at 9:39 PM, Pierce Freeman wrote: Which version of OS X are you using? With the latest of Leopard, it just doesn't seem to work. When writing my initial response to this thread, it was 10.5.7. Just tested with 10.5.8 and all is still well (no Expose, no process

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Pierce Freeman
Really odd, do you think you could send me a little example to see if your same code works on my system? On 8/6/09 2:59 PM, Ricky Sharp rsh...@mac.com wrote: On Aug 5, 2009, at 9:39 PM, Pierce Freeman wrote: Which version of OS X are you using? With the latest of Leopard, it just

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Ricky Sharp
On Aug 6, 2009, at 10:10 AM, Pierce Freeman wrote: Yeah, I completely copied his code and inserted it into my project. Even odder, it doesn't allow the Apple-Tab function (which is what it is supposed to do) but lets Exposé work just fine. I don't mean that it broke in the latest version

Re: Mac OS X 10.5.8 update breaks tokenize function in -[NSXMLNode objectsForXQuery:error:]

2009-08-06 Thread Michael Link
After some more investigation I've discovered that XQuery was updated in Mac OS X 10.5.8 as part of a security vulnerability in the PCRE library which it includes. http://support.apple.com/kb/HT3757 (scroll to bottom of page) Which also explains why all XQuery functions using regular

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Pierce Freeman
That's definitely a possibility. However, I am basically creating my windows the same way that you are. The only difference is, I didn't set any of those attributes and my main window just appears by Cocoa default. On 8/6/09 3:10 PM, Ricky Sharp rsh...@mac.com wrote: On Aug 6, 2009, at

Re: Core Data completely unable to find the source object model for migration

2009-08-06 Thread mmalc Crawford
On Aug 6, 2009, at 10:37 AM, Matteo Manferdini wrote: What I discovered is that in the first case the hashes are the same for the model and the store, while in the second case the model has lost a lot of metadata in the versioning process. Along with my entities there are also other entities

Re: Core Data completely unable to find the source object model for migration

2009-08-06 Thread Adam Swift
On Aug 6, 2009, at 10:37 AM, Matteo Manferdini wrote: To further investigate the matter, I logged the contents of both the NSStoreModelVersionHashesKey dictionary from my store metadata and the dictionary returned by the entityVersionHashesByName: method of my source model. I did this both for

Re: Mixing Objective-C and C++ classes; How?

2009-08-06 Thread Michael A. Crawford
Problem solved. As it turns out the problem was that the class is declared in a C++ namespace. I did not properly scope the class nor was I using a 'using namespace' statement. -Michael -- The united stand. The divided get played. -- Bernie MAC On Aug 6, 2009, at

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Eric Schlegel
On Aug 6, 2009, at 8:10 AM, Pierce Freeman wrote: Hi Sean: Yeah, I completely copied his code and inserted it into my project. Even odder, it doesn't allow the Apple-Tab function (which is what it is supposed to do) but lets Exposé work just fine. Pierce, how are you entering Exposé:

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Pierce Freeman
Hi Eric: I am using the four finger swipe gesture on a Unibody MacBook Pro and the key. Neither of which SetSystemUIMode over rides. Maybe there is a way to just set a window to be at the edges of the screen all the time, and then put the main window in front of that? On 8/6/09 3:59 PM, Eric

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Eric Schlegel
On Aug 6, 2009, at 4:03 PM, Pierce Freeman wrote: Hi Eric: I am using the four finger swipe gesture on a Unibody MacBook Pro and the key. Neither of which SetSystemUIMode overrides. Yes, that's the problem. SetSystemUIMode doesn't prevent entering Exposé via that method. Please file a

Custom Table View Cells and String Text Alignment and Breaking

2009-08-06 Thread Grant Erickson
I am implementing a non-editable custom table view cell (a bit similar to the network connection listing in the System Preferences Network preference pane) in a single-column, no header NSTableView. The cell consists of an image, another image, two stacked strings (left aligned), another string

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Pierce Freeman
Hi Eric: I'll make sure to file a big about that - hopefully it can get resolved before shipment. But, when using the key, it should stop Exposé, shouldn't it? I have also tested this and it still doesn't work. Any ideas? On 8/6/09 5:02 PM, Eric Schlegel eri...@apple.com wrote: On Aug 6,

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Pierce Freeman
And is there any way to make reproduce the display capture effect without using this or SetSystemUIMode. I am attempting to make a full screen app, and don't want the user to have to disable this in the system preferences. On 8/6/09 5:02 PM, Eric Schlegel eri...@apple.com wrote: On Aug 6,

Re: Custom Table View Cells and String Text Alignment and Breaking

2009-08-06 Thread Quincey Morris
On Aug 6, 2009, at 17:08, Grant Erickson wrote: However, with regard to the strings, particularly concerning the right-alignment of the non-stacked string, nudging around the X points to achieve the proper right-alignment seems like the wrong way to approach this and that I should be

Re: Custom Table View Cells and String Text Alignment and Breaking

2009-08-06 Thread Grant Erickson
On 8/6/09 5:08 PM, Grant Erickson wrote: I am implementing a non-editable custom table view cell (a bit similar to the network connection listing in the System Preferences Network preference pane) in a single-column, no header NSTableView. The cell consists of an image, another image, two

embedding framework in Application bundle?

2009-08-06 Thread Michael Link
I'm trying to work around a problem where the latest update of Mac OS X (10.5.8) has a broken XQuery.framework. I've discovered that replacing the XQuery.framework on Mac OS X 10.5.8 with a version from Mac OS X 10.5.7 solves all the problems. I'd like to embed the XQuery.framework from

Re: Design Question

2009-08-06 Thread Ken Thomases
On Aug 6, 2009, at 12:29 PM, Quincey Morris wrote: Finally, the question of whether 'projectInstall' sometimes returns nil is irrelevant. That has nothing to do with the compliance of the Project object. Except, check out Bug Fix in KVO's Dependency Mechanism in the Leopard Foundation

Re: Change Opacity of Image

2009-08-06 Thread Rob Keniger
On 07/08/2009, at 7:10 AM, Pierce Freeman wrote: Do you have one that you can suggest? It doesn't have to do much - just change the opacity. Just use an NSImage and -drawAtPoint:fromRect:operation:fraction: and set a value for the fraction (i.e. the opacity). -- Rob Keniger

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Ken Thomases
On Aug 6, 2009, at 7:18 PM, Pierce Freeman wrote: And is there any way to make reproduce the display capture effect without using this or SetSystemUIMode. I'm not quite clear on what you're saying here. When you say without using this, do you mean without actually capturing the display?

iCal Notifications

2009-08-06 Thread Chris Purcell
I asked this question a while back, didn't get an answer. Figured I'd give it another shot. Is there any access to these notifications through the calendar API? Or is there another way to get access to it? Here is an example of what the notifications are:

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Eric Schlegel
On Aug 6, 2009, at 5:13 PM, Pierce Freeman wrote: Hi Eric: I'll make sure to file a big about that - hopefully it can get resolved before shipment. But, when using the key, it should stop Exposé, shouldn't it? I have also tested this and it still doesn't work. Any ideas? Hmm, yes,

[iPhone] Action sheet on ViewDidLoad

2009-08-06 Thread Sven
Hello, I have a view with a toolbar in which I show an action sheet in viewDidLoad. When the view loads however the action sheet sits slightly too high, revealing about 20-30 pixels of the toolbar at the bottom. If I show the action sheet from a button press in the same view however, it's

Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Chilton Webb
Hi Eric, On Aug 7, 2009, at 12:46 AM, Eric Schlegel wrote: Hmm, yes, the keystroke to invoke Exposé should still be blocked. I can't say offhand why it wouldn't be. I filed a bug on this originally in 2005 (it is still open), radar://4376456 In that specific case, Front Row can bypass kiosk