Re: Memory Management question

2008-12-25 Thread Scott Wilson
Okay, but just to be absolutely clear (so I can be sure I'm  
understanding this correctly):


1) desiredURL is a local to my method. It is not used outside the  
method's scope.


2) I get the exception within my method, not anywhere afterwards. I  
didn't think you had to retain objects passed as arguments into a  
method unless you wanted to use them beyond that scope. (That would  
certainly make things more complicated than I'd thought!)


Am I missing something?

Thanks!

S.

Indeed, you have no way of guaranteeing that link still exists as  
you are not explicitly claiming ownership to it. In the first case  
of your if, you receive an autoreleased NSURL instance (a new object  
created by using the contents of the link object). In the second,  
all your code is doing is deciding that desiredURL should point to  
the same object as link without claiming ownership of it. To ensure  
that you hold ownership of it, you need to explicitly retain it  
(code executing in the context of another thread might release it  
and cause it to receive -dealloc) or copy it (the former probably  
being the more appropriate in this case). Following that, it should  
be released when it is no longer of any relevance in this particular  
context.


Therefor, I think you'll find that your findings are indeed the  
expected behavior - if it's worked in the past it's due more to luck  
than to anything else.


-rob.

On Dec 25, 2008, at 2:30 PM, Scott Wilson wrote:

I have an odd case. I've got a NSTextView delegate method which  
looks like this:


- (BOOL) textView: (NSTextView *) textView
clickedOnLink: (id) link
atIndex: (unsigned) charIndex
{
...

NSURL *desiredURL;

// is it a NSURL link or a NSString link?
if ([link isKindOfClass: [NSString class]])
{
...
desiredURL = [NSURL URLWithString: [link  
stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]  
relativeToURL: lastOpened];


} else if ([link isKindOfClass: [NSURL class]]) // this is the case  
which causes the problem!!

{
desiredURL = link; // it's a regular file:// URL

} else return NO;

NSLog(@"url %@", [desiredURL path]); // get EXC_BAD_ACCESS if link  
was an NSURL


...
}

If I change the code above to desiredURL = [link retain] everything  
is fine. I've used very similar code with no problems in a different  
context.


Is it possible that link is being autoreleased before my method has  
returned?


Thanks

___

Cocoa-dev mailing list (em...@hidden)

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/em...@hidden

This email sent to em...@hidden


___

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


shareware licensing, aquatic prime?

2008-12-25 Thread aaron smith
hey all, I've been looking around for different licensing techniques,
I've come across aquatic prime which looks pretty secure. but after
reading quite a few debates about it, it makes me skeptical. is there
anyone out there who uses it, or can vouch for it? I am also thinking
that it's probably ok, as my app isn't going to be some million dollar
app that crackers would even want to target. So I don't know, just
looking for someone's experience, and if they had alternatives. Thanks
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: Crash as NSPersistentDocument creates its persistence stack

2008-12-25 Thread Jerry Krinock

On 2008 Dec, 24, at 0:03, mmalc Crawford wrote:





Thank you, mmalc.  Indeed it was explained further down in the  
documentation you noted.


I believe the problem is my triggering some kind of bug in the way  
Xcode handles multiple/versioned data models.


My project included two xcdatamodel files.  One was versioned and one  
was not.  The problem apparently occurred when I wanted to consolidate  
them into one.  Hoping to avoid re-typing all the attributes, using  
Xcode's GUI data model editor, I copied the single entity which was in  
the non-versioned xcdatamodel to the clipboard and pasted it into the  
versioned xcdatamodel, saved it, and deleted the non-versioned  
xcdatamodel.  Everyone looked happy.


Except, when the project built, a very strange thing would happen.  In  
Contents/Resources there would be a folder named Bkmm.momd containing  
an item named BmxBk 2.mom.  Bkmm was the name of the non-versioned  
xcdatamodel which I had deleted.  BmxBk 2 was version 2 of the  
consolidated xcdatamodel which remained.


Then when the project ran, my persistent document initialized itself  
with an invalid managed object model.  I proved that by gutting my  
NSPersistentDocument subclass and replacing it with a Bonehead  
implementation [1] that simply logs each object in the persistence  
stack when the user creates a new document.  The console output [2]  
shows that the moc and the psc are OK, but the mom is invalid.


First, I tried adding another valid data model containing a simple  
entity with one attribute to the project.  Still same crash.


Then, I removed the screwed-up data model from the project and re- 
added it.  Now, it even showed up in wrong in Xcode's Groups & Files,  
with the BmxBk.xcdatamodel contained in a "folder" named after the  
deleted Bkmm.xcdatamodel...


 
  <>


If I deleted all xcdatamodels from the project, then it would build  
run and log the whole persistence stack without crashing.  Of course,  
the model's entities logged as an empty dictionary.


Finally, I created a new Cocoa Core Data Document-Based application  
project from scratch, replaced the data model provided by the Xcode  
template with a copy of my consolidated xcdatamodel, and added the  
iniWithType:error: implementation from my Bonehead implementation to  
the template's MyDocument.  Building and running this project logs my  
entire managed object model as expected; no crash.


So, tomorrow I'm going to copy all of my old files to the new project  
and I expect that it will work again.  Oh well, the project was in  
need of a renaming and a housecleaning anyhow.


Unless someone sees otherwise, I'll strip down my old project someday  
and file a bug regarding Xcode.


Jerry


[1] Bonehead implementation of an NSPersistentDocument subclass

@interface BmxBk : NSPersistentDocument {
}

@implementation BmxBk

- (id)initWithType:(NSString *)type error:(NSError **)error_ {
self = [super initWithType:type
 error:error_];
if (self) {
// All of the code in this method executes OK if I paste it  
into
// -[MyDocument initWithType:error] of the  
DepartmentsAndEmployees

// Apple Sample Code.

// The usleeps are because the NSLogs sometimes appear after  
the later
// gdb startup in the console log, obscuring what triggered  
the crash.


// Do we have a valid doc type?
NSLog(@"doc type = %@", type) ;

// Do we have a valid moc?
NSManagedObjectContext* moc = [self managedObjectContext] ;
NSLog(@"moc = %@", moc) ;
NSLog(@"Will sleep 5") ;
usleep (500) ;

// Do we have a valid psc?
NSPersistentStoreCoordinator* psc = [moc  
persistentStoreCoordinator] ;

NSLog(@"psc = %@", psc) ;
NSLog(@"Will sleep another 5") ;
usleep (500) ;

// Do we have a valid mom?
NSManagedObjectModel* mom = [psc managedObjectModel] ;
NSLog(@"mom = %@", mom) ; // <-- Crash or log something not a  
mom.

NSLog(@"Will sleep a third 5") ;
usleep (500) ;

// Can we see the entities in our mom?
NSDictionary* entities = [mom entitiesByName] ;
NSLog(@"entities = %@", entities) ;
NSLog(@"Will sleep a fourth 5") ;
usleep (500) ;
}
return self ;
}

@end

[2] Console output produced by [1]

• User clicks in menu File > New.  Note that mom is not a mom.
MyApp[24942:10b] doc type = MyApp Document
MyApp[24942:10b] moc = 
MyApp[24942:10b] psc = 
MyApp[24942:10b] mom = 
MyApp[24942:10b] *** -[NSKeyValueUndefinedSetter entitiesByName]:  
unrecognized selector sent to instance 0x15b168b0
MyApp[24942:10b] *** -[NSKeyValueUndefinedSetter entitiesByName]:  
unrecognized selector sent to instance 0x15b168b0

•

Re: Memory Management question

2008-12-25 Thread Robert Marini
Indeed, you have no way of guaranteeing that link still exists as you  
are not explicitly claiming ownership to it.  In the first case of  
your if, you receive an autoreleased NSURL instance (a new object  
created by using the contents of the link object).  In the second, all  
your code is doing is deciding that desiredURL should point to the  
same object as link without claiming ownership of it.  To ensure that  
you hold ownership of it, you need to explicitly retain it (code  
executing in the context of another thread might release it and cause  
it to receive -dealloc) or copy it (the former probably being the more  
appropriate in this case).  Following that, it should be released when  
it is no longer of any relevance in this particular context.


Therefor, I think you'll find that your findings are indeed the  
expected behavior - if it's worked in the past it's due more to luck  
than to anything else.


-rob.

On Dec 25, 2008, at 2:30 PM, Scott Wilson wrote:

I have an odd case. I've got a NSTextView delegate method which  
looks like this:


- (BOOL) textView: (NSTextView *) textView
   clickedOnLink: (id) link
  atIndex: (unsigned) charIndex
{
...

NSURL *desiredURL;

// is it a NSURL link or a NSString link?
if ([link isKindOfClass: [NSString class]])
   {
...
		desiredURL = [NSURL URLWithString: [link  
stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]  
relativeToURL: lastOpened];


   } else if ([link isKindOfClass: [NSURL class]]) // this is the  
case which causes the problem!!

   {
desiredURL = link; // it's a regular file:// URL

   } else return NO;

	NSLog(@"url %@", [desiredURL path]); // get EXC_BAD_ACCESS if link  
was an NSURL


...
}

If I change the code above to desiredURL = [link retain] everything  
is fine. I've used very similar code with no problems in a different  
context.


Is it possible that link is being autoreleased before my method has  
returned?


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/rob%40pinchmedia.com

This email sent to r...@pinchmedia.com




smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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

[Moderator] Re: Merry Christmas

2008-12-25 Thread Scott Anguish

Please don't follow-up to this thread, or post such messages.

It isn't appropriate for this list, and these to messages cause 16000+  
messages to go out.


thanks

scott
[moderator/grinch]


On 25-Dec-08, at 3:06 PM, Gustavo Pizano wrote:

Merry Xmas to all of you guys. Make your wishes come true, as mine  
so far, DEvelop for a Mac developing Company. :P..


Health, happiness, love and of course why no, some money :P.

Gustavo

On 25.12.2008, at 13:24, John Love wrote:



A very Merry and Blessed! Christmas to all of you and your families  
and friends


John Love
Touch the Future! Teach!



___

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: processPendingChanges and disableUndoRegistration

2008-12-25 Thread Quincey Morris

On Dec 25, 2008, at 18:52, christophe mckeon gonzalez de leon wrote:


please pardon the rambling, but i'm just trying to
wrap my head around the semantics involved here.


I think it's simpler than you're assuming it to be. All  
processPendingChanges does (as far as undo is concerned) is to hand  
off any pending property changes to the undo manager (possibly  
winnowing out unnecessary ones -- if a certain property was changed 5  
times in a row, for example, they can be coalesced into a single undo  
action). All disableUndoRegistration does is to cause the undo manager  
to throw away undo actions handed off to it until told otherwise.


If you're just trying to prevent a document from being 'dirty' just  
because you opened it, you don't really care what changes are pending  
or why, you just want to prevent them from getting to the undo  
manager, so the sequence is:


disableUndoRegistration
	... your code that might cause additional changes to the managed  
object context ...

processPendingChanges
enableUndoRegistration

which is basically what Apple's sample code does.

It doesn't matter what happened before disableUndoRegistration,  
because whatever it was (if anything) you don't want it to become an  
undo action. That's better than making it become an undo action and  
then forcing it to be thrown away.


(If it's possible that something has *already* been registered with  
the undo manager, then, yes, you'd also want to remove all undo  
actions and set the document changed state back to unchanged, but  
typically changes will only result from things you do when opening the  
document, so you can do them with undo registration disabled.)


The scenario where you would want to put a processPendingChanges  
*before* the disableUndoRegistration is when you *do* want to register  
changes up to that point, before you make a change that shouldn't  
register an undo action.



___

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: processPendingChanges and disableUndoRegistration

2008-12-25 Thread christophe mckeon gonzalez de leon
thanks for the pointer.

please pardon the rambling, but i'm just trying to
wrap my head around the semantics involved here.

according to Quincey Morris who answered
your question, the way that apple has it in
their tutorial:

dur (disable undo registration)
mmoc (somehow mutate managed object context and possibly register an
undo action)
ppr (process pending requests)
eur (enable undo registration)

would in fact not be so great because
the context could have been dirtied before any
of the above happened, so we could write

mmoc1 -> dur -> mmoc2 -> ppr -> eur

now if i understood correctly, if mmoc1
triggered an undo registration (which we can't know),
then we would have an undesirable undo action.
but, if it didn't register before dur was called, then
this would actually be alright because the ppr
would happen with undo registration disabled,
and so the changes made by mmoc1 would not
be registered for undo. correct?

hence if we did it my way:

mmoc1 -> ppr -> dur -> mmoc2 -> ppr -> eur

then mmoc1 would always register an unwanted
undo, but at least it would be deterministic. correct?

it would seem then that the correct way to
do document initialization, given that we are heeding
Quincey's advice and not trusting core data to give
us a clean slate,  would be

mmoc1 ... mmocN -> ppr -> raa (remove all actions)

and it would also seem that in general the code
posted by apple, namely

dur -> mmoc > ppr -> eur

is a very bad idea because any previous mmocs could
non-deterministically be processed after dur and not
be properly be registerd with the undo manager.

whew. is that all right?

thanks again,
_c





On Thu, Dec 25, 2008 at 5:52 PM, Jerry Krinock  wrote:
> I asked almost the same question a couple months ago.  Read the replies to
> this:
>
> http://www.cocoabuilder.com/archive/message/cocoa/2008/10/25/220970
>
> and let us know if that does not answer your question.
>
> ___
>
> 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/chromatophore%40gmail.com
>
> This email sent to chromatoph...@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: processPendingChanges and disableUndoRegistration

2008-12-25 Thread Jerry Krinock
I asked almost the same question a couple months ago.  Read the  
replies to this:


http://www.cocoabuilder.com/archive/message/cocoa/2008/10/25/220970

and let us know if that does not answer your question.

___

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


processPendingChanges and disableUndoRegistration

2008-12-25 Thread christophe mckeon gonzalez de leon
hi,

in the NSPersistentDocument Core Data tutorial, apple includes
the below code. my question is whether there should not also
be another call to processPendingChanges before the call
to disableUndoRegistration? i have seen several examples
of code online which do call it twice, and it would seem to
make more sense.

thanks for any tips,
_c

- (id)initWithType:(NSString *)type error:(NSError **)error
{
self = [super initWithType:type error:error];
if (self != nil) {
NSManagedObjectContext *managedObjectContext = [self
managedObjectContext];
[[managedObjectContext undoManager] disableUndoRegistration];
self.department = [NSEntityDescription
insertNewObjectForEntityForName:@"Department"
inManagedObjectContext:managedObjectContext];
[managedObjectContext processPendingChanges];
[[managedObjectContext undoManager] enableUndoRegistration];
}
return self;
}
___

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: Verify that only one launchd-started process runs at a time

2008-12-25 Thread Ken Thomases

On Dec 25, 2008, at 6:22 PM, Jerry Krinock wrote:


On 2008 Dec, 25, at 15:29, Per Ohlson wrote:

I would like to make shure that the second daemon started will wait  
for the first daemon to finish before the second starts.
Can this somehow be done with SIGTERM signaling or something? Any  
other suggestions?


Well, what would send the SIGTERM?  You'd need to have some kind of  
"monitor my processes" process always running.  You don't want to do  
that.


A simpler approach would be to let your second process launch, but  
before it does any damage, have it acquire some kind of exclusive  
lock.  If the lock has already been acquired by a sister process,  
sleep for 1 second and retry.


Maybe someone knows if Mac OS X has a facility for processes to  
define system-wide locks like this.


See flock(2).  Or POSIX semaphores (sem_open, sem_wait, etc.).

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


Re: Verify that only one launchd-started process runs at a time

2008-12-25 Thread Jerry Krinock


On 2008 Dec, 25, at 15:29, Per Ohlson wrote:

I would like to make shure that the second daemon started will wait  
for the first daemon to finish before the second starts.
Can this somehow be done with SIGTERM signaling or something? Any  
other suggestions?


Well, what would send the SIGTERM?  You'd need to have some kind of  
"monitor my processes" process always running.  You don't want to do  
that.


A simpler approach would be to let your second process launch, but  
before it does any damage, have it acquire some kind of exclusive  
lock.  If the lock has already been acquired by a sister process,  
sleep for 1 second and retry.


Maybe someone knows if Mac OS X has a facility for processes to define  
system-wide locks like this.  If not, you could invent your own -- for  
example, to claim a lock, write an empty file named FooBusy.lock at  
some known constant path.  To try and acquire the lock, see if  
FooBusy.lock does not exist.  To relinquish the lock, delete the file  
FooBusy.lock.  Another method, if your process is an application and  
has user defaults, write a key FooBusy to your app's user defaults --  
same idea.


___

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


Verify that only one launchd-started process runs at a time

2008-12-25 Thread Per Ohlson
I have a small daemon which i scheduled to run at different times of  
the day by using launchd-plists with StartCalendarInterval. This  
daemon is using a USB-device which only handles one call at a time.

Sometimes, the daemon is scheduled to run twice at the same time.
I would like to make shure that the second daemon started will wait  
for the first daemon to finish before the second starts.
Can this somehow be done with SIGTERM signaling or something? Any  
other suggestions?


/P
___

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


renderer CALayer via CARenderer into CGLContext (off screen)

2008-12-25 Thread John Clayton

Hi All,

I've got a question re: CARenderer and rendering.  Its probably best  
to express first what I want to achieve, and then what I'm doing to  
try and get there - maybe someone has a better idea and can point me  
in the correct direction.


What I want to achieve:
- render each frame of a CALayer into a pixel buffer so I can feed  
that into an quicktime ICM quicktime compression session
- the compression session requires CVPixelBuffer instances for each  
frame


so, the approach I've so far taken is this:  have the CALayer render  
into a CGLContext by using the CARenderer class.  I'm stuck here  
though because I'm not sure where to go from here.  I've rendered into  
the context, but how do I get the image out of the context?  I feel  
I'm missing something - i.e. the connection between a context and the  
actual image, for example: should I render into a texture or a pixel  
buffer - in this case, pixel buffer feels like the right answer.


I reckon what I want to achieve is the following (correct me if I'm  
wrong/crazy though):

1. create a pool of pixel buffer objects (lets say 5 for this example)
2. take a pixel buffer object from the pool and attach it to the  
CGLContext

3. render a single frame using the CARenderer
4. feed the pixel buffer to ICM
5. goto (2) if there are still some available pixel buffer objects in  
the pool




Or am I completely missing the point?

Thanks
--
John Clayton
Skype: johncclayton




___

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 items to low level context menus

2008-12-25 Thread mmalc Crawford


On Dec 25, 2008, at 12:16 PM, Aaron Wallis wrote:

As an example, whenever someone has text selected and opens the  
context menu, I want the user to be able to send the selected text  
to my app...

Is that possible? If so, any pointers on where to start looking?




mmalc

___

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 items to low level context menus

2008-12-25 Thread Aaron Wallis

Hi there,

I'm working on a small application which is meant to help users track  
notes & research data and I was wondering if there's any way of adding  
items to context menus system wide?
As an example, whenever someone has text selected and opens the  
context menu, I want the user to be able to send the selected text to  
my app...


Is that possible? If so, any pointers on where to start looking?

Cheers

- Az
___

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: Merry Christmas

2008-12-25 Thread Gustavo Pizano
Merry Xmas to all of you guys. Make your wishes come true, as mine so  
far, DEvelop for a Mac developing Company. :P..


Health, happiness, love and of course why no, some money :P.

Gustavo

On 25.12.2008, at 13:24, John Love wrote:



A very Merry and Blessed! Christmas to all of you and your families  
and friends


John Love
Touch the Future! Teach!



___

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/gustavxcodepicora%40gmail.com

This email sent to gustavxcodepic...@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


Memory Management question

2008-12-25 Thread Scott Wilson
I have an odd case. I've got a NSTextView delegate method which looks  
like this:


- (BOOL) textView: (NSTextView *) textView
clickedOnLink: (id) link
  atIndex: (unsigned) charIndex
{
...

NSURL *desiredURL;

// is it a NSURL link or a NSString link?
if ([link isKindOfClass: [NSString class]])
{
...
		desiredURL = [NSURL URLWithString: [link  
stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]  
relativeToURL: lastOpened];


} else if ([link isKindOfClass: [NSURL class]]) // this is the  
case which causes the problem!!

{
desiredURL = link; // it's a regular file:// URL

} else return NO;

	NSLog(@"url %@", [desiredURL path]); // get EXC_BAD_ACCESS if link  
was an NSURL


...
}

If I change the code above to desiredURL = [link retain] everything is  
fine. I've used very similar code with no problems in a different  
context.


Is it possible that link is being autoreleased before my method has  
returned?


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: Modal Session not stopping main thread.

2008-12-25 Thread Keary Suska


On Dec 24, 2008, at 11:40 PM, Sandro Noel wrote:


Followup.

I have also tried...

- (void) showHostPasswordWindow:(MountDefinition *) mount{

NSInteger response = [NSApp runModalForWindow:hostPasswordWindow];

[hostPasswordWindow orderOut:self];
}

But that just seems to lock up my application even when i call
[NSApp stopModal]; in my ok button.



Have you tried using -abortModal instead? There are certain  
circumstances that I have found -stopModal doesn't work properly, even  
in the method evoked by a button click. Especially if you run the run  
loop.


For truly synchronous behavior you will probably have to use - 
runModalForWindow:.


HTH,

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


Re: Cocoa Apple Script Problem

2008-12-25 Thread Matt Neuburg
On Fri, 19 Dec 2008 10:11:19 -0800, John Nairn  said:

>This does work as expected
>
> tell front document
>  make new family at end
>  tell last family
>   set properties to {husband:"@I5@"}
>  end tell
> end tell
>
>This creates the object but does NOT set the properties
>
> tell front document
>  make new family at end with properties {husband:"@I5@"}
> end tell
>

I'm pretty sure this is covered in my book and in the online tutorial:

http://www.tidbits.com/matt/scriptability/scriptabilityTutorial.html

In any case "make new pair at end with properties" does work in the tutorial
example, so one approach might be to look at what I'm doing and see how we
differ. One guess, I think you may need to implement both

  insertObject:inXXXArrayAtIndex:

and

  insertInXXXArray:

But without seeing all of your code it's hard to guess what other important
pieces of the puzzle you may be omitting. :) m.

-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: 
AppleScript: the Definitive Guide - Second Edition!




___

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: Messaging framework

2008-12-25 Thread Lorenzo Thurman
> I've heard good things about pantomime though haven't used it myself
> (and I understand it has a few gotchas related to international
> characters).

> It might also be worth looking into solutions accessible via the
> scripting bridge as my experience has been that languages such as
> Python offer more flexibility in handling network-related tasks.

Thanks, hadn't considered this. It might give me an opportunity to play
around with Python some more.
___

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: Merry Christmas

2008-12-25 Thread Luca Ciciriello

Thank you very much.A Merry Christmas to all the list members. May the 
knowledge, the meaning and the light be with you.Luca.> From: 
jote...@charter.net> To: cocoa-dev@lists.apple.com; 
xcode-us...@lists.apple.com> Date: Thu, 25 Dec 2008 07:24:54 -0500> CC: > 
Subject: Merry Christmas> > > A very Merry and Blessed! Christmas to all of you 
and your families  > and friends> > John Love> Touch the Future! Teach!> > > > 
___> > 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/luca_ciciriello%40hotmail.com> 
> This email sent to luca_cicirie...@hotmail.com
_
 Live Search presents Big Snap II - win John Lewis vouchers 
http://clk.atdmt.com/UKM/go/117442309/direct/01/___

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


Merry Christmas

2008-12-25 Thread John Love


A very Merry and Blessed! Christmas to all of you and your families  
and friends


John Love
Touch the Future! Teach!



___

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


A Problem with HUD Panel as the Main App's Window

2008-12-25 Thread Oleg Krupnov
I'm writing a small app whose main window is a HUD panel. In my XIB
file I changed the class of the Window object from NSWindow to NSPanel
and checked the HUD box that appeared.

The problem is that after the program starts, sometimes (e.g. half of
times, not always) the window disappears immediately after appearing,
and there is no way to bring it back again - clicking on the Dock icon
or pressing Alt+Tab does not help. Other times the app starts just
fine and the window is visible.

My guess is that the OS somehow thinks that the HUD window is not the
main window of the app, but a floating panel, and the OS hides it
because the main window is not active (there is no main window in its
opinion.)

Just to note that the window contains a view that wants a Core Animation layer.

What could be the problem?
___

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