Re: Removing Object form ArrayController without managedObjectContext

2010-03-30 Thread Gustavo Pizano
IT WORKS AHHH SUCH A RELIEF!

Thans a lot, guys, you made me see the problem I was having,  so I set up the 
Set Content binding of the ItemXInvoice Array controller to be 
_newInvoice.toItemsXInvoice  properly set the relation in the add and 
addPredifiened methods, and it did work!. 
OMG 5 days trying to solve this and finally its done.. thanks a lot once again


Gustavo.

PS, I have remove the things that seem and were really wrong, as Ben told me.

 
On Mar 30, 2010, at 8:50 AM, Gustavo Pizano wrote:

> Keary Hello
> On Mar 30, 2010, at 2:18 AM, Keary Suska wrote:
>> 
>>> Item  * newItem = [NSEntityDescription 
>>> insertNewObjectForEntityForName:@"Item" inManagedObjectContext:[self 
>>> managedObjectContext]];
>>> ItemXInvoice * newItemXInvoice = [NSEntityDescription 
>>> insertNewObjectForEntityForName:@"ItemXInvoice" inManagedObjectContext: 
>>> [self managedObjectContext]];
>>> [newItemXInvoice setValue:newItem forKey:@"toItem"];
>>> [newItem addToInvoiceXItemsObject:newItemXInvoice];  //4
>>> [_itemsArrayController addObject:newItemXInvoice];
>>> if(_newInvoice == nil){
>>> _newInvoice = [NSEntityDescription 
>>> insertNewObjectForEntityForName:@"Invoice" inManagedObjectContext:[self 
>>> managedObjectContext]];
>>> }   
>>> [_newInvoice addToItemsXInvoiceObject:newItemXInvoice];
>>> 
>>> So Im creating a ItemXInvoice relate it to an Item and then relate it to 
>>> the Invoice relationship as you say. Unless I misunderstood your point and 
>>> the NSArrayController (ItemXInvoice)  the Array Content binding shall be 
>>> set to the instance with keypath: _newInvoice.toItemXInvoice... I dunno its 
>>> late here in this part of the work, Im just rumble around..
>>> 
>>> Any thoughts?
>> 
>> I would need to know what the -add* methods do to make any suggestions. 
>> Chances are, these methods are not updating the relationships properly.
> 
> 
> The above is he add IBAction that its called when I press a + button, First I 
> create a new Item, then a ItemXInvoice, I relate them, I have  line 4 as an 
> extra there but originally wasn't there,  then I add the object to the 
> _itemsArrayController, ( which has as entity ItemsXInvoice and  MOC the 
> application's delegate's MOC),  then if the invoice its null I create the 
> invoice and set the relation to ItemsXInvoice.
> 
> I thought this was the logical way to create-relate them.. did I miss 
> something?
> 
> 
> Gustavo
> 
> 
> 
> 
>> Keary Suska
>> Esoteritech, Inc.
>> "Demystifying technology for your home or business"
>> 
> 

___

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


using xcode ,how to compile .c file as .m file?

2010-03-30 Thread simon Scylla
i need to port some code to iphone and now i find that i can not call system
interface of objc. i can rename my files from 888.c  to ***.m and it works.
but i do not wanna rename my files.
what should i do?i think there must be some choice in xcode.but i don't
konw..[?]
<<33C.gif>>___

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: using xcode ,how to compile .c file as .m file?

2010-03-30 Thread Kiel Gillard
On 30/03/2010, at 8:32 PM, simon Scylla wrote:

> i need to port some code to iphone and now i find that i can not call system
> interface of objc. i can rename my files from 888.c  to ***.m and it works.
> but i do not wanna rename my files.
> what should i do?i think there must be some choice in xcode.but i don't
> konw..[?]

Wrap your C functions in Objective-C methods.

For example:

SomeController.m

#import "libwhatever.h"

@implementation SomeController

+ (void)initializeLibrary
{
InititaliseCLibrary();
}

- (BOOL)writeToURL:(NSURL *)url
{
char path[255];
//convert URL to C string using NSURL/CFURL API here

//call C library
int result = WriteFileToPath(...);

//return a value
return (result == 0 ? YES : NO);
}

and so on. This is the exact same way parts of Carbon and CoreFoundation is 
used in an Objective-C based application.

> ___
> 
> 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/kiel.gillard%40gmail.com
> 
> This email sent to kiel.gill...@gmail.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: using xcode ,how to compile .c file as .m file?

2010-03-30 Thread Graham Cox

On 30/03/2010, at 8:32 PM, simon Scylla wrote:

> i need to port some code to iphone and now i find that i can not call system
> interface of objc. i can rename my files from 888.c  to ***.m and it works.
> but i do not wanna rename my files.
> what should i do?i think there must be some choice in xcode.but i don't
> konw..[?]


You can go into the project build settings and under GCC 4.2 Language section, 
select 'Objective-C' under 'Compile Sources As' instead of 'According to File 
Type'.

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Application crashes with no calls tracing back to my code

2010-03-30 Thread Arun
I fixed the crash.
I had to use GuardMalloc.

Thanks all for the suggestions.

-Arun

On Sat, Mar 27, 2010 at 5:40 PM, Ken Thomases  wrote:

> On Mar 27, 2010, at 7:00 AM, Ken Thomases wrote:
>
> > On Mar 27, 2010, at 6:29 AM, Arun wrote:
> >
> >> My application is crashing sometimes with the following crash log. It
> has no
> >> traces of my code. Can anyone look into the crash log suggest some
> ideas?
> >
> > Probably a memory management bug.  You are over-releasing or
> under-retaining something.  An NSImage, from the looks of things.
> >
> >
> http://www.sealiesoftware.com/blog/archive/2008/09/22/objc_explain_So_you_crashed_in_objc_msgSend.html
>
> And beyond the advice at the link, I should have said to use the Zombie
> instrument or, the manual way, set NSZombieEnabled=YES and
> MallocStackLoggingNoCompact=YES, set a breakpoint in -[_NSZombie
> methodSignatureForSelector:], then when the debugger stops on that
> breakpoint, use "info malloc-history" command to figure out where the zombie
> was originally allocated.
>
>
> http://www.friday.com/bbum/2010/01/10/using-malloc-to-debug-memory-misuse-in-cocoa/
> http://developer.apple.com/mac/library/technotes/tn2004/tn2124.html
>
> Also, use Xcode's Build and Analyze feature to see if the static analyzer
> can identify your memory management bugs.
>
> Cheers,
> Ken
>
>
___

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


CALayer mask issue

2010-03-30 Thread Michael Vannorsdel
I have a CALayer that is larger than the window and I move that layer around to 
view various sections of it.  The layer is also masked by another CALayer.  The 
problem I have is if I move half of the layer out of view the mask stops 
working right.  As if the mask is transparent so none of the view layer 
contents is shown.  I've verified the contents of both layer and mask layer are 
valid and correct, but the masking just stops working.  After that point even 
applying a new mask for the layer still won't mask it.

Is there some gotchyas I should know about with masking 
layers?___

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


Mount SMB folders

2010-03-30 Thread stevejohny
Hi All

I am newbie to cocoa. I need to mount a volume from my custom browser. I have 
used FSMountServerVolumeSync to mount the volume and it works fine for success 
cases. But I need to show the error message if it fails. Looks like 
FSMountServerVolumeSync won't return proper error codes. ex: if I try to mount 
a afp volume (by giving valid input of a smb server), then authentication 
failed error code is returned instead of ioErr. 
 
Also some times the volume get mounted if no/invalid user name or password is 
provided. This is the case when Read/Write is given for shared 
folder(everyone). 
 
I have tried mount_smbfs terminal command that gives proper errors for invalid 
inputs. But this command won't return proper error codes instead it displays 
error messages. Please let me know if there is a way to get the error codes out 
of these error messages. As I need to show the localized error messages.
 
OS puts up proper error message, any idea how this is done. Is there any Cocoa 
APIs to mount a remote volume. or at least check if the remote volume is 
reachable.
 
Thanks in Advance
Steve

--
Ovi Store: Fresh apps and more
http://store.ovi.com/?cid=ovistore-fw-bac-na-acq-na-ovimail-g0-na-4

___

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


System preference File Sharing

2010-03-30 Thread stevejohny
 Hi All,

I have an application where in I need to list the local shared folders only if 
"File Sharing" is  enabled and smb check box is checked.Is there any way I can 
know if "File sharing" is checked and "Share files and folders using SMB" is 
also checked for the shared folder.

Currently I have used nc to check if 139/445 port is enabled or not. This works 
fine only if file sharing is checked. If "Printer Sharing" is also  checked 
then the port scan fails. As 139/445 ports are enabled for "Printer Sharing" 
(even if File sharing is turned Off). Is there any way to check if smb local 
file sharing is enabled or not. 

Thanks in advance
Steve.

--
Ovi Mail: Being used in over 200 countries
http://mail.ovi.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


Creating a Virtual (Webcam) Device

2010-03-30 Thread Sven Andersson
Hi!

I am looking for a solution to create a "virtual" webcam device under
OS X (that acts just as a normal hardware webcam, but the application
has full control over what to output). I'm fairly experienced with
C++, but not so much with Objective-C and OSX/Cocoa programming.

I have looked into "Image Capture Device Module Reference", but this
seems a bit outdated (or even deprecated?), and I'm not sure if it
really has any relevance to what I want to do. I also looked into I/O
Kit and kext, but I can't find information how to actually "add" a
virtual/fake device.

Anyone that can point me in the right direction, where to look and
what I should be looking for? I've searched via google, but most of
the results seems to focus on Windows and DirectX. (I've also posted a
question on stackoverflow,
http://stackoverflow.com/questions/2538573/creating-a-virtual-webcam-device-for-os-x
, sadly without any answers.)

Thankful for any help at all! :)
___

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: How to add a DOCTYPE declaration to an NSXMLDocument?

2010-03-30 Thread Matt Neuburg
On Sat, 27 Mar 2010 16:59:35 -0700, Bruce Sharpe 
said:
>I want to add a DOCTYPE declaration to my NSXMLDocument, but can't seem to
>find the right incantation.  The thing that comes closest to working is:
>
>NSString *myXMLString = [NSString stringWithFormat:@"encoding=\"UTF-8\"?>"];
>NSXMLDocument *myDoc = [[NSXMLDocument alloc] initWithXMLString:myXMLString
>options:0 error:&err];
>NSString *myDoctypeString = @"";
>NSXMLDTD *theDTD = [[NSXMLDTD alloc] initWithData:[myDoctypeString
>dataUsingEncoding:NSUTF8StringEncoding] options:nil error:&err];
>[myDoc setDTD:theDTD];
>
>The result should be:
>
>
>
>
>
>but what I get is:
>
>
>
>
>
>What am I doing wrong?

I can think of two things you might be doing wrong:

(1) You might be failing to consult the documentation for NSXMLNode.

(2) You might be failing to check the archives.

Doing either of these would have led you to the setName: method, which I
suspect is what you're after here.

m. 

-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

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: Mount SMB folders

2010-03-30 Thread Jens Alfke

On Mar 30, 2010, at 2:23 AM, stevejo...@ovi.com wrote:

> OS puts up proper error message, any idea how this is done. Is there any 
> Cocoa APIs to mount a remote volume. or at least check if the remote volume 
> is reachable.

You’re talking about filesystem mounting APIs, not Cocoa. The darwin-userlevel 
mailing list would be a better bet; I can’t remember if there’s a 
filesystem-specific mailing list (check at http://lists.apple.com.)

—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: System preference File Sharing

2010-03-30 Thread Jens Alfke

On Mar 30, 2010, at 2:39 AM, stevejo...@ovi.com wrote:

> I have an application where in I need to list the local shared folders only 
> if "File Sharing" is  enabled and smb check box ischecked.Is there any way I 
> can know if "File sharing" is checked and "Share files and folders using SMB" 
> is also checked for the shared folder.

Check whether the samba daemon is running, by iterating the process list? 
(Standard Unix APIs, not Cocoa.)

—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Creating a Virtual (Webcam) Device

2010-03-30 Thread Jens Alfke

On Mar 30, 2010, at 6:27 AM, Sven Andersson wrote:

> Anyone that can point me in the right direction, where to look and
> what I should be looking for?

I don’t know, but cocoa-dev isn’t the right list. Check the full list of 
mailing lists at http://lists.apple.com to see if there’s one for video.

—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Random "Controller cannot be nil" crash

2010-03-30 Thread Jean-Nicolas Jolivet
I'm having a very frustrating issue that I can't seem to be able to pinpoint...

When I run my app, I randomly get a crash on startup with the following 
message(s) in the console:

==
2010-03-30 13:57:52.599 MyApp[6292:a0f] An uncaught exception was raised
2010-03-30 13:57:52.599 MyApp[6292:a0f] Controller cannot be nil
2010-03-30 13:57:52.601 MyApp[6292:a0f] *** Terminating app due to uncaught 
exception 'NSInvalidArgumentException', reason: 'Controller cannot be nil'
*** Call stack at first throw:
(
0   CoreFoundation  0x989dc40a __raiseError + 410
1   libobjc.A.dylib 0x91bbe509 objc_exception_throw 
+ 56
2   CoreFoundation  0x989dc138 +[NSException 
raise:format:arguments:] + 136
3   CoreFoundation  0x989dc0aa +[NSException 
raise:format:] + 58
4   AppKit  0x977e771b -[NSBinder 
addBinding:toController:withKeyPath:valueTransformer:options:] + 252
5   AppKit  0x977e00f2 
-[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 703
6   AppKit  0x9788c067 
-[NSNibBindingConnector establishConnection] + 156
7   AppKit  0x977bb33b -[NSIBObjectData 
nibInstantiateWithOwner:topLevelObjects:] + 1249
8   AppKit  0x977b9450 loadNib + 257
9   AppKit  0x977b8848 
+[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 228
10  AppKit  0x977b8759 
+[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 158
11  AppKit  0x977b86a4 
+[NSBundle(NSNibLoading) loadNibNamed:owner:] + 383
12  AppKit  0x977b54a9 NSApplicationMain + 
434
13  MyApp   0x2694 main + 36
14  MyApp   0x2665 start + 53
)
sharedlibrary apply-load-rules all
kill
quit

==

Judging by the trace, I'm thinking it might have something to do with bindings? 
It appears to be really random... I'd say 1 times out of 3 my app starts 
normally, the other 2 attempts, I get this error...

Most of my controllers (that have bindings anyway) are singletons, but I tried 
changing that (i.e. to have my sharedController method return 
"(sharedController = [[[self class] alloc] init]);"  instead)... the bug still 
occur...

I'm out of ideas... I guess the problem could be in my nib but I also tried to 
perform a "diff" on my nib file (when the app actually runs and when it 
crashes), but the nib is exactly the same in both occasions... I can post my 
singleton code if it would help but it's a singleton template that I use all 
the time without any problems

If anyone has a clue as to what could be happening, it would be really 
appreciated as I really have no idea what to try next...

Jean-Nicolas Jolivet

___

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: "-forwardInvocation:" like NSInvocation creation

2010-03-30 Thread Michael Ash
On Mon, Mar 29, 2010 at 2:15 PM, Philip Mötteli
 wrote:
> Hi,
>
>
> Am 29.03.2010 um 18:52 schrieb A.M.:
>>
>> On Mar 29, 2010, at 11:07 AM, Philip Mötteli wrote:
>>
>>> I need to temporary save the invocation of a method. For that, I just need 
>>> to put the stack frame into an NSInvocation. Unfortunately, Apple has 
>>> removed the -setStackFrame: from NSInvocation. Though they still use 
>>> something like it, because they need it for -forwardInvocation:.
>>> Has anybody implemented a method like [NSInvocation initWithArgframe: 
>>> (arglist_t)frame selector: (SEL)aSelector]?
>>
>> Hm- you haven't made it clear why you need the stack frame. The stack frame 
>> is still there (or constructed on-the-fly), but it is an opaque, hidden 
>> structure. As long as you call retainArguments, NSInvocation can be saved 
>> for later use.
>
> I see, I really wasn't enough clear. Lets say, I have a method
>
> - someMethodWithArgument:(struct *)anArgument 
> andSomeOtherArgument:(id)anotherArgument
> {
>        // Here I want to create an NSInvocation, capturing the call of this 
> method. Something like:
>        NSInvocation *anInvocation = [NSInvocation initWithArgframe: 
> (arglist_t)frame selector: _cmd];
> }

I don't think that such a thing is possible in the general case
without compiler support, because once your function begins executing,
there's no guarantee that the arguments remain in their original
locations on the stack frame. (Especially true on PPC and x86_64,
where arguments are frequently passed in registers.) And no such
compiler support exists.

I'd say that your best bet is probably to do some fancy method
replacement stuff so that your IMP gets replaced with the forwarding
IMP, then your -forwardInvocation: method can store the invocation
somewhere and then pass control over to the real method, where it can
retrieve it.

Mike
___

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: Random "Controller cannot be nil" crash

2010-03-30 Thread Jean-Nicolas Jolivet
Answering my own question here, if anyone has a similar problem, make sure you 
don't mess with any outlets BEFORE your awakeFromNib method :P Yeah it's basic 
stuff but somehow I didn't noticed that a method I was calling in my 
controller's init was resetting a slider to its default position... moving that 
call to awakeFromNib appears to have fixed the issue!

Jean-Nicolas Jolivet


On 2010-03-30, at 2:31 PM, Jean-Nicolas Jolivet wrote:

> I'm having a very frustrating issue that I can't seem to be able to 
> pinpoint...
> 
> When I run my app, I randomly get a crash on startup with the following 
> message(s) in the console:
> 
> ==
> 2010-03-30 13:57:52.599 MyApp[6292:a0f] An uncaught exception was raised
> 2010-03-30 13:57:52.599 MyApp[6292:a0f] Controller cannot be nil
> 2010-03-30 13:57:52.601 MyApp[6292:a0f] *** Terminating app due to uncaught 
> exception 'NSInvalidArgumentException', reason: 'Controller cannot be nil'
> *** Call stack at first throw:
> (
>   0   CoreFoundation  0x989dc40a __raiseError + 410
>   1   libobjc.A.dylib 0x91bbe509 objc_exception_throw 
> + 56
>   2   CoreFoundation  0x989dc138 +[NSException 
> raise:format:arguments:] + 136
>   3   CoreFoundation  0x989dc0aa +[NSException 
> raise:format:] + 58
>   4   AppKit  0x977e771b -[NSBinder 
> addBinding:toController:withKeyPath:valueTransformer:options:] + 252
>   5   AppKit  0x977e00f2 
> -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 
> 703
>   6   AppKit  0x9788c067 
> -[NSNibBindingConnector establishConnection] + 156
>   7   AppKit  0x977bb33b -[NSIBObjectData 
> nibInstantiateWithOwner:topLevelObjects:] + 1249
>   8   AppKit  0x977b9450 loadNib + 257
>   9   AppKit  0x977b8848 
> +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 228
>   10  AppKit  0x977b8759 
> +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 158
>   11  AppKit  0x977b86a4 
> +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 383
>   12  AppKit  0x977b54a9 NSApplicationMain + 
> 434
>   13  MyApp   0x2694 main + 36
>   14  MyApp   0x2665 start + 53
> )
> sharedlibrary apply-load-rules all
> kill
> quit
> 
> ==
> 
> Judging by the trace, I'm thinking it might have something to do with 
> bindings? It appears to be really random... I'd say 1 times out of 3 my app 
> starts normally, the other 2 attempts, I get this error...
> 
> Most of my controllers (that have bindings anyway) are singletons, but I 
> tried changing that (i.e. to have my sharedController method return 
> "(sharedController = [[[self class] alloc] init]);"  instead)... the bug 
> still occur...
> 
> I'm out of ideas... I guess the problem could be in my nib but I also tried 
> to perform a "diff" on my nib file (when the app actually runs and when it 
> crashes), but the nib is exactly the same in both occasions... I can post my 
> singleton code if it would help but it's a singleton template that I use all 
> the time without any problems
> 
> If anyone has a clue as to what could be happening, it would be really 
> appreciated as I really have no idea what to try next...
> 
> Jean-Nicolas Jolivet
> 

___

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


NSIsNilTransformerName exception

2010-03-30 Thread James Walker
I'm trying to make a button be disabled if an array controller is being 
filtered.  So in IB I bound the enabled state of the button to the array 
controller, with controller key "filterPredicate" and value transformer 
"NSIsNilTransformerName".  At run time, an exception is thrown, and the 
log has a message "Cannot find value transformer with name 
NSIsNilTransformerName".  That really confuses me, because the docs say 
that NSIsNilTransformerName is one of the built-in value transformers. 
Clue, please?

--
  James W. Walker, Innoventive Software LLC
  
___

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


[MEET] CocoaHeads April Meetings

2010-03-30 Thread Stephen Zyszkiewicz
Greetings,

CocoaHeads is an international Mac programmer's group. Meetings are free and 
open to the public. We specialize in Cocoa, but everything Mac programming 
related is welcome.

Austria
Graz - Monday, April 19, 2010 19:00
Wien - Thursday, April 8, 2010 19:00

Canada
Toronto, Ontario - Tuesday, April 13, 2010 18:30

France
Paris - Thursday, April 8, 2010 19:00

Sweden
Stockholm - Monday, April 12, 2010 19:00

U.S.A.
Ann Arbor, Michigan - Thursday, April 8, 2010 19:00
Atlanta, Georgia - Thursday, April 8, 2010 19:00
Boulder, Colorado - Tuesday, April 13, 2010 19:00
Chicago, Illinois - Tuesday, April 13, 2010 19:00
Colorado Springs, Colorado - Thursday, April 8, 2010 19:00
Columbia, Maryland - Tuesday, April 13, 2010 18:00
Dallas, Texas - Thursday, April 8, 2010 19:00
Lake Forest, California - Wednesday, April 14, 2010 19:00
Nashville, Tennessee - Thursday, April 22, 2010 19:00
New York, New York - Thursday, April 8, 2010 18:00
Upper Connecticut River Valley - Thursday, April 8, 2010 19:00

United Kingdom
Nottingham - Wednesday, April 21, 2010 20:00
Swindon - Monday, April 5, 2010 20:00

Some chapters may have yet to post their meeting for next month. Meeting times 
may change. Locations and more information here:
http://cocoaheads.org

Also be sure to check for an NSCoder Night in your area:
http://nscodernight.com/


Steve
Silicon Valley CocoaHeads___

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


Predicate format to match array of partial strings against other array

2010-03-30 Thread fabian
ANY {Name,Age,Gender} LIKE[cd] "Mar*"

returns Mary, Martin, etc.

ANY {Name,Age,Gender} IN[cd] {"Mary","Martin"}

also works fine, but doesn't take wildcards, as all array operators uses
direct object comparisons. How can I match an array of partial strings, e.g.
{"Mar*", "Li*"}, against the first array? I'm looking for the elegant
version of:

(ANY {Name,Age,Gender} LIKE "Mar*") OR (ANY {Name,Age,Gender} LIKE "Li*")

Thanks.

-- 
- 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/archive%40mail-archive.com

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


Re: NSIsNilTransformerName exception

2010-03-30 Thread Lee Ann Rucker
NSIsNilTransformerName is the name of the variable defining the  
transformer name.


NSLog(@"NSIsNilTransformerName = %@", NSIsNilTransformerName);

NSIsNilTransformerName = NSIsNil

I'm surprised NSIsNil didn't show up in the binding's popup list.

On Mar 30, 2010, at 12:11 PM, James Walker wrote:

I'm trying to make a button be disabled if an array controller is  
being
filtered.  So in IB I bound the enabled state of the button to the  
array
controller, with controller key "filterPredicate" and value  
transformer
"NSIsNilTransformerName".  At run time, an exception is thrown, and  
the

log has a message "Cannot find value transformer with name
NSIsNilTransformerName".  That really confuses me, because the docs  
say

that NSIsNilTransformerName is one of the built-in value transformers.
Clue, please?
--
  James W. Walker, Innoventive Software LLC
  
___

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/lrucker%40vmware.com

This email sent to lruc...@vmware.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: NSIsNilTransformerName exception

2010-03-30 Thread James Walker

On 3/30/2010 12:36 PM, Lee Ann Rucker wrote:

NSIsNilTransformerName is the name of the variable defining the
transformer name.

NSLog(@"NSIsNilTransformerName = %@", NSIsNilTransformerName);

NSIsNilTransformerName = NSIsNil



Ah, that makes sense, and it works, thanks!



I'm surprised NSIsNil didn't show up in the binding's popup list.



Me too.  I'm sure I've seen all the standard value transformers there 
before.  Now all I see in the transformer list are 
NSKeyedUnarchiveFromData and NSUnarchiveFromData.





On Mar 30, 2010, at 12:11 PM, James Walker wrote:


I'm trying to make a button be disabled if an array controller is being
filtered. So in IB I bound the enabled state of the button to the array
controller, with controller key "filterPredicate" and value transformer
"NSIsNilTransformerName". At run time, an exception is thrown, and the
log has a message "Cannot find value transformer with name
NSIsNilTransformerName". That really confuses me, because the docs say
that NSIsNilTransformerName is one of the built-in value transformers.
Clue, please?



--
  James W. Walker, Innoventive Software LLC
  
___

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


Terminating subtasks reliably

2010-03-30 Thread McLaughlin, Michael P.
I have a Cocoa app (Leopard) which launches several Foundation Tool subtasks
(since threads are not sufficient in this case).  Currently, I terminate
these subtasks via the app-delegate method

-(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication
*)sender

This works provided one Quits the main app using the Quit menu item.
However, if I force-quit or if I abort using the Stop icon in Xcode, then
the main app terminates without terminating the subtasks.

Is there a more reliable hook (e.g., delegate method) that would always get
called even on force-quit or Stop from Xcode so that these subtasks would
always get terminated?  [Otherwise, I have to terminate them from Activity
Monitor.]

Thanks.

-- 
Mike McLaughlin

___

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: Terminating subtasks reliably

2010-03-30 Thread Jeff Johnson
Hi Mike.

How about having the main app periodically post a notification via 
NSDistributedNotificationCenter? The subtasks can observe the notification and 
terminate themselves if they don't receive one for some period of time.

-Jeff


On Mar 30, 2010, at 3:01 PM, McLaughlin, Michael P. wrote:

> I have a Cocoa app (Leopard) which launches several Foundation Tool subtasks
> (since threads are not sufficient in this case).  Currently, I terminate
> these subtasks via the app-delegate method
> 
> -(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication
> *)sender
> 
> This works provided one Quits the main app using the Quit menu item.
> However, if I force-quit or if I abort using the Stop icon in Xcode, then
> the main app terminates without terminating the subtasks.
> 
> Is there a more reliable hook (e.g., delegate method) that would always get
> called even on force-quit or Stop from Xcode so that these subtasks would
> always get terminated?  [Otherwise, I have to terminate them from Activity
> Monitor.]
> 
> Thanks.
> 
> -- 
> Mike McLaughlin

___

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: Terminating subtasks reliably

2010-03-30 Thread Greg Parker
On Mar 30, 2010, at 1:01 PM, McLaughlin, Michael P. wrote:
> I have a Cocoa app (Leopard) which launches several Foundation Tool subtasks
> (since threads are not sufficient in this case).  Currently, I terminate
> these subtasks via the app-delegate method
> 
> -(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication
> *)sender
> 
> This works provided one Quits the main app using the Quit menu item.
> However, if I force-quit or if I abort using the Stop icon in Xcode, then
> the main app terminates without terminating the subtasks.
> 
> Is there a more reliable hook (e.g., delegate method) that would always get
> called even on force-quit or Stop from Xcode so that these subtasks would
> always get terminated?  [Otherwise, I have to terminate them from Activity
> Monitor.]

There's no perfectly-reliable way for the parent task to kill the child. In the 
worst case, the parent stops suddenly because of a hang or deadlock and never 
executes another instruction before being killed. You could try adding signal 
handlers and atexit() handlers to catch more cases, but you'll never catch them 
all.

The reliable solution is to provide a way for the child to notice when the 
parent dies, and quit itself in response. This usually means opening an IPC 
channel between the parent and child, like a pipe or Mach port. No data is 
actually sent across this channel. Instead, the child watches if the parent's 
end of the channel is open. When the parent dies it's half of the channel is 
closed by the kernel no matter how the parent died, so the child gets a 
reliable notification that the parent is gone.


-- 
Greg Parker gpar...@apple.com Runtime Wrangler


___

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: "-forwardInvocation:" like NSInvocation creation

2010-03-30 Thread Gwynne Raskind
On Mar 30, 2010, at 2:54 PM, Michael Ash wrote:
>> I see, I really wasn't enough clear. Lets say, I have a method
>> 
>> - someMethodWithArgument:(struct *)anArgument 
>> andSomeOtherArgument:(id)anotherArgument
>> {
>>// Here I want to create an NSInvocation, capturing the call of this 
>> method. Something like:
>>NSInvocation *anInvocation = [NSInvocation initWithArgframe: 
>> (arglist_t)frame selector: _cmd];
>> }
> I don't think that such a thing is possible in the general case
> without compiler support, because once your function begins executing,
> there's no guarantee that the arguments remain in their original
> locations on the stack frame. (Especially true on PPC and x86_64,
> where arguments are frequently passed in registers.) And no such
> compiler support exists.
> 
> I'd say that your best bet is probably to do some fancy method
> replacement stuff so that your IMP gets replaced with the forwarding
> IMP, then your -forwardInvocation: method can store the invocation
> somewhere and then pass control over to the real method, where it can
> retrieve it.


Another alternative would be to combine method_getNumberOfArguments() and 
method_copyArgumentType() with ffi_prep_cif() and ffi_call(), which I think is 
what libobjc itself does these days. libffi is available since at least 10.5. 
Pass the method's IMP to ffi_call() and don't forget to adjust the call to 
ffi_prep_cif() for the hidden self and _cmd arguments. libffi is available at 
least since 10.5.

-- Gwynne



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Terminating subtasks reliably

2010-03-30 Thread A.M.

On Mar 30, 2010, at 4:01 PM, McLaughlin, Michael P. wrote:

> I have a Cocoa app (Leopard) which launches several Foundation Tool subtasks
> (since threads are not sufficient in this case).  Currently, I terminate
> these subtasks via the app-delegate method
> 
> -(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication
> *)sender
> 
> This works provided one Quits the main app using the Quit menu item.
> However, if I force-quit or if I abort using the Stop icon in Xcode, then
> the main app terminates without terminating the subtasks.
> 
> Is there a more reliable hook (e.g., delegate method) that would always get
> called even on force-quit or Stop from Xcode so that these subtasks would
> always get terminated?  [Otherwise, I have to terminate them from Activity
> Monitor.]

Your subtasks can use kqueue's EVFILT_PROC filter with the NOTE_EXIT fflag to 
be alerted when the parent process exits. If your subtasks are spinning their 
NSRunLoops, you can integrate kqueue via CFFileDescriptor.

Cheers,
M___

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


Saving jpeg data

2010-03-30 Thread John Nairn
My application now saves jpeg thumbnail data from an NSImage of a bit  
map by using


  [NSBitmapImageRep representationUsingType:properties]

selector and it works fine in Snow Leopard development. When I run the  
app in Tiger, however, the code fails with following selector problem  
in the Console:


2010-03-30 13:03:24.689 GEDitCOM II[631] start saving file at  
2010-03-30 13:03:24 -0700
2010-03-30 13:03:26.738 GEDitCOM II[631] *** -[NSCachedImageRep  
representationUsingType:properties:]: selector not recognized [self =  
0x930a8c0]


I checked and [NSBitmapImageRep representationUsingType:properties]  
has been available since 10.0. I don't know what NSCachedImageRep is  
and I did not think I created or accessed one either?


---
John Nairn (1-541-737-4265, FAX:1-541-737-3385)
Professor and Richardson Chair
Web Page: http://www.cof.orst.edu/cof/wse/faculty/Nairn/
FEA/MPM Web Page: http://oregonstate.edu/~nairnj




___

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: Saving jpeg data

2010-03-30 Thread Ken Ferry
Hi John,

This would mean that you're assuming that a particular NSImageRep retrieved
from an NSImage is an NSBitmapImageRep, and it isn't.

-Ken

On Tue, Mar 30, 2010 at 1:37 PM, John Nairn  wrote:

> My application now saves jpeg thumbnail data from an NSImage of a bit map
> by using
>
>  [NSBitmapImageRep representationUsingType:properties]
>
> selector and it works fine in Snow Leopard development. When I run the app
> in Tiger, however, the code fails with following selector problem in the
> Console:
>
> 2010-03-30 13:03:24.689 GEDitCOM II[631] start saving file at 2010-03-30
> 13:03:24 -0700
> 2010-03-30 13:03:26.738 GEDitCOM II[631] *** -[NSCachedImageRep
> representationUsingType:properties:]: selector not recognized [self =
> 0x930a8c0]
>
> I checked and [NSBitmapImageRep representationUsingType:properties] has
> been available since 10.0. I don't know what NSCachedImageRep is and I did
> not think I created or accessed one either?
>
> ---
> John Nairn (1-541-737-4265, FAX:1-541-737-3385)
> Professor and Richardson Chair
> Web Page: http://www.cof.orst.edu/cof/wse/faculty/Nairn/
> FEA/MPM Web Page: http://oregonstate.edu/~nairnj
>
>
>
>
> ___
>
> 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/kenferry%40gmail.com
>
> This email sent to kenfe...@gmail.com
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Events not being dispatched when having native Cocoa component in modal JDialog

2010-03-30 Thread Martin Nedbal

Hi,
I have a simple JNI-based code for embedding WebKit into Swing GUI (I
can post sources if needed). It works fine while in regular Swing JFrame
but it fails to work when added to modal JDialog - events are blocked
apparently. WebKit view shows properly, but if I request a page to be
loaded into it it's not loaded and FrameLoaderDelegate does not get
didFinishLoadForFrame nor didFail* calls.

I wasn't able to find much about this issue in Google/Apple mailing
lists. The only thing I found was a thread from 2005 discussing nasty
workaround based on having non-modal dialog with blocking loop after
setVisible() call.

It can be reproduced on Snow Leopard with latest Java6 installed but it
does not really seems to be dependent on versions that much.

Any ideas how to solve this problem in a clean way?

PS: I already tried posting to Java-dev mailing list but got no reply 
whatsoever;(


Thanks.

Best regards,
 Martin
___

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: Saving jpeg data

2010-03-30 Thread Nick Zitzmann

On Mar 30, 2010, at 2:37 PM, John Nairn wrote:

> My application now saves jpeg thumbnail data from an NSImage of a bit map by 
> using
> 
>  [NSBitmapImageRep representationUsingType:properties]
> 
> selector and it works fine in Snow Leopard development. When I run the app in 
> Tiger, however, the code fails with following selector problem in the Console:
> 
> 2010-03-30 13:03:24.689 GEDitCOM II[631] start saving file at 2010-03-30 
> 13:03:24 -0700
> 2010-03-30 13:03:26.738 GEDitCOM II[631] *** -[NSCachedImageRep 
> representationUsingType:properties:]: selector not recognized [self = 
> 0x930a8c0]
> 
> I checked and [NSBitmapImageRep representationUsingType:properties] has been 
> available since 10.0. I don't know what NSCachedImageRep is and I did not 
> think I created or accessed one either?

Are you, by any chance, creating this image by locking focus on an NSImage and 
then drawing? NSCachedImageRep is more or less obsolete in Snow Leopard, but 
before SL, if you did this, you ended up with an NSCachedImageRep instead of an 
NSBitmapImageRep.

In any case, one way of working around this problem is by putting the 
NSCachedImageRep into an NSImage if it isn't in one already, calling 
-TIFFRepresentation on the image, and using the resulting data to create a new 
NSBitmapImageRep.

Nick Zitzmann


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Building Intel only

2010-03-30 Thread Marcel Borsten
Hi All,

I'm using a static lib that is compiled for intel 32/64 bit only. I've removed 
all my ppc options from Valid Architectures, but when I'm trying to build a 
Release version I still get the following error:  'missing required 
architecture ppc in file' for the static libs I'm using. How can I force Xcode 
to build Intel 32/64 only?

Regards,

Marcel___

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: Building Intel only

2010-03-30 Thread David Duncan
On Mar 30, 2010, at 1:54 PM, Marcel Borsten wrote:

> I'm using a static lib that is compiled for intel 32/64 bit only. I've 
> removed all my ppc options from Valid Architectures, but when I'm trying to 
> build a Release version I still get the following error:  'missing required 
> architecture ppc in file' for the static libs I'm using. How can I force 
> Xcode to build Intel 32/64 only?


Tell it to. In the chosen architectures list, select "Other" and enter the 
architectures you wish to build.
--
David Duncan
Apple DTS Animation and Printing

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Building Intel only

2010-03-30 Thread Marcel Borsten
Thanks for the reply,

I see now what I did wrong, I changed the architectures for the project, not 
the target.

Regards,

Marcel

On 30 mrt 2010, at 22:57, David Duncan wrote:

> On Mar 30, 2010, at 1:54 PM, Marcel Borsten wrote:
> 
>> I'm using a static lib that is compiled for intel 32/64 bit only. I've 
>> removed all my ppc options from Valid Architectures, but when I'm trying to 
>> build a Release version I still get the following error:  'missing required 
>> architecture ppc in file' for the static libs I'm using. How can I force 
>> Xcode to build Intel 32/64 only?
> 
> 
> Tell it to. In the chosen architectures list, select "Other" and enter the 
> architectures you wish to build.
> --
> David Duncan
> Apple DTS Animation and Printing
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


[iPhone] Move delete control in custom UITableViewCell

2010-03-30 Thread PCWiz
I have a UITableViewCell with a custom backgroundView (for custom cell 
drawing). To make it look proper with my cell, I need to move both the delete 
disclosure indicator (the red circle with a white line through it) and the 
Delete button itself over a few pixels. How do I change the position?

Thanks___

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: Terminating subtasks reliably

2010-03-30 Thread John Harte

On Mar 30, 2010, at 4:01 PM, McLaughlin, Michael P. wrote:

> I have a Cocoa app (Leopard) which launches several Foundation Tool subtasks
> (since threads are not sufficient in this case).  Currently, I terminate
> these subtasks via the app-delegate method
> 
> -(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication
> *)sender
> 
> This works provided one Quits the main app using the Quit menu item.
> However, if I force-quit or if I abort using the Stop icon in Xcode, then
> the main app terminates without terminating the subtasks.
> 
> Is there a more reliable hook (e.g., delegate method) that would always get
> called even on force-quit or Stop from Xcode so that these subtasks would
> always get terminated?  [Otherwise, I have to terminate them from Activity
> Monitor.]
> 

I use kqueue in the child process. Kick off a thread and wait for the parent to 
terminate.


int main (int argc, char* const argv[]) {
// Start a thread to watch for parent termination
pthread_t thread;
int error = pthread_create (&thread, 0, WatchForTermination, 0);
   .
   .
   .

void* WatchForTermination (void* arg) { 
pid_t ppid = getppid ();// get parent pid

int kq = kqueue ();
if (kq != -1) {
struct kevent procEvent;// wait for parent to exit
EV_SET (&procEvent, // kevent
ppid,   // ident
EVFILT_PROC,// filter
EV_ADD, // flags
NOTE_EXIT,  // fflags
0,  // data
0); // udata

kevent (kq, &procEvent, 1, &procEvent, 1, 0);
}
printf ("Terminating--Parent Process Terminated\n");
exit (0);   
return 0;
}

___

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


Best way to selectively show objects in a tree controller/outlineview

2010-03-30 Thread Tony Romano
Based on a user preference, I want to be able to selectively show/not show 
items contained in the tree controller by an outline view. For example, suppose 
the tree controller has these items: A,B,C,D,D,E,F,G,H.  The outline view will 
normally display all of the items.  Now suppose the user sets a preferences 
that he/she doesn't want to show item(s) 'D'.  The outline view should now 
display: A,B,C,E,F,G,H. 

One obvious method(albeit brute force) is to rebuild the tree controller list 
and redisplay it.  For what I want to do, this is way too expensive of an 
operation.  In addition, the user can toggle back and forth the preference.  
There doesn't seem to be an obvious way to tell the outline controller, "skip 
or hide this item".

Thanks,

-tony



___

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 way to selectively show objects in a tree controller/outlineview

2010-03-30 Thread Kyle Sluder
On Tue, Mar 30, 2010 at 8:35 PM, Tony Romano  wrote:
> One obvious method(albeit brute force) is to rebuild the tree controller list 
> and redisplay it.  For what I want to do, this is way too expensive of an 
> operation.  In addition, the user can toggle back and forth the preference.  
> There doesn't seem to be an obvious way to tell the outline controller, "skip 
> or hide this item".

See -[NSArrayController filterPredicate].

If that doesn't suit your needs, subclass NSArrayController and do
your filtering in -arrangeObjects. If *that* doesn't suit your needs,
bind your array controller to a to-many property you control and do
your filtering there.

--Kyle Sluder
___

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: NSPredicateEditorRowTemplate and dynamic templateViews

2010-03-30 Thread Dave DeLong
I'm still struggling with this.  Does anyone know how I can either:

1.  Use custom comparators in an NSPredicateEditorRowTemplate or
2.  Have two templates with the same left expression and operator, but 
different right expression types?

Thanks,

Dave

On Mar 12, 2010, at 7:29 PM, Dave DeLong wrote:

> My date row templates allow me to do:
> 
> "aDate is after aSpecificDate" and "aDate is in the last 30 days"
> 
> Both of these are technically: "aDate > anotherDate"
> 
> When I -init these custom row templates, I need to pass in an array of 
> operators.  I can't init both of these templates with a GreaterThan operator 
> (I tried, and it complained).  There's an operator listed in the 
> documentation, "NSCustomSelectorPredicateOperatorType", which is presumably 
> used with an NSComparisonPredicate, but there's very very little in there 
> about how to use that from within an NSPredicateEditorRowTemplate.  Can that 
> operator type be used in a EditorRowTemplate (my attempts to do so have 
> resulted in HIToolbox generating an Unknown Predicate Type exception)?  If 
> not, how can I have two different kinds of "greater than" comparisons in the 
> same row template?


smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Creating WebView in code

2010-03-30 Thread Jenny M
Hi Nick...

On Sun, Mar 28, 2010 at 12:49 PM, Nick Zitzmann  wrote:
>> Is it possible I could create it in a xib file and keep it invisible,
>> and handle closing programmatically so it's not a waste of memory?
>
> Yes.
>

Okay... how? I can uncheck "visible at launch," then how do I control
the visibility and memory for that window via code?


>> How
>> would I go about this, or is there an easier way?
>
> Subclassing NSView/WindowController, giving it a nib with a WebView, and 
> doing whatever you need to do in that controller subclass would work. Or you 
> could just create the WebView using -initWithFrame:. Note that I've found 
> that WebViews that are not placed inside windows won't actually render 
> anything, so you'll have to create a dummy window as well, though you won't 
> need to open it.
>
> Nick Zitzmann
> 
>

I looked at initWithFrame, which looked to be my only way to open a
webview completely programmatically, but then I'm not sure what the
NSRect should be. I'll be printing so is there an NSRect I can grab
from NSSharedPrintInfo somewhere??
___

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


Adding fixed position subview over a scrollview

2010-03-30 Thread Gideon King
Hi all

I have a scrollview, and I want to add a fixed position subview on top of it so 
it always displays at the same place relative to the top left of the 
scrollview, no matter whether the user scrolls the document or resizes etc.

I have tried the following methods, but none of them have left me with the 
result I want:

...adding my view as a subview of:
- the scrollview
- the scrollview's clipview
- the scrollview's document view
- the scrollview's content view
- the tab view which is the superview of the scrollview
also
- adding a new view as  the tabview item's view, and adding the scrollview and 
my view as sibling subviews
- making my own scrollview subclass and drawing there.

The results I have achieved so far are:
- nothing shown (probably because the other views get drawn on top of it)
- starts in the right place, but scrolls when the view scrolls
- fixed location on the document, either relative to 0,0 point or the top left 
corner of the view (which means it scrolls when the content scrolls)

The current view hierarchy is:
- Window content view (can't have it here as it moves around when other views 
resize)
- RBSplitView (ditto)
- RBSplitSubView (adding it as a subview here makes RBSplitView think it needs 
to be tiled, or if I hack the RB code for it to ignore my view in the tiling, 
it somehow ends up as part of the scrollview)
- TabView (adding as a subview here means that the scrollview draws over the 
top of it)
- ScrollView (adding it as a subview here, or drawing my own custom scrollview 
means the subviews of the scrollview overwrite it)
- ClipView (adding it here means that it scrolls)
- MyView (adding it here means that it scrolls)

I feel as if I must be missing something obvious...

Any suggestions on how I could get this to work?

Thanks

Gideon



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Adding fixed position subview over a scrollview

2010-03-30 Thread Kyle Sluder
On Tue, Mar 30, 2010 at 11:06 PM, Gideon King  wrote:
> Any suggestions on how I could get this to work?

Why does it need to be a subview of the scroll view? If you're
targeting 10.6 it sounds like you could just make it a peer of the
scroll view and size it appropriately. Just make sure that you return
NO from -isOpaque if required, and that you fix the z-order in
-awakeFromNib (I believe IB still has a bug where it encodes objects
in backwards z-order).

If you're targeting 10.5, sibling views can't overlap.

--Kyle Sluder
___

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