Re: Maximum image size ?

2016-09-22 Thread Volker in Lists
I am rendering sound sonagrams as contents of CALayers which have dimensions of 
height 1024 pixels and width above 3 pixel. No problem as long as you don’t 
use CIFilters. With them roughly 12000 pixels will work and larger images won’t 
get the filters applied to. I have solved that by using multiple CATiledLayers 
just aligned horizontally. 

The CATiledLayers call drawLayer:inContext and from there I directly draw the 
image (if necessary scaled down). The image is stored as one large CGImage in a 
property of my controller class. For 10.12 the tile size is drastically 
influencing performance, larger tile sizes are better.

So depending on your needs that may be a useful approach. 

volker

> Am 22.09.2016 um 15:14 schrieb Gabriel Zachmann :
> 
> 
> What is the maximum size of a bitmap image I can render using the Core 
> Graphics framework and CALayer ?
> 
> So far, I had assumed it is the maximum texture size the graphics card can 
> handle, so I determined the limits via
>   glGetIntegerv( GL_MAX_TEXTURE_SIZE, _ );
> 
> But apparently , the limits are much higher.
> 
> How can I determine the limit, so that my app can filter out images over the 
> limit, so that it does not crash in such cases?
> 
> I have checked the documentation, in particular 
> CGImageSourceCreateImageAtIndex() et al., to no avail.
> 
> 
> 
> Best regards, 
> Gabriel.
> 
> 
> 
> 
> 
> ___
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/volker_lists%40ecoobs.de
> 
> This email sent to volker_li...@ecoobs.de


___

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

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

Re: CoreData: sorting on a computed attribute

2013-03-15 Thread Volker in Lists
Hi Laurent,

when I faced a similar problem - in my case I needed to filter data acquired 
fromCoreData in a TableView for a field value that wasn't part of the model, 
but existed as an ivar in the NSManagedObject subclass - I used the following:

[self.sessionController setFilterPredicate:[NSPredicate 
predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
 return [(Session*)evaluatedObject fileLocationInvalid];
 }]];

Depending on the complexity of the calculation and the impact on performance 
you may want to do similar.

You may be able to produce a similar result by using a block as comparator 
function for the descriptor. Or write your own comparator function to compare 
the calculated values. In both cases you won't need to create a persistent 
attribute, but do the calculation in the sort descriptor block or compare 
function. 

My 2cents,
Volker

Am 14.03.2013 um 18:11 schrieb Laurent Daudelin:

 I have a need to sort a CoreData table on one attribute in a table that needs 
 to be derived from a calculation. I read about Non-Standard Persistent 
 Attributes and did google and the only way I found to make it work is 
 according to the following:
 


___

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

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


Re: Help w/ first step of creating Help Book for app

2010-05-29 Thread Volker in Lists
Hi Shane,

try the special mailing list Apple has going for help authoring: 
Apple-help-authoring

Probably full on topic there!

Cheers,
Volker



___

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: baseURL problem with +fileURLWithPath:

2010-05-18 Thread Volker in Lists
Robert,

when/where do you call [url path]? It may be released at that moment and thus 
display garbage! What happens if you omit the call to autorelease when creating 
url ?

Volker

Am 18.05.2010 um 13:52 schrieb Robert Monaghan:

 Hi Mike,
 
 This is pretty trivial.. I have a string that is coming from an FCP XML file. 
 The string looks like this:
 file:/localhost/Users/bob/Movies/ARRI/ELAP/shot_1_2/Imagery/Proxies/DMAG001_1_2_TAKE_005_RAWPROXY720P.mov
 
 I then pass the string to an NSURL object using: (Yes, I know I can do a 
 fileURLWithPath: -- I am trying to troubleshoot where the problem is.)
 NSURL *url = [[[NSURL alloc] initFileURLWithPath:[[pathurlArray 
 objectAtIndex:0] stringValue]] autorelease];
 
 Then, I try to get an NSString object by doing:
 [url path]
 
 This is where things go wildly wrong.. the NSString value ends up being a 
 path to my binary.
 
 

___

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: Core Animation vs. Basic Cocoa Graphics

2010-03-11 Thread Volker in Lists
Hi,

are you drawing ALL of your paths whenever the user scrolls or only the ones 
that are within the visible rect? If the first, you may try to change that to 
the second and gain lots of performance. I draw a sound wave view and when 
drawing all of it while zoomed into it, it is sooowww. But when I only draw 
what actually needs to be drawn, it is lightning fast.

With CoreAnimation: As soon as you have the image, you get fast drawing. 
Zooming, Size changes etc. may need a redraw of the image. Also, if the image 
is rather large, you'll need CATiledLayers otherwise your gpu memory may not be 
big enough to hold the image for the CALayer.

Volker

Am 10.03.2010 um 18:13 schrieb Mazen M. Abdel-Rahman:

 Hi All,
 
 I was able to write a simple calendar view that uses basic cocoa graphics to 
 draw directly on the view (NSBezierPath, etc.).  I actually use several 
 different paths for drawing the calendar (it's a weekly calendar) to allow 
 different horizontal line widths (hour, half hour, etc.).  The calendar view 
 is inside a scroll view - and is actually about 3 times longer than the view 
 window.   The main problem is that the scrolling is not smooth - and my 
 assumption is that it's because the NSBezier stroke functions  have to be 
 constantly called to render the calendar.
 
 For something as relatively simple as this would moving to core animation - 
 i.e. trying to render the calendar on a layer instead (I am still trying to 
 learn core animation) add performance benefits?  And would it allow for 
 smoother scrolling?
 
___

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: Core Data - synchronize ManagedObjectContexts - save date

2010-03-01 Thread Volker in Lists
Hi,

some code may help! When using its own context for a NSOperation it works very 
well for me. I never call save when in the NSOperation.

Volker

Am 01.03.2010 um 00:20 schrieb Rainer Standke:

 Hello,
 
 I have an document-based CoreData application that uses an NSOperation to 
 manipulate ManagedObjects. I can successfully synchronize the main thread's 
 context, using mergeChangesFromContextDidSaveNotification:.
 
 However, when I subsequently try to save the document I get a warning that 
 the doc has been saved by another application. This happens in spite of the 
 fact that I update the doc's fFileModificationDate right after 
 synchronisation.
 

___

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: [Q] copy operation and authorization

2009-11-12 Thread Volker in Lists

Hi,

I am using this and I guess it is the recommended way of doing. Works  
well: http://developer.apple.com/mac/library/samplecode/BetterAuthorizationSample/index.html


Volker

Am 12.11.2009 um 18:44 schrieb JongAm Park:


Hello,

I'm trying to copy a file from a desktop to a /Library/Application  
Supports/../Plugins directory.
Because the directory requires to obtain system administrator's  
privilege I should be authorized.


so, I wrote codes like this.

- (void)awakeFromNib
{
  [self authorize];
}

- (void) applicationWillTerminate:(NSNotification *)aNotification
{
  OSStatus myStatus;
  NSLog( @applicationWillTerminate);
myStatus = AuthorizationFree( mAuthorizationRef,  
kAuthorizationFlagDestroyRights );

 }

-(IBAction)copyWithNSFileManager:(id)sender
{
  NSString *PlugInPath = [NSString stringWithString:@/Library/ 
Application Support/Final Cut Pro System Support/Plugins/test3.valm];
NSString *sourceFile = [NSString stringWithFormat:@%@/Desktop/ 
test3.valm, NSHomeDirectory()];

BOOL isSuccessful;
  isSuccessful = [[NSFileManager defaultManager] copyPath:sourceFile  
toPath:PlugInPath handler:nil];

}

-(IBAction)copyWithNSWorkspace:(id)sender
{
  NSString *PluginPath = [NSString stringWithString:@/Library/ 
Application Support/Final Cut Pro System Support/Plugins];
  NSString *sourceDirectory = [NSString stringWithFormat:@%@/ 
Desktop, NSHomeDirectory()];

  NSArray *files = [NSArray arrayWithObject:@test3.valm];
NSInteger tag;
  BOOL isSuccessful = [[NSWorkspace sharedWorkspace]  
performFileOperation:NSWorkspaceCopyOperation

   source:sourceDirectory
  destination:PluginPath
files:files
  tag:tag];
NSLog(@isSuccessful = %@, isSuccessful? @YES:@NO );
}

- (void)authorize
{  OSStatus myStatus;
  myStatus = AuthorizationCreate(NULL,  
kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults,  
mAuthorizationRef);

AuthorizationItem myItems[1];
myItems[0].name = com.greenleaf.FileCopyTest.myRight1;
  myItems[0].valueLength = 0;
  myItems[0].value = NULL;
  myItems[0].flags = 0;
  AuthorizationRights myRights;
  myRights.count = sizeof( myItems ) / sizeof( myItems[0] );
  myRights.items = myItems;
AuthorizationFlags myFlags = kAuthorizationFlagDefaults |  
kAuthorizationFlagInteractionAllowed | kAuthorizationFlagExtendRights;
myStatus = AuthorizationCopyRights(mAuthorizationRef, myRights,  
kAuthorizationEmptyEnvironment, myFlags, NULL);

  if( myStatus == errAuthorizationSuccess )
  {
  NSLog(@Successful in authorizing..  );
  }
 }

Although it returns errAuthorizationSuccess in authorize method,  
when a file is to be copied, it returns fail state and the file is  
not copied.

Can anyone help me to figure out why?

Should I use AuthorizationExecuteWithPrivileges() and invoke an  
external command like cp?
I think it should be possible to copy files with proper privilege  
with Cocoa calls.


Thank you.
JongAm Pawrk
___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: Snow Leopard: Problem with searching .flv files.

2009-11-11 Thread Volker in Lists

Hi,

for me it is: com.adobe.flash.video

acquired using the command line and the command: mdls path/filename

Cheers,
Volker

Am 11.11.2009 um 14:15 schrieb Shashanka L:


Hello,

My application is failing to catch the .flv files while searching in  
Snow Leopard (10.6.1). I am using the 'spotlight searching' for this.


But the same application works well in Leopard.

What is the Uniform Type Identifier ( kMDItemContentType) to be used  
in Snow Leopard to identify  .flv  file types?


Eg : public.avi (Uniform Type Identifier) can be used to search .avi  
file through spotlight.


Any ideas?

Please help..

Thanks,
Shashank Lagvankar



---
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you  
were not an intended recipient, please notify the sender and delete  
all copies. Emails to and from our network may be logged and  
monitored. This email and its attachments are scanned for virus by  
our scanners and are believed to be safe. However, no warranty is  
given that this email is free of malicious content or virus.

___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: Preparing for MOM versioning in version 1

2009-10-26 Thread Volker in Lists

Hi Fritz,

I have it running that way in one of my applications. The user base is  
small ( 50 users), so I might not have yet had the chance to discover  
magic not happening. I also invested a lot of time in the model  
process, to avoid too many changes.


My changes, that worked well, included addition of new properties/ 
fields. No changes to relationships so far. These will be harder I  
guess.


I also have a manual upgrade process for older version files - still  
dating back to 10.4. The manual migration isn't too hard if you can't  
rely on the automagic process.


Hth,

Volker

Am 26.10.2009 um 17:00 schrieb Fritz Anderson:

I'm about to unleash a Core Data-based application, and I'm sure the  
schema will change in later versions. The Core Data Model Versioning  
and Data Migration Programming Guide seems to say that migrating a  
store from one version to another, at least in simple cases, is  
magical: The application embeds the historical MOMs, with one of  
them marked current, and when a store built to an earlier model is  
opened, it is (in SIMPLE cases) migrated to the current model.


Is this the case?

In that event, is it necessary to do anything at all (other,  
perhaps, than attaching a version string for human consumption) in  
version 1 to prepare for migration?


— F

___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: Why getting two awakeFromNib messages??

2009-10-25 Thread Volker in Lists

Hi,

you load the second nib from the main controller i guess. Thereby you  
set the instance of your main ontroller as owner, thus it gets the  
awakeFromNib call. Set your second controller as owner or nil (if you  
have an instance of your second class in your NIB as file owner (!)).


Cheers,
Volker

Am 25.10.2009 um 09:55 schrieb DairyKnight:


Hi all,

I'm trying to use two nib files in my program. In my main controller  
class,

I load the second nib with:

[NSBundle loadNibNamed:second owner:self];


But then, not only does the second controller in the second nib file  
recevie

the awakeFromNib message, but also does the main controller
class. Anyone knows why? Or Cocoa just broadcasts this message to  
every

class?

___

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: Default Core Data errors

2009-10-14 Thread Volker in Lists
Hi Rick,

any messages in the console? Usually you should get more information there. 
Also, what happens when run from Xcode in debug settings? Maybe activate an 
objc_exception_throw breakpoint in advance.

Cheers,
Volker

Am 14.10.2009 um 10:07 schrieb Rick Mann:

 I'm having some issues with my Core Data app. It's based on the Xcode 3.2  
 Core Data document stationery. I thought it was working okay earlier, but now 
 the simplest operation doesn't work. I launch my app, create a new document, 
 save it, and then try to re-open it. The app displays an alert that says The 
 document “Untitled.telem” could not be opened.
 

___

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: Default Core Data errors

2009-10-14 Thread Volker in Lists
Rick,

which StoreType are you using? If it is XML it could be worth looking into the 
raw xml. Otherwise more information on the model and any special methods (if 
any) could be useful. Any changes to the standard CoreData template provided by 
Xcode? 

Is the file readable at all from finder using a hex editor or any command line 
call that accesses the file content? Just to make sure it is not a problem at 
another level. 

The stack trace does - at least for me - not reveal anything CoreData related 
that could be used as a starting point to dig into the problem more deeply. 

Volker

Am 14.10.2009 um 18:44 schrieb Rick Mann:

 
 On Oct 14, 2009, at 09:34:20, Kyle Sluder wrote:
 
 On Wed, Oct 14, 2009 at 9:06 AM, Rick Mann rm...@latencyzero.com wrote:
 No exceptions (I checked Stop on Objective-C Exceptions and created a
 symbolic breakpoint on objc_exception_throw just to be sure).
 
 Also try breaking on -[NSApp presentError:].

___

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: Default Core Data errors

2009-10-14 Thread Volker in Lists
Rick,

you can use po and than most of what you are used in Obj-C like you would use 
in NSLog.

Or just use NSLog and any of the properties a NSError has.

Cheers,
Volker
Am 14.10.2009 um 19:30 schrieb Rick Mann:

 
 On Oct 14, 2009, at 09:57:58, Kyle Sluder wrote:
 
 On Wed, Oct 14, 2009 at 9:44 AM, Rick Mann rm...@latencyzero.com wrote:
 Breaking on all -presentError:, it finally stops here:
 
 Okay, this is the point at which you examine the NSError and see if it
 has any more information for you. :)
 
 Is there a way I can get at that programmatically, rather than via gdb? I'm 
 very clumsy in gdb.
 

___

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: Hiding tab view items

2009-10-12 Thread Volker in Lists

Hi,

there a different roots to success

a) roll your own Tabs instead of Segmented cell in combination with a  
tabless NSTabView

b) Add/remove tab items on demand

Both are fairly easy to achieve with some pitfalls like view retains  
and such. I am using the b) route for something similar and am  
swapping in and out views in a splitview pane on account of user  
choices. I also used route a) for an intelligent  inspector without  
problems.


Cheers,
Volker

Am 12.10.2009 um 16:53 schrieb BareFeet:


Hi all,

I have a hierarchical list of objects, like the typical iTunes or  
XCode left pane. When the user selects a node in this hierarchy, I  
display detail of that node in the pane on the right. This right  
pane is divided into tab view items. Only some of the tab view items  
are relevant to each type of node, so I'd like to hide the tab view  
items that are not relevant. How can I do this?


In interface builder, I can't see any hidden property of tab view  
item. There is a hidden property for the sub-view of a tab view  
item, but this doesn't hide the tab view item itself, so is  
misleading to the user (ie they can click on it, only to see a blank  
view).


I tried using a segmented control, instead, using bindings to link  
it to the tab view (now tabless). But segmented control cells also  
seem to lack a hidden property.


Any ideas?

Thanks,
Tom
BareFeet

___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: Strange Core Data problem after upgrade

2009-10-08 Thread Volker in Lists

Hi,

you need to add a NSNumberFormatter to the text field. Number/String  
conversion does not happen automatically.


Volker

Am 08.10.2009 um 13:49 schrieb Rui Pacheco:


Hi,

Problem A,
Yes, all classes are set correctly in the data modeller.

Also, regarding problem B, this is getting stranger.

If I set the type of the variable to int 32 in the modeller and  
NSNumber in the class and then assign it a value using [entity  
value:forKey] it works just fine. But if I add an NSTextField to IB  
and bind it to that property, it fails with the stringValue error.


If, on the other hand, I set the type to string, on the modeller and  
on the class, IB will work just fine.


This makes me think that somewhere IB isn't converting from string  
to integer, but I don't remember having to set that manually.


Rui



___

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: Strange Core Data problem after upgrade

2009-10-08 Thread Volker in Lists

Hi,

I had to do that in 10.5 - I think - but that is vague memory  
collected by my sieve-brain - it wasn't like that in 10.4.


Volker

Am 08.10.2009 um 15:07 schrieb Rui Pacheco:


True, that seems to be the problem.

Is this new? I've another NSTextField bound to a property of type  
NSNumber that works perfectly and I'm not doing any conversion. The  
one that works was added while I was still using 10.5 and the one  
that doesn't was added while using 10.6.




___

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: Triggering a Method when a Core Data Property is Altered.

2009-10-07 Thread Volker in Lists

Hi,

you call addObserver on that CoreData object - which is a regular  
NSObject descendant anyway. So just as for every other NSObject you  
want to observe a property of. In case of CoreData objects you have to  
deal with it differently than with objects you create your self in  
your code 8and dispose again, since unregistering as observer is  
necessary as well). In Core Data objects awakeFromFetch, -Insert, ...  
etc. They can be undoed, faulted, ... and all that you have to take  
into consideration when observing NSManagedObjects. which is not  
trivial at all in some situations, see the Mailinglist archive for  
that topic, it was covered just weeks ago in length.


As usual - code makes helping easier. I am still not sure what you  
have tried and how. No one else on the list will no neither.



Cheers, Volker

Am 07.10.2009 um 17:05 schrieb Joshua Garnham:


Hi,

I see, how do you observe a CoreData Property?

From: Volker in Lists volker_li...@ecoobs.de
To: Joshua Garnham joshua.garn...@yahoo.co.uk
Sent: Wednesday, 7 October, 2009 8:11:48
Subject: Re: Triggering a Method when a Core Data Property is Altered.

Hi,

you have to add an observer to the CoreData entity - which is  
probably what you haven't done there. Also, you have to observe a  
property, that is observable - otherwise nothing is triggered.


Volker

Am 07.10.2009 um 07:40 schrieb Joshua Garnham:


Volker,

I have tried using the below code to add my self as an observer  
then trigger an action but it doesn't work.


- awakeFromNib {
[self
 addObserver: self
forKeyPath: @name
   options: NSKeyValueObservingOptionNew
   context: NULL];
}
-(id)init {
dispatch
 = [[NSDictionary dictionaryWithObjectsAndKeys:@selector 
(doSomething:),@name, nil] retain];

}
...
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context
{
[self performSelector:msg withObject:object withObject:keyPath];
}

Is there something wrong that is blatantly obvious?

Cheers,
Josh.

From: Volker in Lists volker_li...@ecoobs.de
To: Joshua Garnham joshua.garn...@yahoo.co.uk
Cc: cocoa-dev@lists.apple.com
Sent: Tuesday, 6 October, 2009 18:57:59
Subject: Re: Triggering a Method when a Core Data Property is  
Altered.


Josh,

depending on where you need to get a notification:

a) within the same NSManagedObject or a relationship:http:// 
developer.apple.com/mac/library/documentation/Cocoa/Reference/ 
Foundation/Protocols/NSKeyValueObserving_Protocol/Reference/ 
Reference.html#//apple_ref/occ/clm/NSObject/ 
keyPathsForValuesAffectingValueForKey:


b) in any other object: just register as observer as described in  
KVO basics:http://developer.apple.com/mac/library/documentation/ 
Cocoa/Conceptual/KeyValueObserving/Concepts/KVOBasics.html


Take note: The triggering happens not on the change of the  
TextFieldCell in a table, but due to a property changing.


When you have looked into KVO - what have you tried already?


Cheers,
Volker

Am 06.10.2009 um 18:45 schrieb Joshua Garnham:

 Hi.

 I am trying to trigger a method when A Core Data property is  
changed, e.g A Text Fields Text in a Table (connected to Core Data)  
is changed. I have looked into Key Value Observing but haven't had  
much luck.


 Cheers.




 ___

 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/volker_lists%40ecoobs.de

 This email sent to volker_li...@ecoobs.de






Send instant messages to your online friends http://uk.messenger.yahoo.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: Triggering a Method when a Core Data Property is Altered.

2009-10-07 Thread Volker in Lists

hi,

which Kyle told you has nothing in common with a managedobject nor was  
it clear how that code was used.


You have to call addObserver on the managed object and add the object  
that has to observe as observer. It really depends on your setup where  
to add what best. There exist a couple of possibilities.


If that is not clear, reread KVO documentations over again. Look at  
examples and start with something simple like observing the selection  
in your tree controller (if it is still the same application).


Volker

Am 07.10.2009 um 17:31 schrieb Joshua Garnham:


Hi,

So should I add the Observer in an NSManagedObject sub-class and  
call self?

Also in the email before last I sent the code that I had tried.

Cheers,
Josh.
From: Volker in Lists volker_li...@ecoobs.de
To: Joshua Garnham joshua.garn...@yahoo.co.uk
Cc: cocoa-dev@lists.apple.com
Sent: Wednesday, 7 October, 2009 16:09:55
Subject: Re: Triggering a Method when a Core Data Property is Altered.

Hi,

you call addObserver on that CoreData object - which is a regular  
NSObject descendant anyway. So just as for every other NSObject you  
want to observe a property of. In case of CoreData objects you have  
to deal with it differently than with objects you create your self  
in your code 8and dispose again, since unregistering as observer is  
necessary as well). In Core Data objects awakeFromFetch, - 
Insert, ... etc. They can be undoed, faulted, ... and all that you  
have to take into consideration when observing NSManagedObjects.  
which is not trivial at all in some situations, see the Mailinglist  
archive for that topic, it was covered just weeks ago in length.


As usual - code makes helping easier. I am still not sure what you  
have tried and how. No one else on the list will no neither.



Cheers, Volker

Am 07.10.2009 um 17:05 schrieb Joshua Garnham:


Hi,

I see, how do you observe a CoreData Property?

From: Volker in Lists volker_li...@ecoobs.de
To: Joshua Garnham joshua.garn...@yahoo.co.uk
Sent: Wednesday, 7 October, 2009 8:11:48
Subject: Re: Triggering a Method when a Core Data Property is  
Altered.


Hi,

you have to add an observer to the CoreData entity - which is  
probably what you haven't done there. Also, you have to observe a  
property, that is observable - otherwise nothing is triggered.


Volker

Am 07.10.2009 um 07:40 schrieb Joshua Garnham:


Volker,

I have tried using the below code to add my self as an observer  
then trigger an action but it doesn't work.


- awakeFromNib {
[self
 addObserver: self
forKeyPath: @name
   options: NSKeyValueObservingOptionNew
   context: NULL];
}
-(id)init {
dispatch

 = [[NSDictionary dictionaryWithObjectsAndKeys:@selector 
(doSomething:),@name, nil] retain];

}
...
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context
{
[self performSelector:msg withObject:object withObject:keyPath];
}

Is there something wrong that is blatantly obvious?

Cheers,
Josh.

From: Volker in Lists volker_li...@ecoobs.de
To: Joshua Garnham joshua.garn...@yahoo.co.uk
Cc: cocoa-dev@lists.apple.com
Sent: Tuesday, 6 October, 2009 18:57:59
Subject: Re: Triggering a Method when a Core Data Property is  
Altered.


Josh,

depending on where you need to get a notification:

a) within the same NSManagedObject or a relationship:http:// 
developer.apple.com/mac/library/documentation/Cocoa/Reference/ 
Foundation/Protocols/NSKeyValueObserving_Protocol/Reference/ 
Reference.html#//apple_ref/occ/clm/NSObject/ 
keyPathsForValuesAffectingValueForKey:


b) in any other object: just register as observer as described in  
KVO basics:http://developer.apple.com/mac/library/documentation/ 
Cocoa/Conceptual/KeyValueObserving/Concepts/KVOBasics.html


Take note: The triggering happens not on the change of the  
TextFieldCell in a table, but due to a property changing.


When you have looked into KVO - what have you tried already?


Cheers,
Volker

Am 06.10.2009 um 18:45 schrieb Joshua Garnham:

 Hi.

 I am trying to trigger a method when A Core Data property is  
changed, e.g A Text Fields Text in a Table (connected to Core  
Data) is changed. I have looked into Key Value Observing but  
haven't had much luck.


 Cheers.




 ___

 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/volker_lists%40ecoobs.de

 This email sent to volker_li...@ecoobs.de






Send instant messages to your online friends http://uk.messenger.yahoo.com



Send instant messages to your online friends http://uk.messenger.yahoo.com


___

Cocoa-dev mailing list (Cocoa-dev

Re: Triggering a Method when a Core Data Property is Altered.

2009-10-07 Thread Volker in Lists

Hi.

Is this any better? See bewlo, and in addition: Did it work? It  
shouldn't have worked :-/


On NSManagedObject side:

According to Apple the initWithEntity should not be overridden (http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CoreData/Articles/cdCreateMOs.html 
)


you are discouraged from overriding  
initWithEntity:insertIntoManagedObjectContext:; instead, Core Data  
provides several other means of initializing values—these are  
described in “Object Life-Cycle—Initialization and Deallocation.”


The blue links to: “Object Life-Cycle—Initialization and Deallocation.”

So add it to awakeFromInsert or / and awakefromFetch

On observee side:

[performSelector...] can't work and you should get a warning when  
compiling. Take these warnings seriously and try to understand them,  
because they exist for a good reason!


[self performSele...] for example would work, even so [self  
selectorname] is more simple to read.


You will be in need to remove the observer again - that depends on  
different aspects. I am referring again to the mailing list archive.


Volker

Am 07.10.2009 um 17:55 schrieb Joshua Garnham:


Hi,

Here's what I have done, I have subcalssed NSManagedObject and added  
the following code …


- (id)initWithEntity:(NSEntityDescription *)entity  
insertIntoManagedObjectContext:(NSManagedObjectContext *)context {
[self addObserver:[NSApp delegate] forKeyPath:@name  
options:NSKeyValueObservingOptionNew context:nil];

}

… And in my App Delegate …

- (void)observeValueForKeyPath:(NSString *)keyPath
  ofObject:(id)object
change:(NSDictionary *)change
   context:(void *)context {
[performSelector:@selector(doSomething:)];
}

Is this any better?

___

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: Strange Core Data problem after upgrade

2009-10-07 Thread Volker in Lists

Hi,

problem A:
have you made sure you have set the class in the data modeler  
correctly for that ManagedObject? When googling for your error message  
I do receive such problems that were fixed by setting the proper  
custom class name.


Cheers,
Volker
___

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: Triggering a Method when a Core Data Property is Altered.

2009-10-07 Thread Volker in Lists

Hi,

awakeFromFetch is only called when the object is loaded from the  
persistent store (=fetched). So all newly inserted objects are not  
observed.


this might be one reason for not getting triggered for rows 2/3 if  
they were not fetched but created. Otherwise I have no idea why it  
doesn't work yet-


Volker

Am 07.10.2009 um 18:54 schrieb Joshua Garnham:


Hi,

Ok, I have changed it to awakeFromInsert: and have removed the  
observer in the NSManagedObjects dealloc: method.

And have already fixed the performSelector: problem.

So the NSManagedObject sub-class looks like …

- (void) awakeFromFetch {
[self addObserver:[NSApp delegate] forKeyPath:@name  
options:NSKeyValueObservingOptionNew context:nil];

}

- (void)dealloc {
[self removeObserver:[NSApp delegate] forKeyPath:@name];
[super dealloc];
}

… and the App Delegate …

- (void)observeValueForKeyPath:(NSString *)keyPath
  ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context {
[self performSelector:@selector(doSomthing:)];
}

It builds without any warnings but it only half works.
What happens is as follows …
In my table view I have added three rows, each have text fields  
bound to the 'name' property.
The method is triggere when I change the text for the first row  
however it is not triggered when I change the text for the

other rows. Do you have any idea why this is?

___

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: Triggering a Method when a Core Data Property is Altered.

2009-10-06 Thread Volker in Lists

Josh,

depending on where you need to get a notification:

a) within the same NSManagedObject or a relationship: 
http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueObserving_Protocol/Reference/Reference.html#//apple_ref/occ/clm/NSObject/keyPathsForValuesAffectingValueForKey:

b) in any other object: just register as observer as described in KVO  
basics: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/KeyValueObserving/Concepts/KVOBasics.html


Take note: The triggering happens not on the change of the  
TextFieldCell in a table, but due to a property changing.


When you have looked into KVO - what have you tried already?


Cheers,
Volker

Am 06.10.2009 um 18:45 schrieb Joshua Garnham:


Hi.

I am trying to trigger a method when A Core Data property is  
changed, e.g A Text Fields Text in a Table (connected to Core Data)  
is changed. I have looked into Key Value Observing but haven't had  
much luck.


Cheers.




___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: no display until header clicked

2009-10-05 Thread Volker in Lists

Hi,

without knowing how you add objects to the ArrayController - and when,  
and without knowing what and how is bound exactly - guessing is most  
that can be done.


It seems the bindings are okay from the beginning, but the changes to  
the ArrayControllers content are only observed when the sortOrder is  
changed. Maybe you need only a single [NSArrayController  
rearrangeObjects] call or similar.


Volker

Am 05.10.2009 um 18:32 schrieb David Hirsch:

My window has two NSTableViews.  Each has two columns, each of which  
is bound to a field in Phases, an NSArrayController.


When my window is displayed, I calculate my model, and the  
NSTableViews show the headers, but blank data cells.  However, when  
I click the header of one table, all four columns get populated with  
data.  As far as I can tell (I've set breakpoints), this happens  
without calling any of my code.  Note that this only works if I  
click a text-based column.  If I click the column with image cells,  
I get no response, so presumably the TableView is trying to sort the  
data on the click, and somehow straightens out the previously mucked- 
up binding at that time.


I'm posting here without code to see if anybody has experienced this  
before.  It will be a major undertaking to reduce this problem to a  
post-able amount of code.


I've tried making Phases (the NSArrayController) the data source and  
delegate in addition to the column bindings, without solving the  
problem.  I've tried adding another NSTableView and binding it to  
other columns to see if I had done it wrong the first time.  That  
did not help.  The fact that the bindings do work after the click  
seems to suggest that the binding setup is okay.


Thanks in advance,
Dave





___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: no display until header clicked

2009-10-05 Thread Volker in Lists

Hi,

 - have you bound contentArray of the ArrayController in IB?
 - how do you populate with data?

In general: Bindings work by the magic of KVO (key value observing).  
This means, that whenever calls to KVO compliant setters are made, in  
the background willchangevalueforkey/didchangevalueforkey messages are  
sent. That way the UI is informed of changes. Rearrangecontet does  
that for the content value of a controller... so you seemed to have  
populated the array controller in a non KVO way... but still, w/o code  
not to be discussed.


Cheers,
Volker



Am 05.10.2009 um 18:47 schrieb David Hirsch:

Thanks, Volker.  rearrangeObjects did work, but I don't understand  
why that call should be necessary.  If anybody out there wants to  
educate me, I'd appreciate it.


(More info: I have my ArrayController in IB bound to an array  
(phases) of File's Owner (which is my NSDocument subclass).  In the  
document's init method, I make phases an empty NSMutableArray, and  
in the document's windowControllerDidLoadNib method, I populate that  
array with data.)


-Dave

On Oct 5, 2009, at 9:40 AM, Volker in Lists wrote:


Hi,

without knowing how you add objects to the ArrayController - and  
when, and without knowing what and how is bound exactly - guessing  
is most that can be done.


It seems the bindings are okay from the beginning, but the changes  
to the ArrayControllers content are only observed when the  
sortOrder is changed. Maybe you need only a single  
[NSArrayController rearrangeObjects] call or similar.


Volker

Am 05.10.2009 um 18:32 schrieb David Hirsch:

My window has two NSTableViews.  Each has two columns, each of  
which is bound to a field in Phases, an NSArrayController.


When my window is displayed, I calculate my model, and the  
NSTableViews show the headers, but blank data cells.  However,  
when I click the header of one table, all four columns get  
populated with data.  As far as I can tell (I've set breakpoints),  
this happens without calling any of my code.  Note that this only  
works if I click a text-based column.  If I click the column with  
image cells, I get no response, so presumably the TableView is  
trying to sort the data on the click, and somehow straightens out  
the previously mucked-up binding at that time.


I'm posting here without code to see if anybody has experienced  
this before.  It will be a major undertaking to reduce this  
problem to a post-able amount of code.


I've tried making Phases (the NSArrayController) the data source  
and delegate in addition to the column bindings, without solving  
the problem.  I've tried adding another NSTableView and binding it  
to other columns to see if I had done it wrong the first time.   
That did not help.  The fact that the bindings do work after the  
click seems to suggest that the binding setup is okay.


Thanks in advance,
Dave





___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de






Dave Hirsch
Associate Professor
Department of Geology
Western Washington University
persistent email: dhir...@mac.com
http://www.davehirsch.com
voice: (360) 389-3583
aim: dhir...@mac.com
vCard: http://almandine.geol.wwu.edu/~dave/personal/DaveHirsch.vcf






___

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: [Solved] Re: NSTableView: no display until header clicked

2009-10-05 Thread Volker in Lists

Hi,

maybe it works even without these two lines - how are you populating  
the array controller in code ?



Cheers,
Volker

Am 05.10.2009 um 19:19 schrieb David Hirsch:

That's right on the money:  The array was indeed bound to the  
contentArray in IB (otherwise it would never have been able to show  
any data), but I needed to surround my populating of the array with:


[phaseController willChangeValueForKey:@arrangedObjects]

and

[phaseController didChangeValueForKey:@arrangedObjects];

Thanks,
Dave


___

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: Best Design Advice

2009-09-27 Thread Volker in Lists

Hi,

Am 14.11.2009 um 22:25 schrieb David Blanton:

Should not  the app be installed in a particular location so that it  
starts when the user logs in?


You can add any app, located at any location (nearly at any) to the  
Startup Items of a user and the app gets started. No need to be in a  
special place for that. Just has to be available at user login time.




And, does this not imply that the user should not have the option of  
specifying where the app is installed.


The user should have free choice - let it be /Applications or ~/ 
Applications for example. Since nothing is implied from the first  
step, no problem.




And, if there is a particular location to be installed so that the  
app runs at login are there not permission issues?


The user can not install the app to locations where he doesn't have  
write access to or where he can't get temporary write access.


What have you looked into? Your current questions are rather vague and  
not Cocoa related so far.


? http://whathaveyoutried.com/



Volker


___

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: Populating TableView Via Button.

2009-09-18 Thread Volker in Lists

Hi,

best solution would be to update the datasource...

Swapping views just for the sake of displaying new data is not  
something one should do. Have you read up on how to implement a  
datasource for NSTableView?


Maybe you try to follow this old, but still useful tutorial: 
http://www.cocoadev.com/index.pl?NSTableViewTutorial

Volker


Am 18.09.2009 um 16:44 schrieb Sean Kline:

Would an alternative implementation be to have the button click swap  
in a

view with a NSTableView bound to its data source?


___

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: Retrieving the selected object in an NSOutlineView.

2009-09-16 Thread Volker in Lists

Hi,

try to call representedObject on one of the items returned by  
selectedObjects - this gives you the object as it sits in your object  
graph (probbly still CoreData). Then you can use the keyPath for  
children on the returned object. Et voila.


Volker

Am 16.09.2009 um 17:20 schrieb Joshua Garnham:



I
am looking to retrieve the selected object in an NSOutlineView so I  
can

see if the selected object has any children. How would I do this?
I know the NSTreeController has selectedObject but how would I  
implement this and then check if it has children.


Cheers!

___

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: @property (retain) - Do I need to release in dealloc?

2009-09-09 Thread Volker in Lists

Hi,

release is necessary, as others already told you. One clarification  
that I got on a similar post is:



-dealloc should always access instance variables directly; it should
not call accessor methods.  Currently this is impossible to do with
synthesized instance variables, but that is considered a bug.

--Kyle Sluder




Volker
___

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: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Volker in Lists

Hi,


   NSArray *selectedRow = [treeController selectedObjects];


you get an NSArray - so you should enumerate through the objects of  
the array



   NSInteger childrenCount = [selectedRow.children count];


Does not get the children count of anything but the NSArray, which it  
doesn't have. You should get a warning when compiling. Something along  
struct or union doesn't blah, blah blah.


Told you before: Read the warnings and try to understand them.

Cheers,
Volker


___

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: 10.6: Check Box Cells in NSTableViews always editable!

2009-08-31 Thread Volker in Lists

Hi,

have you changed the binding conditionally sets enabled respectively  
conditionally sets editable ? That did the trick before on 10.5


volker

Am 31.08.2009 um 20:21 schrieb Gerd Knops:

Seems that in Snow Leopard the editable setting in the column  
attributes is ignored for Check Box Cells in NSTableViews.


That is causing trouble, for example when the bound value is read- 
only.


Anyone knows of a workaround? I tried hooking up the editable  
binding of both column and cell to a method always returning NO,  
but that did not help.



___

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: Core Data Crash on MOC Release

2009-08-13 Thread Volker in Lists

Hi,

do you have any observers or such on objects inside the moc (speak on  
entities)? I had a hard to trace down crash similar to yours and in my  
case I just needed some cleanup work on -didTurnToFault for the  
entity. Are there relationships established and not destroyed again  
completely. Again -didTurnToFault may be a good place to clean up some  
stuff.


As a side note:

Why don't you call
self.persistentStoreCoordinator = nil;
instead of releasing the persistentStoreCoordinator ?

self.delegate = nil; could also be useful - I had bad experiences by  
the delegate retaining my object... and setting it to nil helped there  
as well.


Cheers,
Volker

Am 13.08.2009 um 16:51 schrieb Greg Reichow:


Long time lurker, first time to post.

I have a iPhone 3.0 application that is using core data in an  
NSOperation to perform some updates.  It is using it's own  
NSManagedObjectContext connected to a common (with the main thread)  
persistent store coordinator.  Everything works great until the  
NSOperation ends and is releasing the managed object context.  I get  
an EXC_BAD_ACCESS on the operation thread.  Here is the trace:


#0  0x91a3c688 in objc_msgSend
#1	0x0036c854 in -[_PFManagedObjectReferenceQueue  
_processReferenceQueue:]
#2	0x003a7c40 in -[NSManagedObjectContext(_NSInternalAdditions)  
_dispose:]

#3  0x0040c92d in _deallocateContextBackgroundThread
#4  0x0035f41c in minion_duties2
#5  0x96777155 in _pthread_start
#6  0x96777012 in thread_start

At first I had assumed a simple memory management problem.  The MOC  
is alloc'd by method call from the main method and released in the  
dealloc method of the operation.  New objects are being inserted  
into this MOC  saved (and the main thread MOC being merged) before  
the dealloc.  One clue is that if no new objects are added, it does  
not cause the crash above.  So, my guess is that something bad is  
happening to the managed objects and they are being over-released?   
During the creation of managed objects, at certain intervals a local  
autorelease pool is created, then objects saved, then the pool is  
drained.  Yet, even if the managed objects are released, it does not  
seem that the context should crash on it's own release?


I have spent some time searching on google and found another case of  
this occurring.  Yet, the solution was to set the MOC to retain the  
managed objects.  This did not work in my case.  I have also tried  
forcing the MOC to processPendingChanges and also reseting prior to  
the release to see if that would help, no luck.  Of course,  
eliminating the release of the MOC in the dealloc method did keep it  
from crashing (and everything works great), but this then becomes a  
leak.


Anyone have a similar problem or an idea on how to further figure  
this out?


Here is a cut of the code showing the relevant sections.

.h

#import Foundation/Foundation.h
@interface GRUpdateDatabaseOperation : NSOperation
{
id  delegate;
NSManagedObjectContext  *managedObjectContext;
NSPersistentStoreCoordinator
*persistentStoreCoordinator;
}

@property (nonatomic, assign) id delegate;
@property (nonatomic, readonly) NSManagedObjectContext  
*managedObjectContext;
@property (nonatomic, retain) NSPersistentStoreCoordinator  
*persistentStoreCoordinator;


- (id)initWithDelegate:(id)aDelegate persistentStoreCoordinator: 
(NSPersistentStoreCoordinator *)aPersistentStoreCoordinator;


@end

.m
#import GRUpdateDatabaseOperation.h
@implementation GRUpdateDatabaseOperation

@synthesize delegate;
@synthesize persistentStoreCoordinator;

- (id)initWithDelegate:(id)aDelegate persistentStoreCoordinator: 
(NSPersistentStoreCoordinator *)aPersistentStoreCoordinator

{
if (!(self = [super init])) {
return nil;
}
self.delegate:aDelegate;
self.persistentStoreCoordinator = aPersistentStoreCoordinator;
return self;
}

- (void) dealloc
{
[managedObjectContext release]; // problem with crash is here!
[persistentStoreCoordinator release];
[super dealloc];
}

#pragma mark Core Data Stuff

- (NSManagedObjectContext *) managedObjectContext {

   if (managedObjectContext != nil) {
   return managedObjectContext;
   }

   NSPersistentStoreCoordinator *coordinator =  
self.persistentStoreCoordinator;

   if (coordinator != nil) {
   managedObjectContext = [[NSManagedObjectContext alloc] init];
   [managedObjectContext setPersistentStoreCoordinator:  
coordinator];
		[managedObjectContext setUndoManager:nil]; // speeds up  
performance for no undo

   }

   return managedObjectContext;
}

- (void)saveAction:(id)sender {

   NSError *error;
   if (![[self managedObjectContext] save:error]) {
// Handle error
NSLog(@Unresolved error %@, %@, error, [error 

Re: Making an NSOutlineView by Default have 1 Parent and 1 Child.

2009-08-10 Thread Volker in Lists

Hi,

on startup check if you have already data in your data container. If  
no - create data accordingly to your needs so it is displayed in the  
outlineview.


You might consider phrasing your question differently, and describe  
what you have tried already. It would make helping you more easy.


Cheers,
Volker


Am 10.08.2009 um 12:45 schrieb Joshua Garnham:

What I am trying to do is that when my App is first opened the  
NSOutlineView will already have A Parent and A Child, the child  
being inside the parent, like in this picture, http://www.grabup.com/uploads/7490ffebda697ef976c3d6a3b57323ba.png 
.


What code would I need to do this?

Thanks,
Josh.




___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: what am I missing with NSString ?

2009-05-26 Thread Volker in Lists

Hi,

from the code listed I cannot tell if you alloc'ed memory for your  
NSString at all?


What is the goal you try to achieve? If you just want to store a  
single file path... with a global NSString do as along the lines of:


[rawFileName release];
rawFileName = [[NSString alloc] initWithString:[[files  
objectAtIndex:i] stringByStandardizingPath]]];


Of course that will give you the last of the selected files stored in  
the rawFileName string object. Alternatively you can use a mutable  
string and replace the contents with the selected filename.


Maybe that helps to point you in the right directions ...

Volker


Am 26.05.2009 um 15:33 schrieb vinai:



Hi Folks,

I think I am missing something really basic here with NSString.  I  
am trying to store the path of a user-selected file (from an  
NSOpenPanel) internally so other routines can act on the data within  
the file.  Here's the relevant section of code:


   if ([oPanel runModalForDirectory:nil file:nil types:nil] ==  
NSOKButton)

   {
   NSArray * files = [oPanel filenames];

   /* Process files */

   for( i = 0; i  [files count]; i++ )
   {
   [rawFileName initWithString: [[files objectAtIndex:i]  
stringByStandardizingPath]];

   NSLog(@Logging the file name variable);
   NSLog(rawFileName);

   NSLog(@Logging the called file path object directly);
   NSLog([[files objectAtIndex:i] stringByStandardizingPath]);
   }
   }

and this is the output from that section of code:

2009-05-26 09:18:41.931 REMI[19710:807] Logging the file name variable
2009-05-26 09:18:41.932 REMI[19710:807] Logging the called file path  
object directly
2009-05-26 09:18:41.932 REMI[19710:807] /Users/vinai/Desktop/ 
rawTestData/P04608.7


rawFileName is declared to be an NSString * in my object's header  
file. So why does printing out the string returned by the  
stringByStandardizingPath function work okay, but not when  
initializing an NSString * variable with it ?  What would I need to  
rawFileName so it can be used by other methods in my object ?


Thanks much all.

vinai




___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: NULL Outlets in one file work in another

2009-05-26 Thread Volker in Lists

Hi,

are you using - (void)applicationDidFinishLaunch:(NSNotification  
*)aNotification or - (void)applicationDidFinishLaunching: 
(NSNotification *)aNotification ? The first is not a valid delegate  
method, the second is. Have you connected your AppDelegate as delegate  
of your app - can it receive the notification at all?


And can you clarify on the difference of an App_Delegate file vs.  
App_Delegate.m ?


Cheers,
Volker


Am 26.05.2009 um 16:17 schrieb Walker Argendeli:

I have a App_Delegate file.  In applicationDidFinishLaunch:, I  
instantiate a FirstLaunch object and call its start method.  The  
weird thing is that this method, which access several IBOutlets,  
seems to be working with null outlets.  All the connections are  
right in IB, and yet the outlets are null.  I put the method inside  
App_Delegate.m and set the same connections, and the outlets work  
fine.  I've been staring at the files for an hour, trying to figure  
out where I went wrong.  The connections are the same, the headers  
have the same ivars, and yet in one file, the outlets work fin, and  
in another they're null.


Thanks,
- Walker Argendeli

___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: performSelectorOnMainThread primitives for withObject

2009-04-22 Thread Volker in Lists

Hi Torsten,

do you have more details on what the main thread implements and what  
you expect it to do, but doesn't do? I am using similar constructs and  
they work .


Volker

Am 22.04.2009 um 18:13 schrieb Torsten Curdt:


Hey folks,

Is this supposed to work or not?

 - (void) setActivated:(BOOL)theStatus;

 [view performSelectorOnMainThread:@selector(setActivated:)
withObject:[NSNumber numberWithBool:YES] waitUntilDone:YES];

It does not seem like it works that way.

Do I really have to use NSInvocation for this?

cheers
--
Torsten
___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: Table with all Key-Value Pairs

2009-04-15 Thread Volker in Lists

Hi Gerriet,

I recently played around with NSDictionaryController and it was  
simpler than I thought. You should be able to use the selection of  
your array controller as source for your Dictionary controller, and  
then bind the columns of a table view to key and value of your  
dictionary controller. Both are available automagically. I connected  
the visibility of columns of a table view that way. My NSDictionary  
held key/value pairs created from the column name and the hidden state  
(bool). I have just yesterday thrown out the code, but it should be  
coded/connected easily in 5 or 10 minutes.


You may want to download an example from Apple ;-) : 
http://developer.apple.com/samplecode/DictionaryController/index.html

Cheers
Volker

Am 15.04.2009 um 09:51 schrieb Gerriet M. Denkmann:



What about NSDictionaryController? I read the documentation and have  
no idea, whether this would be of any help.
Looked into /Developer/Examples and did not find anything with  
NSDictionaryController.
Looked at the Related sample code section of  
NSDictionaryController, but there was none.


___

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: Autosaving the selection in an NSTableView

2009-04-13 Thread Volker in Lists

Hi Martin,

I archive the selectionIndexes of the array controller and store them  
within thecore data document's metadata. I think you need to serialize  
(archive) the selectionIndexes to be able to save it either in  
NSUserDefaults or anywhere else.


When loading a CD document I check if the meta data have the  
appropriate entry, and if  so, call the array controllers  
setSelectionIndexes method with a delay of 0.0 (to get it executed in  
the next run loop). Works like charm.


Volker


Am 13.04.2009 um 05:32 schrieb Martin Stanley:

I have a core-data document-based application that uses a  
NSTableView with an NSArrayController as its data source. I have  
managed to figure out the magic IB incantations required to save the  
column sort, order and hidden data to the shared NSDeafulsController.


What I would like to do is to also save the current selection of the  
table across application invocations. I have tried the obvious:
	- bind the array controller's selected indexes to the Shared  
Defaults controller - no luck
	- bind the tableview's selected indexes to the Shared Defaults  
controller - no luck
I even tried to get the select programmatically, but when I tried  
the callback methods I thought appropriate:

- windowControllerDidLoadNib
- applicationDidFinishLaunching
I found that the array controller was not yet loaded with data and  
therefore had no selection.



___

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


CABasicAnimation causes crash on close/order out of window

2009-03-31 Thread Volker in Lists

Hi list,

a similar problem was already reported with no answers in january (?)  
2009 - layers with CIFilter animations running may crash the app on a  
window close call. If the animation is not running, no crash happens.


I have a Layer-Backed NSScrollView displaying a couple of layers with  
datapoints. A selection CALayer created along the lines of the  
CoreAnimation menu example from Apple's documentation is used to mark  
the currently selected data layer. The selectionLayer has a never- 
ending CIFilter animation set (pulsatingAnimation = CIBloom Filter).


The selectionLayer is added with Filter and Animation in the  
showWindow method of the controlling NSWindowController. The window  
controller is responsible for managing all my layers. When I don't add  
the animation to the selectionLayer I don't get a single crash. If I  
remove the animation before the window closes, the crash is still  
happening.


In more detail the setup and parts of the code:

In IB I have set up a NSScrollView with WantsAnimationLayer clicked. I  
have a NSView as document view added via IB to it. I create a  
rootLayer (NSTiledLayer) where I add all my data layers to. These are  
of full height and approx. 30 to 60 pixels wide. The whole view can  
stretch further then 6000 pixels in width. For easier visualization a  
tree:


NSScrollView (LayerBacked)
   NSView (IB created)
  rootLayer (NSTiledLayer) (from here on all created in code)
 selectionLayer (with CIFilter and Animation)
 dataLayer (NSTiledLAyer)
 dataSub1
 dataSub2
 



When closing the window I regularly encounter a crash on thread 3 or  
thread 4 usually caused by a call to CAViewUpdate. It raises an  
EXC_BAD_ACCESS; rarely it is a malloc error... but as I repeat later,  
I have tried to retain most/all objects to test for a retain problem.  
The app is btw not gc'ed.


example backtrace (thread3)
#0  0x26c2de9e in gldGetTextureLevel
#1  0x26c2fffd in gldGetTextureLevel
#2  0x26c30519 in gldGetTextureLevel
#3  0x26c27e20 in gldGetTextureLevel
#4  0x26b7c584 in gldGetTextureLevel
#5  0x26b7c73e in gldGetTextureLevel
#6  0x26c27b51 in gldGetTextureLevel
#7  0x26c27d50 in gldGetTextureLevel
#8  0x26be0ed1 in gldGetTextureLevel
#9  0x26977ded in gleRenderSmoothQuadsFunc
#10 0x26a05d83 in gleDrawArraysOrElements_ExecCore
#11 0x26a06cc8 in gleDrawArraysOrElements_IMM_Exec

Code snippet for selection layer creation - more or less along Apples  
example code:


if (!selectionLayer || selectionLayer == nil) {
selectionLayer=[[CALayer layer] retain];
selectionLayer.bounds=CGRectMake(0.0,0.0,0.0,0.0);
selectionLayer.borderWidth=2.0;
		selectionLayer.borderColor=CGColorCreateGenericRGB(1.0f,.5f,0.5f, 
1.0f);

selectionLayer.cornerRadius=2.0;
selectionLayer.zPosition = -1;

CIFilter *filter = [CIFilter filterWithName:@CIBloom];
[filter setDefaults];
		[filter setValue:[NSNumber numberWithFloat:7.0]  
forKey:@inputRadius];
		[filter setValue:[NSNumber numberWithFloat:0.0]  
forKey:@inputIntensity];

[filter setName:@pulseFilter];
[selectionLayer setFilters:[NSArray arrayWithObject:filter]];

		[selectionLayer addAnimation:[self pulseAnimation]  
forKey:@pulseAnimation];


[[layerContainer layer] addSublayer:selectionLayer];
}

- (CABasicAnimation*)pulseAnimation
{
CABasicAnimation* pulseAnimation = [CABasicAnimation animation];
pulseAnimation.keyPath = @filters.pulseFilter.inputIntensity;
pulseAnimation.fromValue = [NSNumber numberWithFloat: 0.0];
pulseAnimation.toValue = [NSNumber numberWithFloat: 1.0];
pulseAnimation.duration = 1.0;
pulseAnimation.repeatCount = 1000.0f;
pulseAnimation.autoreverses = YES;
	pulseAnimation.timingFunction = [CAMediaTimingFunction  
functionWithName:
  
kCAMediaTimingFunctionEaseInEaseOut];

return pulseAnimation;
}



Any ideas? What am I missing? I already ruled out any problems do to  
retain of objects by overretaining the layers, filters and animation I  
created in code. Even so, when added via the above calls, all these  
objects should be retained by their hosting layer - be it layer itself  
or animations... am I mislead by toggling animation on/off and  
changing crashing to not-crashing by doing so? The window is not set  
to ReleaseWhenClosed, so it stays available as well. It all smells  
nevertheless like a retain problem :-(


Volker


___

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:

Re: EXC_BAD_ACCESS on NSImageView::setImage

2009-03-14 Thread Volker in Lists

Hi,

retainCount is not in anyway useful when debugging - I had many cases  
of rc  5 with the object being gone the next instance. your error  
sounds like you loose the image at some point in time. retain it and  
use Instruments to see if you leak or over alloc.


Volker

Am 14.03.2009 um 01:23 schrieb Dev:

On Wed, Mar 11, 2009 at 9:33 AM, Scott Ribe scott_r...@killerbytes.com 
 wrote:

Does your setImage method retain the image?


The object ExternalView is a NSImageView so the setImage is the one of
NSImageView.
The doc says nothing about it, but i added some debug log like this :

  NSLog(@BEFORE : %d, [NewDisplayImage  
retainCount]);

  [CameraView setImage:NewDisplayImage];
  NSLog(@AFTER : %d, [NewDisplayImage  
retainCount]);


2009-03-13 17:17:35.105 xxx[2281:e503] BEFORE : 1
2009-03-13 17:17:35.106 xxx[2281:e503] AFTER : 3

So i guess the image have been retained 2 times 
--
I.
___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: Problem in save and open on Core Data Document Based application

2009-03-10 Thread Volker in Lists

Hi,

the message says that the data model in the file you try to open is  
different than the one you have in your app. As far as I can follow  
you, both apps use the same file type and the former is always trying  
to open the others file. Of ocurse, then it complains about the  
different model. Have you tried opening Departments file via  
Departments - File - Open ? That should work. If not, you have made  
changes to your model after saving the document.


On a side note: CoreData should not be learned by the beginner. First,  
try to understand the basics, than move slowly, very slowly up to  
CoreData, otherwise you'll be lost soon. If you're not content with  
the content you find via Apple's developer resources on Core Data,  
there is a very good book written by Markus Zarra - available as  
preliminary version from Pragmatic Programmers.


Cheers,
Volker


Am 10.03.2009 um 11:39 schrieb haresh vavdiya:


Hello,

 I am learning mac development from Aaron Hillegas 3rd  
Edition.
i have created two Example CarLot and Departments  based on Core  
-Data

document based application.

 When i created CarLot example that time it can save and  
open
data without writing single line. Then i created Departments example  
so it

should also save and open.

 But second example save successfully but when open, it  
gives
error. But in dock panel, CarLot apps is launched. i can open this  
apps from

dock. But i wanted to save and open Departments example.

   I can't understand that i saved apps from Deparetment and  
it

launch CarLot example in dock. Is there in problemwhat is the
problem..i m trying from long time.

And the message is The document “DeptTest” could not be
opened. The model configuration used to open the store is  
incompatible with

the one that was used to create the store.

  Please anyone help to figure out this problem.

Thanks,
Haresh.
___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: [Q] Re: NSPersistentStore -addPersistentStoreWithType

2009-02-23 Thread Volker in Lists

Hi,

i am usually happy with the quick check if a file exists and don't  
rely on any entity counts within the first view milliseconds of  
startup. If you have a fixed location (say URL), the check is really  
easy to implement. If you use a document based app, you have more  
elegant possibilities, since document creation and document opening  
differ in their calls.


Cheers,
Volker

Am 23.02.2009 um 15:01 schrieb Jon C. Munson II:


Namaste!

I'm working on populating some entities with records just after when  
the

physical file of the store is created  (this would typically happen on
install and generally only once).  These records are generally for
application use and won't be managed by the end user.

In my app delegate's class implementation file there's a
-persistentStoreCoordinator method that returns the
persistentStoreCoordinator.  As part of functionality therein, it  
calls the
-addPersistentStoreWithType method which either returns an instance  
of an

existing store or creates a new store and then returns that instance.
Unfortunately, I don't see a way to know if that file was actually  
created
during that method call (without checking for a file before the call  
to

-addPersistentStoreWithType).

Is there a more elegant way to check whether the store had to create  
the
file, etc. (and what is it), or do I need to actually look for it,  
etc.,

first?

If the latter, would checking for the file on disk be better than  
obtaining

a record count from an entity?

Many thanks in advance!!! :D

Peace, Love, and Light,

/s/ Jon C. Munson II


___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: Creating Subclass in Core Data

2009-02-22 Thread Volker in Lists

Hi Paul,

I recommend not use the add: / addChild: methods of the  
TreeController, but create yur own methods for that. In each  
instantiate an object of the entitytype you want as parent/child. See http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CoreData/Articles/cdCreateMOs.html#/ 
/apple_ref/doc/uid/TP40001654 for how to create objects in code. Set  
the proper parent objects , that is nil for parents and the parent  
entity for the children.


I have the same solution in a couple of apps with exactly the same  
structure and needs as I gather you have.


Cheers,
Volker

Am 22.02.2009 um 20:19 schrieb Paul Franz:

I have a simple class hierarchy defined in Model for the Core Data  
Entity:


Class: AbstractClass (Abstract Class is checked as abstract
Parent Class: None
Attributes:
  Name
  Children

Class: Class1
Parent Class: AbstractClass
Attributes: None

Class: Class2
Parent Class: AbstractClass
Attributes:
  Description
  Cost

How do I create a subclass of Class1 or Class2 instead of the  
abstract class AbstractClass?


I have created a NSTreeController in IB. The Attributes tab for the  
NSTreeController, the Key Paths (Children) is set to Children and  
Object Controller (Mode) is set to Entity with the Entity Name is  
set to AbtractClass. I have a NSOutlineView which is bound to this  
NSTreeController. And a New button to create a new entity is bound  
to the add method of the NSTreeController and a New Child button  
to create a new child is bound to the addChild method of the  
NSTreeController. It seems to work. But I have no idea what types of  
entities are being created. My assumption is that they are of type  
AbstractClass.


Paul Franz
___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: what to do with MAC address...

2009-02-19 Thread Volker in Lists

Hi there,

as a quick pointer - from one of my apps licensing code. Assuming that  
MACAddress is the beasty UInt8 struct, the following should work:



	NSString *addressString = [[NSString alloc] initWithFormat:@%02x: 
%02x:%02x:%02x:%02x:%02x,MACAddress[0], MACAddress[1], MACAddress[2],  
MACAddress[3], MACAddress[4], MACAddress[5]];



Cheers,
Volker

Am 19.02.2009 um 19:26 schrieb Jon C. Munson II:


Namaste!

Per Apple's GetPrimaryMACAddress sample (found in Technical Note  
TN1103), I

can obtain a MAC address for a given Mac.

However, when I try to output that address to the screen, I get  
nothing.


So, my issue is, what do I do with the return value found inside  
that sample

so that it is output in the standard format of a MAC address?

The return value from IO Kit is a UInt8 struct which is filled with  
the

bytes of the MAC address.

I need to convert that to an NSString.  Which I did using
stringWithUTF8Format - the raw conversion works fine.  However, due  
to the

actual characters in the string, the return string isn't valid.

I'm guessing I need to do some further conversion prior to passing  
back the
actual string, but not sure what, nor how.  It looks preliminarily  
to me
that I need to change the UInt8 byte array to an array that contains  
the hex
values of said bytes - is that correct?  If so, how do I do that (as  
simple
as obtaining the character codes?)?  I know that may be a noob  
question, but

I'm not usually delving into the lower levels of such stuff so I don't
remember - sorry!

Thanks!!!

Peace, Love, and Light,

/s/ Jon C. Munson II



___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: Matching String With ObjectForKey?

2009-02-12 Thread Volker in Lists

Hi,

you compare objects with == but what you really want is  
isEqualToString: since you want to compare the string contents.


Cheers,
Volker
___

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: Getting pixel color from NSView

2009-01-25 Thread Volker in Lists

Hi,

one possibility, even so I doubt it is the most elegant, is to create  
a BitmapRepresentation of the view and get the color from this image.  
More elegant would be, if you would be able to use the information  
from the tiling method, for example by storing the random colors in  
an array of kind.


Maybe some details on how you create the tiles would be helpful?

Cheers, Volker

Am 25.01.2009 um 20:06 schrieb Ashley Perrien:

Is there a way to get the color of a pixel or area of an NSView  
during the drawRect method? I'll be tiling the view with a grid of  
random colors but each tile is based on the colors around it. I'd  
prefer to call something along the lines of:


NSColor *aColor = [myView colorAtPoint: somePoint];

Rather than creating and filling a potentially quite large array of  
colors.


-Ashley

___

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: Displaying multiple core data relationships in NSOutlineView

2009-01-16 Thread Volker in Lists

Hi,

why don't you have an abstract class that holds the children/parent  
relationships and make different subclasses for different data types  
that all inherit from your abstract class. As far as I understand your  
problem, that should solve it. I have a similar solution working well  
for me.


Cheers, Volker

Am 16.01.2009 um 15:38 schrieb Rick Hoge:



I'm still trying to get my head around how to achieve a particular  
outline view display by binding an NSTreeController to Core Data  
entities.


I have some test apps running in which, by binding my tree  
controller to a root entity, I can get a nice outline view showing  
a hierarchy of child entities as long as these descend from the root  
via a series of to-many relationship with a fixed relationship name  
(i.e. children).  Add, remove, and addChild all work as expected.


Now comes the messy part.  Is there any way to add a hierarchical  
view of a second hierarchy of to-many relationships descending from  
the *same* root object in the *same* outline view?  (i.e.  
children2 )  It would be easy in a second outline view, but I'd  
like to have both hierarchies shown in a single outline view - one  
above the other.


The design I'm trying to achieve is analogous to the way Xcode  
displays a Targets group and a Bookmarks group in the same  
outline view.  If Core Data was used for this (and I don't know if  
it was), it seems clear that Targets and Bookmarks would be modeled  
as separate to-many relationships and entities, and yet they are  
nicely displayed in the same outline view.


I'm guessing that this might be achievable by using the same name  
children for the to-many relationships in both hierarchies, and  
adding a custom children accessor method to the root object that  
returns the appropriate set of entities to show in the outline  
view.  It's not clear to me how this would be set up though.


I tried something like the code shown below in a custom Project  
class, for the project entity:


-(NSMutableSet*)children {

 return [NSMutableSet setWithObjects:
 [self mutableSetValueForKey:@targets],
 [self mutableSetValueForKey:@bookmarks],
 nil];

}

but I get the error message

2009-01-16 09:35:02.047 004 ProjectProto[83363:10b]  
[_NSNotifyingWrapperMutableSet 0x1057dd0  
addObserver:forKeyPath:options:context:] is not supported. Key path:  
children


I have the feeling I'm missing something at a really basic level -  
if anyone can suggest how to achieve the above design I'd be very  
grateful.


Cheers,

Rick

___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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

2009-01-15 Thread Volker in Lists

Hi,

works for me on 10.5.5 just as well as via code and calling the  
appropriate methods. At least that was my experience from before  
christmas. Want me to retry on 10.5.6?


Volker


Am 15.01.2009 um 14:14 schrieb Chris Idou:



Is it just me or does the enabled checkbox in IB for  
NSPredicateEditor, as well as the enabled bindings do nothing?




___

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: Mail Activity sliding widget question

2009-01-08 Thread Volker in Lists

Hi,

you can animate a NSSplitView easily to achieve this effect. I use the  
following code to animate the resize of a split view after the users  
clicks a button:


- (IBAction)toggleSplitDisplay:(id)sender
{
NSSize newSize = [detailSplit frame].size;

[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:.5];

if ([sender selectedSegment] == 1) {
[[theLowerSubView animator] setFrameSize:newSize];
newSize.height = 2;
[[theUpperSubView animator] setFrameSize:newSize];
}
else if ([sender selectedSegment] == 0) {
[[theUpperSubView animator] setFrameSize:newSize];
newSize.height = 0;
[[theLowerSubView animator] setFrameSize:newSize];
}

[NSAnimationContext endGrouping];
}

Hope that helps, please contact me, if you need more information!

Volker

Am 08.01.2009 um 17:53 schrieb Sam Krishna:

I've been looking for a while now how to replicate a widget like  
Mail.app's Mail Activity slide-up/slide-down panel (the animation,  
not the widget itself).


The several times I've tried NSViewAnimation, it seemed to be a non- 
starter.


The bits and pieces that I've worked with CoreAnimation seem  
promising, but it *feels* like there's something obvious that I'm  
missing in terms of replicating the slide-up panel. You can see that  
sliding panel widget in many Apple apps, like Mail, iTunes (album  
cover), iPhoto's info panel, and Automator's workflow log, workflow  
variables table, and Automator's Description View.


Again, I'm just trying to replicate the animation--if anyone has any  
ideas, that would be really great.



___

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: Display Mail type outlineView numbers

2009-01-06 Thread Volker in Lists

Hi there,

see this as an example: 
http://www.bdunagan.com/2008/11/10/cocoa-tutorial-source-list-badges-part-2/

Cheers,
Volker

Am 01.01.2009 um 15:59 schrieb vince:


Thanks for the help.
I would like to display the small blue circle and associated numbers  
that

refer to the amount of entries in an outlineView group. Documentation?

Thanks. I'm not sure what to search for ...

___

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: NSTimer help

2008-12-17 Thread Volker in Lists

Hi Eric,


- (BOOL)windowShouldClose:(id)window

is the correct implementation with the method name implicating a  
question that is answered either YES or NO. Your method in its current  
form is not called, which you could have easily worked out using a  
single NSLog(@I do work sometimes); within the method.


Cheers,
Volker


Am 17.12.2008 um 22:05 schrieb Eric Lee:




Begin forwarded message:


From: Eric Lee ericlee1...@gmail.com
Date: December 17, 2008 3:02:40 PM CST
To: Ken Thomases k...@codeweavers.com
Subject: Re: NSTimer help

Thanks...i hadn't realized there was a  - 
(void)windowShouldClose..but now I have another problem.


I have implemented an if/else statement so that I can determine if  
something is happening


However, even though the if statement is true, the window never  
closes:


Here's the code...thanks

- (void)windowShouldClose:(id)window
{
	if ([[textField stringValue] isEqualTo: @0:00:00 ||  
@0.0 ]) {

[mainWindow windowShouldClose:YES];

}

else {

NSAlert *alert;
		alert = [NSAlert alertWithMessageText:@Error! defaultButton:nil  
alternateButton:nil otherButton:nil  
informativeTextWithFormat:@Please stop the timer.];


[alert runModal];

[mainWindow windowShouldClose:NO];
}
}


___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: splash screen how to?

2008-12-17 Thread Volker in Lists

Hi Nick,

search for BorderlessWindow in general or narrow down your search to  
CoriolisWindow or even better FancyAbout supplied by Apple. Sorry for  
not including the links directly, but I have both examples on my disk  
and was far too lazy to type them into Google. Which is another good  
thing, Google I mean ;-)


Cheers,
Volker

Am 17.12.2008 um 15:50 schrieb Nick Rogers:


Hi,
I have to show a splash screen at the software launch.
The window should have no edges etc and should stay for a few seconds.
How to go about it?
Is there any good resource available for this?

Thanks,
Nick
___

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/volker_lists%40ecoobs.de

This email sent to volker_li...@ecoobs.de


___

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: Blunt edges to Window

2008-12-11 Thread Volker in Lists

Hi,

do you have an example? A good source for information might be Apple  
Guide to the UI or HIG - available through your Xcode installations  
documentation.


Cheers,
Volker

Am 11.12.2008 um 18:41 schrieb Arun:


Hi,

How to create a blunt corned window edges? Is there any control  
which will

provide the same?
any idea?

-Arun KA
___

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/volker_lists%40ecoobs.de

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Problems with multiple selection and NSArrayController

2008-12-10 Thread Volker in Lists

Hi,

does the detail arraycontroller show all categories and selects the  
ones contained in the set of your selected master rows? Can't you just  
display only the detail categories that are within the set of the  
selected master? This would be easy to do even with multiple master  
objects selected via the Content Array For Multiple Selection  
binding of the categories controller. And it would reflect the  
expected Cocoa behaviour.


Volker

Am 10.12.2008 um 11:20 schrieb David Niemeijer:


Hi,

I have a master table that displays that gets it's contents  
NSArrayController with items. Each of those items has a categories  
key which contain an NSMutableIndexSet. When the user selects a row  
in the master table my app displays in a detailed view a detail  
table with categories. The contents of that detail table comes from  
a categories NSArrayController and the selection is determined by  
the index set of the categories key of the selected item of the  
master table. If the user changes the selection in that detail table  
the indexes nicely update for the selected item of the master table.  
Up to this point everything works fine so far.


Now I add multiple selection to the master table. When two selected  
items in the master table have index sets that contain the same  
indexes everything is still ok, but when the each have different  
indexes a problem will occur. No categories will get selected in the  
detail table and when I click elsewhere in the master table the  
category indexes of the two originally selected items will become  
empty sets.


So, what would I need to do to prevent problems with multiple  
selection in the master table?


Thanks,

david.
___

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/volker_lists%40ecoobs.de

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Distributing apps

2008-12-10 Thread Volker in Lists

Hi,

when you build your app in Xcode with the Release target setting, you  
will get your app with the standard app icon in the build folder. This  
folder usually resides within your project directory. Via the targets  
Get Info panel you can set app icon - which you have to supply  
yourself, to get a custom icon. This app you can send to others.


Cheers,
Volker

Am 10.12.2008 um 19:15 schrieb Richard S. French:

I have found a lot of Cocoa books and tutorials about writing  
applications.
I haven’t found any instructions as to how to put that application  
into an
icon that can be run when clicked on your desktop or downloaded by  
others.

Please let me know if I’ve missed it.
Thanks, Richard.
___

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/volker_lists%40ecoobs.de

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Another NSOutlineView question

2008-12-09 Thread Volker in Lists

Hi,

you should be able to detect a double click and call a method then  
that either temporarily allows the selection or directly starts the  
edit mode. I do have a similar setup - don't do editing, but I use the  
double click action via bindings to attach notes to such an  
unselectable item.


Hth,
volker

Am 09.12.2008 um 06:55 schrieb Graham Cox:

In my NSOutlineView, I disallow selection of group items by  
implementing the delegate method -outlineView:shouldSelectItem:,  
which works fine, but I still want to be able to edit the titles of  
group items. The above method prevents this also.


How can I prevent selection of the the item but still allow editing  
of its title string?



tia,

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/volker_lists%40ecoobs.de

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: NSArrayController, NSPopupMenu, defaults and arrangedObjects

2008-12-09 Thread Volker in Lists

Hi Steven,

as far as I know, the fect happens in the next run loop. So you would  
need to set the selection then. This is possible for example via the  
performSelector:withObject:afterDelay: and a delay of 0.0 on self (?).



Cheers,
Volker









Ah, I understand. I've implemented the correct property now but I  
still have the problem of arrangedObjects returning an empty array  
when called in windowDidLoad. So I can't set my property as I have  
nothing to set it with. Any ideas why arrangedObjects would return  
zero? It's like the window and controls and initialised before Core  
Data can return the fetch.

___



___

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 [EMAIL PROTECTED]


Re: NSCollectionView woes

2008-11-21 Thread Volker in Lists

Hi Cem,

the CollectionView needs only to be pointed to the cars  
ArrayController and uses a rather obfuscated way of binding each of  
its subviews fields to the appropriate car entries. you will have to  
bind your prototype view controls to  
CollectionView.representedObjects.key. The CollectionView is aware  
of the arrangedObjects - if bound to them - and automagically creates  
as many views as needed from your view prototype. I recommend to take  
a look at the available examples provided by Apple or read through  
Cocoadevs page on NSCollectionView.


HTH,
Volker


Am 21.11.2008 um 19:47 schrieb Cem:

I'm slowly working my way through Aaron Hillegass' Cocoa Programming  
for Mac OS X and just completed the CarLot program (Chapter 11 in  
the 3rd edition).  I decided to challenge myself and try to change  
the interface to use NSCollectionView instead of the interface in  
the book.  In order to do this, I bound the NSCollectionView itself  
to my NSArrayController (which is called Cars) with a keypath of  
arrangedObjects.condition.  I then created a new NSObjectController  
(called 'A car'), set it to entity mode, and set the entity name to  
Car (the same as what Cars has).  I bound its Content Object to  
Cars.selection.  I then bound the GUI elements to the appropriate  
keys in Car (such as car.selection.makeModel).


This, of course, didn't work.  Since Car is bound to the  
Cars.selection, whenever the selection changes, ALL views in my  
NSCollectionView change at the same time.  I then tried a number of  
variants, none of which worked.  What I want is for each subview in  
my NSCollectionView to see the data relating to a different car, not  
all reflect the same car.  What am I doing wrong?


BTW, if anyone wants the current project/code, the whole thing is  
about 32 KB tarballed, so I can email it anywhere anyone wants it.


Thanks,
Cem Karan
___

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/volker_lists%40ecoobs.de

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: NSArrayController, bindings and NSUserDefaults

2008-11-09 Thread Volker in Lists

Hi,

you need an formatter - NSUnarchiveFromData and then it works rather  
well. I store supplementary information that each user can edit in  
NSUserDefaults. The info is maintained in NSTableViews and stored as  
an Array of NSMutableDictionary. Works really well.


Volker

Am 09.11.2008 um 20:41 schrieb Andre Masse:

I think you need to archive and unarchive when you read and write  
each key in your dictionary.


The array controller model key path is an array of objects, so it  
don't need any value transformer, right?. Now, somehow somewhere it  
will need to unarchive a particular object to get at a member's  
value. This is where it bites, how can I set the key path for, let's  
say the userName, when this value is encoded somewhere inside the  
fully encoded NSData object?


___

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 [EMAIL PROTECTED]


Re: Key Paths @count and mutablestrings

2008-11-04 Thread Volker in Lists

Hi,



Is there an easy way to access the existing Array Controller from  
the code? I have a suitable Array Controller called Purchase Order  
Items Array Controller in IB, but I don't see a way to reference  
this in the code. The Array Controller is bound to the selection of  
another Array Controller.


As before and always, using IBOutlets ? You can connect an IBOutlet  
from any of your delegate/controller NSObject subclasses (the ones in  
defined in Xcode and filled with real code). If you have a  
NSAppDelegate class already at hand, create an IBOutlet  
NSArrayController *theWantedArrayController in the header file and  
connect that in IB to the appropriate object in IB.


Volker
___

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 [EMAIL PROTECTED]


Re: View swapping questions

2008-11-04 Thread Volker in Lists

Hi Robert,

sounds reasonable, but no need to store any control states as far as I  
can tell (they are not released, just taken out of view). There is  
an example available demonstrating this w/ some nice CoreAnimation  
transition  BasicCocoaAnimations found on the online developer  
example area.


Volker

Am 04.11.2008 um 19:00 schrieb Robert Mullen:

I am attempting to swap views somewhat like XCode does between  
project and debug modes. This is being done to an existing project  
that has the main windows content view set in IB. I have tried to  
store the initial view before replacing it with the new view using  
code similar to this:


oldView = [window contentView];
[window setContentView:newView];

and then swapping them back out on a segmented cell action

[window setContentView:oldView];

This is pseudo code with the actual views being linked up via IB so  
it may not be perfect but I am trying to understand conceptually if  
this should work. I do need to preserve the state of the controls in  
both views so that toggling back and forth brings you to the same  
exact view as before.


Am I barking up the wrong tree?

TIA
___

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/volker_lists%40ecoobs.de

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]