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 gets automatically 
created when I first access it from my persistent document...but this context 
is not where the problem occurs.

When I do a Save As, it migrates to a new store behind the scenes, it appears 
to load my objects into the new store OK, and accesses the attributes OK, but 
then I get a crash where it tries to send a message to a deallocated 
NSManagedObjectContext. This context is created by core data internally as 
Instruments shows:

#   CategoryEvent Type  RefCt   Timestamp   Address Size
Responsible Library Responsible Caller
0   NSManagedObjectContext  Malloc  1   00:28.911   0x11d0d58a0 
240 CoreData-[NSPersistentStoreCoordinator(_NSInternalMethods) 
_retainedAllMigratedObjectsInStore:toStore:]
1   NSManagedObjectContext  Autorelease 00:28.953   
0x11d0d58a0 0   CoreData
-[NSPersistentStoreCoordinator(_NSInternalMethods) 
_retainedAllMigratedObjectsInStore:toStore:]
2   NSManagedObjectContext  Zombie  -1  00:28.955   0x11d0d58a0 
0   CoreData-[NSManagedObjectContext(_NSInternalAdditions) 
_dispose:]

As far as I can see, I never get a look in. It all appears to be triggered by 
[NSPersistentStoreCoordinator 
migratePersistentStore:toURL:options:withType:error:]. 

But obviously there must be something somewhere in my code causing this 
problem. 

I am just totally clueless as to where to look, and would appreciate any 
suggestions.

I thought there might be something happening in one of my awake... methods or a 
dealloc or willTurnIntoFault or didTurnIntoFault, but I didn't find anything 
that looked suspicious. The store is an NSAtomicStore subclass, and I read that 
there could be problems with Save As if newReferenceObjectForManagedObject: did 
not return a constant value, but that isn't called before it crashes...so I'm 
stuck.

Any ideas?


TIA

Gideon

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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:
>
> 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 the place where the 
> #define will be used.
>
> Dave
>
> On Feb 26, 2010, at 11: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 ';' token
>>
>> #define IsDemo NO;
>> #define IsDemo false;
>> #define IsDemo 0;
>>
>>
>> if (IsDemo) {
>>  bla...
>> }
>>
>> Same problem, when I try:
>> #define FreeUpdateDaysAllowed 180;
>> if (daysSoFar > FreeUpdateDaysAllowed)
>>
>>
>> What am I doing wrong? Whats the right way to have a bool or int constant?
>>
>> Thanks,
>> Adam
>> ___
>>
>> 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://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com
>>
>> This email sent to davedel...@me.com
>
>
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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.

--Graham


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 ';' token
> 
> #define IsDemo NO;
> #define IsDemo false;
> #define IsDemo 0;
> 
> 
> if (IsDemo) {
>  bla...
> }
> 
> Same problem, when I try:
> #define FreeUpdateDaysAllowed 180;
> if (daysSoFar > FreeUpdateDaysAllowed)
> 
> 
> What am I doing wrong? Whats the right way to have a bool or int constant?
> 
> Thanks,
> Adam
> ___
> 
> 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://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
> 
> This email sent to r...@rols.org

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 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 ';' token
> 
> #define IsDemo NO;
> #define IsDemo false;
> #define IsDemo 0;
> 
> 
> if (IsDemo) {
>  bla...
> }
> 
> Same problem, when I try:
> #define FreeUpdateDaysAllowed 180;
> if (daysSoFar > FreeUpdateDaysAllowed)
> 
> 
> What am I doing wrong? Whats the right way to have a bool or int constant?
> 
> Thanks,
> Adam
> ___
> 
> 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://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
> 
> This email sent to r...@rols.org

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 the place where the 
#define will be used.

Dave

On Feb 26, 2010, at 11: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 ';' token
> 
> #define IsDemo NO;
> #define IsDemo false;
> #define IsDemo 0;
> 
> 
> if (IsDemo) {
>  bla...
> }
> 
> Same problem, when I try:
> #define FreeUpdateDaysAllowed 180;
> if (daysSoFar > FreeUpdateDaysAllowed)
> 
> 
> What am I doing wrong? Whats the right way to have a bool or int constant?
> 
> Thanks,
> Adam
> ___
> 
> 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://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com
> 
> This email sent to davedel...@me.com



smime.p7s
Description: S/MIME cryptographic signature
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

#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 FreeUpdateDaysAllowed 180;
if (daysSoFar > FreeUpdateDaysAllowed)


What am I doing wrong? Whats the right way to have a bool or int constant?

Thanks,
Adam
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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

All I get from GDB when I do this is: http://gist.github.com/316357

It looks like the NSArray is being populated properly, then things are failing 
on/after the reloadData call (breakpoints confirm this, but can't isolate where 
things are going wrong)

When I remove the NSLog(@"%@",self.data), the application doesn't crash, but 
the UITableView doesn't update. When I replace it with fast enumeration over 
self.data, I get the crash again (crash log: http://pastebin.com/NDVKLsJC).

Any ideas?

smime.p7s
Description: S/MIME cryptographic signature
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

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 user
experience to have a modal window when one is not required. Please look into
reading Apple's documents called the Human Interface Guidelines, your users
(and fellow developers on this list) will really appreciate it.

-Steven


On Thu, Feb 25, 2010 at 7:38 PM, Gaurav Srivastava
wrote:

> Is there any corresponding function call for ::SetParent(in Windows) in
> Cocoa?
> Basically I have a parent application from which I have to launch another
> application. I want the child application to open as modal within the
> parent
> application and not as a separate application.
> I have the window handles of both applications.
> I tried using [NSWindow setParentWindow] but this was not working for me.
>
> Is there any possible solution?
>
> --
> Gaurav Srivastava
> ___
>
> 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://lists.apple.com/mailman/options/cocoa-dev/steven.degutis%40gmail.com
>
> This email sent to steven.degu...@gmail.com
>



-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 = [NSUserDefaults standardUserDefaults];

if([def boolForKey:@“MyAppHasAlreadyBeenLaunched”]) {
[NSApp activateIgnoringOtherApps:YES];
}

[def setBool:YES forKey:@“MyAppHasAlreadyBeenLaunched”];

Charles___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 wrote:

> 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.au]
> Sent: Friday, February 26, 2010 1:41 PM
> To: Joe Jones
> Cc: cocoa-dev@lists.apple.com
> Subject: Re: Is there any Cocoa API (or other way) to determine if an   
> application is running in a VNC or ARD session?
> 
> 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 makes sense in the context of "Terminal Services"
> style connections which aren't available on Snow Leopard [Server]
> without third party software.
> 
> Even if you could know if a user is currently connected via VNC/RDP
> and even if you could tell whether the remote or local session (or
> both at the same time) are currently controlling the computer that
> still wouldn't take into consideration other sharing solutions (e.g.
> LogMeIn).
> 
> Matt
> 
> ___
> 
> 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://lists.apple.com/mailman/options/cocoa-dev/jonhendry%40mac.com
> 
> This email sent to jonhen...@mac.com

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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.au]
Sent: Friday, February 26, 2010 1:41 PM
To: Joe Jones
Cc: cocoa-dev@lists.apple.com
Subject: Re: Is there any Cocoa API (or other way) to determine if an   
application is running in a VNC or ARD session?

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 makes sense in the context of "Terminal Services"
style connections which aren't available on Snow Leopard [Server]
without third party software.

Even if you could know if a user is currently connected via VNC/RDP
and even if you could tell whether the remote or local session (or
both at the same time) are currently controlling the computer that
still wouldn't take into consideration other sharing solutions (e.g.
LogMeIn).

Matt

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.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 the child application to open as modal within the parent
application and not as a separate application.
> I have the window handles of both applications.

Do you mean window or application? Your reference to Windows (capital
W) makes me wonder.

If you meant what you said Eric's answer is correct. If you just want
a separate window (from the same NIB/XIB or a different one) to be
shown modally then that is simple. This should get you started:
http://developer.apple.com/mac/library/documentation/cocoa/conceptual/WinPanel/Concepts/UsingModalWindows.html

If that is what you meant you should also read some intro guides on
Aqua & Cocoa... It's very different to Windows & most Mac users will
notice if you try to do things the Windows way... Apologies if you
know all this & I'm insulting your intelligence!

Matt
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 customer is still just trying to figure out if they even 
want to use the software)
If they want the bells and whistles then the application should provide 
a way to add these later…

Installers are 'intimidating' and another reason to abandon the fragile 
'investigation' impulse a the potential customer…

I'm on a tear to reduce these reasons for abandoning….

My research shows if folks actually install and try my program - they tend to 
buy it!

Steve



On Feb 26, 2010, at 3:59 PM, Nick Zitzmann wrote:

> 
> 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 Zitzmann
> 
> 

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 Zitzmann


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 makes sense in the context of "Terminal Services"
style connections which aren't available on Snow Leopard [Server]
without third party software.

Even if you could know if a user is currently connected via VNC/RDP
and even if you could tell whether the remote or local session (or
both at the same time) are currently controlling the computer that
still wouldn't take into consideration other sharing solutions (e.g.
LogMeIn).

Matt
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 the other 'drag-n-drop' 
applications?
I think it creates another barrier to installation - another excuse for 
the customer to bail...
And it is yet more code to maintain -- for what benefit?

Anyway wouldn't an installer have to pass the 'Quarantine' dialog also?

Steve

On Feb 26, 2010, at 3:19 PM, Matthew Lindfield Seager wrote:

> 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 subsequent launches) who
> launch your application and then switch to Safari/Mail/Finder/other
> while your app is launching... Moments later (or seconds or minutes
> later depending on how long your app takes to launch on that machine)
> your app will appear to hijack the user's computer for no discernible
> reason.
> 
> 
> 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)
> 
> Matt

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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.
> 
> Basically, I'm trying to implement a cell version of NSColorWell.
> 
> This works:
> 
> - (BOOL)startTrackingAt:(NSPoint)startPoint
> inView:(NSView *)controlView
> {
>NSColor* colour = create random colour
>   [self setObjectValue:colour];
> }
> 
> This doesn't:
> 
> - (BOOL)startTrackingAt:(NSPoint)startPoint
> inView:(NSView *)controlView
> {
>NSColor* colour = create random colour
>   [self performSelector:@selector(setObjectValue:)
>   withObject:colour
>   afterDelay:0.0
> }
> 
> 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).
> 
> I want to change my cell's objectValue in response to an action from the
> NSColorPicker.
> 
> Is there a way to 'poke' the tableview so that it notices such a change?


Take a look at the "AnimatedTableView" demo app. I added a custom color well 
cell type of thing, and demonstrate how to update values outside the normal 
click+tracking way of doing things. Last years WWDC talk covered this too (I 
think you can buy it on iTunes).

corbin


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 subsequent launches) who
launch your application and then switch to Safari/Mail/Finder/other
while your app is launching... Moments later (or seconds or minutes
later depending on how long your app takes to launch on that machine)
your app will appear to hijack the user's computer for no discernible
reason.


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)

Matt
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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).

This is pretty much by design. There isn't a cell instance per table cell; 
instead there's only one per column and it's repeatedly called to draw every 
row in that column. This allows the table view to scale to huge numbers of 
rows. So while your cell is being told to do something (like start tracking) 
the table knows what row it's being used for at that moment; but later on 
there's no specific mapping to any particular row.

If you want your cell code to be able to update the model at arbitrary times, 
you'll need to call into your own model code to change the data (and then 
inform the table view that the value changed.)

—Jens___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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
with a opaque colour.

Since the custom view fills its content with a background colour, I would 
assume that I can overwrite
isOpaque to return YES.

However, when I do so, there are artefacts that appear when I change tab. This 
behaviour goes away
if isOpaque returns NO.

From Apple's documentation:
"A view object is opaque if it completely covers its frame rectangle when 
drawing itself."

I would then assume it is the case for my custom view since its drawRect method 
fills the received rectangle with
a plain colour. 

What I am not understanding properly here?

Thanks,

Mathieu





___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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, 2010 7:37:17 AM Alexander Bokovikov <
> openwo...@uralweb.ru> wrote:
> > I don't understand what is the problem. Isn't "my" 422/674 ratio not a
> constant?
> > What is a principal difference between it and "yours" 4/3? Just
> substitute my digits
> > to whatever you need. You'll get just the same result.
>
>
> Just use the defaults system to keep this value. In the preferences pane
> for your app you can create a place for Advanced settings where someone
> could go in and change the aspect ratio if they were so inclined.
>
> Soong
>
>
>
>
> ___
>
> 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://lists.apple.com/mailman/options/cocoa-dev/arielfapple%40gmail.com
>
> This email sent to arielfap...@gmail.com
>
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 within the 
implementation of -drawRect:.  Use - (void)getRectsBeingDrawn:count: for more 
detail beyond the automatically coalesced rectangle passed into -drawRect:.

- (void)getRectsBeingDrawn:(const NSRect **)rects count:(NSInteger *)count

Parameters
rects
On return, contains a list of non-overlapping rectangles defining areas to be 
drawn in. The rectangles returned inrects are in the coordinate space of the 
receiver.

count
On return, the number of rectangles in the rects list.

On Feb 26, 2010, at 9:30 AM, Joel May wrote:

> 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 was 
> removed in Snow Leopard or the newest XCode.  It might be renamed to 
> AutoFlush drawing.
> 
> However, I've found that I was not using the right CG function:  I was using 
> CGContextDrawTiledImage() 
> and should have been using CGContextDrawImage().  In my early testing I came 
> to the mis-conclusion that CGContextDrawTiledImage() was faster.  It is 
> actually about twice as slow.  I was jumping between machines and not being 
> methodical about my testing.
> 
> I've redone speed tests and now if I don't stretch the window, the screen 
> update is fine on my new iMac.  If I do stretch to full screen,  
> CGContextDrawImage() takes about 80 ms and CGContextDrawTiledImage() takes 
> about 140ms.  
> 
> Then I turned on QuartzGL (which I had never heard of until your email, 
> thanks) with 
> HIWindowSetBackingLocation(windowRef, kHIWindowBackingLocationVideoMemory).  
> 
> Now, CGContextDrawImage() takes 4ms or less to update the entire screen.  
> This is beautiful.
> 
> I still need to test on my Tiger, PPC mac.  I'm thinking screen updates with 
> Quartz will be a problem there, but I don't know yet.  I might have to use a 
> separate executable with QuickDraw.  I use copybits in my own dirty rectangle 
> handling in Carbon code. [NSView drawRect: r] seems to coalesce all the dirty 
> rectangles into one big rectangle that also contains a lot of area that is 
> not dirty.  My old code has smaller, non-overlapping dirty rectangles updated 
> with copybits which should be more efficient.
> 
> Conclusion:
> 
> * Quartz is actually sufficiently speedy to update the screen, at least on a 
> new mac.
> * QuartzGL is great, esp when stretching the image.
> * Not sure about Tiger (no QuartzGL) or older machines yet.  Might need to 
> stay with QuickDraw/copybits.
> 
> Thanks for your help.  I would have wasted a lot of time with CoreAnimation, 
> which I don't need for this project.
> 
> Joel
> 
> 
> On Feb 23, 2010, at 5:50 PM, Nick Zitzmann wrote:
> 
>> 
>> On Feb 23, 2010, at 4:35 PM, Joel May wrote:
>> 
>>> Thanks for the info about drawing in a different thread.  I won't waste my 
>>> time and sanity.  I guess I need to figure out how to speed up the drawing 
>>> instead and keep it in the main thread.
>> 
>> How often does your app flush its changes? If it's more than 30 f/s, then 
>> you're wasting redraws, and either need to disable beam sync, or cut back on 
>> the animation. You can use Quartz Debug to find out, and control the beam 
>> sync feature.
>> 
>> Did you also try QuartzGL? It didn't work correctly in Tiger, and it's off 
>> by default in Leopard & Snow Leopard, but it ought to work on most Macs. 
>> Again, you can experiment with this using Quartz Debug.
>> 
>> Nick Zitzmann
>> 
>> 
> 
> ___
> 
> 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://lists.apple.com/mailman/options/cocoa-dev/erik.buck%40sbcglobal.net
> 
> This email sent to erik.b...@sbcglobal.net

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 works:

- (BOOL)startTrackingAt:(NSPoint)startPoint
 inView:(NSView *)controlView
{
NSColor* colour = create random colour
[self setObjectValue:colour];
}

This doesn't:

- (BOOL)startTrackingAt:(NSPoint)startPoint
 inView:(NSView *)controlView
{
NSColor* colour = create random colour
[self performSelector:@selector(setObjectValue:)
   withObject:colour
   afterDelay:0.0
}

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).

I want to change my cell's objectValue in response to an action from the
NSColorPicker.

Is there a way to 'poke' the tableview so that it notices such a change?

Thanks,

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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, then animate 
it so that it reveals that content.
--
David Duncan
Apple DTS Animation and Printing

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 was removed in Snow Leopard 
or the newest XCode.  It might be renamed to AutoFlush drawing.

However, I've found that I was not using the right CG function:  I was using 
CGContextDrawTiledImage() 
and should have been using CGContextDrawImage().  In my early testing I came to 
the mis-conclusion that CGContextDrawTiledImage() was faster.  It is actually 
about twice as slow.  I was jumping between machines and not being methodical 
about my testing.

I've redone speed tests and now if I don't stretch the window, the screen 
update is fine on my new iMac.  If I do stretch to full screen,  
CGContextDrawImage() takes about 80 ms and CGContextDrawTiledImage() takes 
about 140ms.  

Then I turned on QuartzGL (which I had never heard of until your email, thanks) 
with 
HIWindowSetBackingLocation(windowRef, kHIWindowBackingLocationVideoMemory).  

Now, CGContextDrawImage() takes 4ms or less to update the entire screen.  This 
is beautiful.

I still need to test on my Tiger, PPC mac.  I'm thinking screen updates with 
Quartz will be a problem there, but I don't know yet.  I might have to use a 
separate executable with QuickDraw.  I use copybits in my own dirty rectangle 
handling in Carbon code. [NSView drawRect: r] seems to coalesce all the dirty 
rectangles into one big rectangle that also contains a lot of area that is not 
dirty.  My old code has smaller, non-overlapping dirty rectangles updated with 
copybits which should be more efficient.

Conclusion:

* Quartz is actually sufficiently speedy to update the screen, at least on a 
new mac.
* QuartzGL is great, esp when stretching the image.
* Not sure about Tiger (no QuartzGL) or older machines yet.  Might need to stay 
with QuickDraw/copybits.

Thanks for your help.  I would have wasted a lot of time with CoreAnimation, 
which I don't need for this project.

Joel


On Feb 23, 2010, at 5:50 PM, Nick Zitzmann wrote:

> 
> On Feb 23, 2010, at 4:35 PM, Joel May wrote:
> 
>> Thanks for the info about drawing in a different thread.  I won't waste my 
>> time and sanity.  I guess I need to figure out how to speed up the drawing 
>> instead and keep it in the main thread.
> 
> How often does your app flush its changes? If it's more than 30 f/s, then 
> you're wasting redraws, and either need to disable beam sync, or cut back on 
> the animation. You can use Quartz Debug to find out, and control the beam 
> sync feature.
> 
> Did you also try QuartzGL? It didn't work correctly in Tiger, and it's off by 
> default in Leopard & Snow Leopard, but it ought to work on most Macs. Again, 
> you can experiment with this using Quartz Debug.
> 
> Nick Zitzmann
> 
> 

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 compilers, so you might not be able
>to target really old versions of the OS with newer compilers.

Not sure that's the _only_ problem with C++. :)  But I won't start a
language war. :)

On OS X, there are some downsides to choosing C++: one is that the tools
support is not as good.  Xcode's refactoring does not support C++, the
debugger doesn't play nice with STL containers, the STL Debug mode is
broken on 10.6, etc., etc.  C++ support is good, but it's not great.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.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 from many years experience in other IDEs, is finding what 
you can and can't do whilst trying to teach others who are one step behind :-)

Joanna

--
Joanna Carter
Carter Consulting___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 Data model in my multi-machine application.  I've 
> taken steps to avoid database integrity issues and have written accessors to 
> preserve the data embodied in the removed relationships.
> 
> It has brought a small performance increase (especially on refreshing from 
> database) and reduced optimistic locking and 'cannot remove observer' 
> exceptions.
> 
> The hitch is the 30-odd, triply redundant, build warnings re:
> 
>1. not having inverse relationships
>2. No Action delete rules.
> 
> I respect warnings but is there a way to placate the build system on one or 
> both of these specific issues?  Or to suppress the warnings?  Then, I can 
> more easily spot acute warnings.
> 
> Cheers,
> 
> Steve
> 
> 
> ps. lets take off-line any chats about warning and inverse relationship merit.
> 
> ___
> 
> 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://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net
> 
> This email sent to cocoa...@mikeabdullah.net

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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

+ (void)initSingletonWithDataStoreName:(NSString*)aDataStoreName {
  [singletonPersistence release];
  singletonPersistence = nil;
  singletonPersistence = [[Persistence alloc]
initWithDataStoreName:aDataStoreName];
}

+ (Persistence*)singleton {
  return singletonPersistence;
}

In my NSManagedObjects I've introduced a static constructor that
associate the object with the context of the singleton:

+ (id)persistentFeed {
return [NSEntityDescription insertNewObjectForEntityForName:@"Feed"
inManagedObjectContext:[Persistence singleton].managedObjectContext];
}

I've written some tests with SenTestCase: in setUp a new db is created
and in tearDown is removed. In a new test where several managed
objects are associated each other I've the following error:

Unknown.m:0: error: -[FeedTest testUpdateEntries] : Illegal attempt to
establish a relationship 'feed' between objects in different contexts
(source =  (entity: Entry; id: 0x411daa0
 ; data:
{
authorUsername = "jean_1971_2";
feed = 0x4118040
;
publishTime = 2010-02-15 19:20:17 +0100;
text = "X\nx\nx\nx";
}) , destination =  (entity: Feed; id: 0x16d0f0
 ; data: {
feedId = "tag:twitter.com,2007:Status";
title = "Twitter / jean_1971 with friends";
updateTime = "2010-02-26T10:30:20+00:00";
user = 0x4118d10
;
}))

It seems as the managed objects are built with different context but
for each object I've used the context referenced in the singleton.
Debugging I've found out that the reference of the static variable
that keep the singleton (singletonPersistence) changes in the
following manner:
1 - at the start of the test is called the method
initSingletonWithDataStoreName and the variable take a value, ex.
0x41001d0
2 - the method singleton is called several times and the static
variable always return that value
3 - Suddenly (without a call to initSingletonWithDataStoreName) the
value to singleton changes, ex. 0x11ac70, and then is used a different
context
4 - at the end of the test the value of the static variabile return the former

How is possible this behaviour? I thought a static variable in a
module may be changed only in the module.

Any suggestion?

Thanks.

Jean
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com