Trouble with core data and Save As

2010-02-26 Thread Gideon King
I'm having another look at an issue I posted about a couple of weeks ago, where Save As was causing an error. At the time, I was using a custom managed object context. I have now reverted to a standard managed object context. I do not create or release this managed object context anywhere - it g

Re: #define and if statements

2010-02-26 Thread Adam Gerson
Thanks! I can't believe I missed that. Its 1:35am here and its been a long day. Adam On Sat, Feb 27, 2010 at 1:24 AM, Dave DeLong wrote: > #define's are basically a simple find and replace, so if you do: > > #define IsDemo NO; > > and then do: > > if (IsDemo) { ... } > > It's going to become: >

Re: #define and if statements

2010-02-26 Thread Graham Cox
On 27/02/2010, at 5:22 PM, Adam Gerson wrote: > #define IsDemo NO; > What am I doing wrong? Leave out the semi-colon. #define is a macro, the complete text is simply substituted for the name before compilation even starts, so you have the equivalent of if(NO;){...} which is invalid syntax.

Re: #define and if statements

2010-02-26 Thread Roland King
.. oh and static BOOL IsDemo = NO; is a better idea anyway I think .. On 27-Feb-2010, at 2:22 PM, Adam Gerson wrote: > I have the following constant set up. I have tried all three of these > variations and none of them work in an if statement in cocoa. I get > error: expected `)' before ';'

Re: #define and if statements

2010-02-26 Thread Roland King
Take the ';' off the end of the #define, the replaced text is everything to the end of the line, remember #define is just a text expansion, so with this #define IsDemo NO; replaced in this if( IsDemo ) { you're doing this if( NO; ) { and that's your syntax error On 2

Re: #define and if statements

2010-02-26 Thread Dave DeLong
#define's are basically a simple find and replace, so if you do: #define IsDemo NO; and then do: if (IsDemo) { ... } It's going to become: if (NO;) { ... } See the problem? You've got a semicolon in there. Generally, you don't end a #define with a semicolon unless you want a semicolon in t

#define and if statements

2010-02-26 Thread Adam Gerson
I have the following constant set up. I have tried all three of these variations and none of them work in an if statement in cocoa. I get error: expected `)' before ';' token #define IsDemo NO; #define IsDemo false; #define IsDemo 0; if (IsDemo) { bla... } Same problem, when I try: #define Fr

UITableView Won't Update; Crashes with EXC_BAD_ACCESS

2010-02-26 Thread Jason Berlinsky
I'm loading data dynamically from an API using a UISearchBar and trying to display it, using something like this: http://gist.github.com/316354 My UITableViewController code is set up to read from self.data, which is initially a NSArray of @"" elements, as such: http://gist.github.com/316355 Al

Re: Setting parent window

2010-02-26 Thread Steven Degutis
Hi Gaurav, Welcome to Cocoa development! It's fun, and very rewarding. Regarding your question, you really will want to avoid taking Windows design patterns (for both development and user experience) into a Mac app. Not only is what you're trying to accomplish not possible, but it's a really bad u

Re: Improving the User Experience for First Use of Downloadable Software

2010-02-26 Thread Charles Srstka
On Feb 26, 2010, at 3:19 PM, Matthew Lindfield Seager wrote: > An additional step to avoid annoying these people might be to only > order your app to the front if it's the first time it has been > launched...? ($0.02) Ah, good point. So a better solution would be: NSUserDefaults *def = [NSUserDe

Re: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?

2010-02-26 Thread Jonathan Hendry
You might try checking for any telltale running processes, or checking the output of lsof -i for any open sockets that are indicative of a VNC or ARD connection. That might have to run sudo'd as root. http://www.akadia.com/services/lsof_quickstart.txt On Feb 26, 2010, at 18:53 PM, Joe Jones wr

RE: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?

2010-02-26 Thread Joe Jones
That's what I thought. Why? So we can limit certain functionality over a remote connection. We do this for Terminal Services connections on Windows and I was asked about doing it for Mac. Thanx, joe From: Matthew Lindfield Seager [matt...@sagacity.com.

Setting parent window

2010-02-26 Thread Matthew Lindfield Seager
Eric Schlegel  wrote: > Mac OS X does not support window child/parent relationships across processes, > so I think this approach isn't going to work for you. Eric is completely right but I'm wondering if the OP is saying what he means and meaning what he says... Gaurav Srivastava wrote: > I want

Re: Improving the User Experience for First Use of Downloadable Software

2010-02-26 Thread Steve Cronin
Nick; Sorry I created the wrong impression there. Of course I understand that there are 'things to be done' but Joe Consumer doesn't necessarily know this... Furthermore the installer don't make it clear what these things are nor why they should have to be installed now (while the custo

Re: Improving the User Experience for First Use of Downloadable Software

2010-02-26 Thread Nick Zitzmann
On Feb 26, 2010, at 2:38 PM, Steve Cronin wrote: > why does a simple application need to go mucking around on my system? Because there are some things, such as WebKit plugins, Dashboard widgets, etc. that cannot be used without installing them somewhere outside of the application bundle. Nick

Re: Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?

2010-02-26 Thread Matthew Lindfield Seager
On Saturday, February 27, 2010, Joe Jones wrote: > > Thanx, > Joe Why? What are you trying to achieve? I doubt it though! AFAIK you can only have a remote console (i.e. screen sharing) so the app isn't running in the VNC session, it's running normally on the host computer. Your question only ma

Re: Improving the User Experience for First Use of Downloadable Software

2010-02-26 Thread Steve Cronin
Folks; Thanks for the thoughts on this matter! I think Matt raises an great point about hijacking on subsequent launches. Personally I'm mistrustful of installers.. why does a simple application need to go mucking around on my system? why is this application different than all th

Re: NSTableView ignores changes to cell's objectValue outside mouse tracking methods?

2010-02-26 Thread Corbin Dunn
On Feb 26, 2010, at 11:07 AM, Sean McBride wrote: > Hi all, > > So for some days now I've been trying to make a custom NSActionCell that > works in an NSTableView that in turn uses Cocoa Bindings. > > Starting from mmalc's ClockControl example, I now have it working for > simple cases. > > Bas

Re: Improving the User Experience for First Use of Downloadable Software

2010-02-26 Thread Matthew Lindfield Seager
On Friday, February 26, 2010, Charles Srstka wrote: > I suppose for the time being, you could use -[NSApplication > activateIgnoringOtherApps:] in your application delegate’s > applicationDidFinishLaunching: method as a workaround. Caveat Emptor: If you do this you may annoy customers (on subs

Re: NSTableView ignores changes to cell's objectValue outside mouse tracking methods?

2010-02-26 Thread Jens Alfke
On Feb 26, 2010, at 11:07 AM, Sean McBride wrote: > There seems to be something 'special' about the various mouse tracking > methods. It seems that if I change my cell's objectValue outside of the > mouse tracking methods, that the TableView does not pay attention (and > does not update my model

Layer-backed view issue with isOpaque

2010-02-26 Thread Mathieu Coursolle
Hi Cocoa developers, I have a small application that consists of a NSTabView, in which all tabs contain a single custom NSView. That custom view is layer-backed (setWantsLayer:YES in awakeFromNib). So far, the view layer doesn't draw anything, and the NSView drawRect method fills its content

Re: NSWindow - how to resize it keeping aspect ratio?

2010-02-26 Thread Ariel Feinerman
It works: in -applicationWillFinishLaunching: or other init [win setContentAspectRatio: NSMakeSize(kWidth, kHeight)]; [win setContentSize: NSMakeSize(theWidth, theWidth * [win contentAspectRatio])]; then aspect ratio is keeping automatically 2010/2/25 Oftenwrong Soong > On Thu, February 25, 2

Re: High Level Toolkit -- is it obsolete or not?

2010-02-26 Thread Erik Buck
Never call -drawRect: directly. It is a Template Methods i.e. "Don't call us; we'll call you." (Note: there might be some exceptions that prove the rule.) As of Leopard and possibly sooner, individual dirty rectangles are available through the - getRectsBeingDrawn:count: method if you use it w

NSTableView ignores changes to cell's objectValue outside mouse tracking methods?

2010-02-26 Thread Sean McBride
Hi all, So for some days now I've been trying to make a custom NSActionCell that works in an NSTableView that in turn uses Cocoa Bindings. Starting from mmalc's ClockControl example, I now have it working for simple cases. Basically, I'm trying to implement a cell version of NSColorWell. This w

Is there any Cocoa API (or other way) to determine if an application is running in a VNC or ARD session?

2010-02-26 Thread Joe Jones
Thanx, Joe ___ 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://lis

Re: [iPhone 3.1] Core Animation that leaves a trial?

2010-02-26 Thread David Duncan
On Feb 25, 2010, at 8:13 PM, Eric E. Dolecki wrote: > I don't know enough about the specifics, but could an image with a moving > mask reveal the trail? You might be able to do that, its worth a shot at least. You would create a masking layer that is large enough to obscure all of your content

Re: High Level Toolkit -- is it obsolete or not?

2010-02-26 Thread Joel May
Nick, I'm using [NSView setNeedsDisplayInRect: r] and [NSView drawRect: r], so I'm not explicitly flushing and that's not goofing things up. Beam-sync is related to flushing, I think. I don't know how to turn it on or off programmatically and it does not appear in QuartzDebug -- I think it wa

Re: Carbon is C++?

2010-02-26 Thread Sean McBride
On 2/25/10 4:54 PM, Nick Zitzmann said: >Second, C++ is a fine language, and is not going to be deprecated any >time soon, since a lot of stuff in the OS is written in C++ or ObjC++, >such as the Security and WebKit frameworks. The only problem with C++ is >the ABI keeps getting broken between com

Re: Suppress or Fix Inverse Relationship Warnings

2010-02-26 Thread Joanna Carter
> There's a section in the Build Settings entitled "Data Model Compiler (MOMC) > – Warnings". Should find everything you want there. Wonderful. Now I am going to have to change my tutorial. It looks like I am going to have to investigate just what is available in the IDE. The problem, coming fr

Re: Suppress or Fix Inverse Relationship Warnings

2010-02-26 Thread Mike Abdullah
There's a section in the Build Settings entitled "Data Model Compiler (MOMC) – Warnings". Should find everything you want there. On 25 Feb 2010, at 02:37, Steve Steinitz wrote: > Hello, > > After research and reflection I decided to remove some troublesome inverse > relationships from the Core

Problem with a singleton that manages a CoreData context

2010-02-26 Thread Giannandrea Castaldi
Hi, I'm developing an application for iPhone where the persistence is managed with CoreData. I've introduced a singleton to initialize and manage the NSManagedObjectContext, this is how I've defined the singleton: static Persistence *singletonPersistence = nil; @implementation Persistence + (voi