Re: extent of the "scratch pad" nature of a Core Data managed object context

2010-05-10 Thread Quincey Morris
On May 9, 2010, at 23:21, Mark Sanvitale wrote:

> Now, the question.  If the pending changes within my moc includes the 
> deletion of objects and the to-be-deleted objects include a relationship 
> property with a "cascade" delete rule then should the pool of objects 
> returned by an includesPendingChanges = YES fetch include the pending, 
> directly deleted objects? What about the pending, indirectly deleted objects? 
>  It is my belief that the scratch pad nature of the moc does not extend into 
> the full reaches of pending deletions.

Let me see if I can get this right...

In Core Data, deleting an object means marking it for removal from the 
persistent store at the next save. So, includesPendingChanges == YES shouldn't 
fetch deleted objects, ever.

That really has nothing to do with the relationships, except that relationships 
may change as a side effect of the deletion. When you delete an object, it and 
other objects will (AFAIK) only get removed from in-memory relationships if the 
applicable delete rules cause that effect.

And (AFAIK) the delete rules are only applied when 'processPendingChanges' is 
invoked, which is normally at the next pass through the run loop, if nothing 
triggers it earlier (and you can of course call it yourself). In spite of the 
similarity of the method names, the "pending changes" referred to by this 
method are changes at the property level, and nothing do to (AFAIK) with the 
pending changes referred to by 'includesPendingChanges', which are at the 
object/persistent store level.

This means (AFAIK) that your in-memory relationships may contain some deleted 
objects (those not removed by delete rules) all the way up to the time the MOC 
is saved. At that point (AFAIK) they are forcibly removed from relationships, 
though I could well be wrong about that. (They may just be forcibly removed 
from the relationships as represented within the persistent store.)

It also means that fetching objects through a relationship might produce 
different results from getting objects by following relationships directly, 
depending when you do it.

Finally, just to add to the complexity, if you have a strong pointer to a 
deleted object, that in-memory instance exists as long as there is a strong 
reference to it (as long as it's retained, if you're not using GC). I believe 
that you can can expect the deleted object's properties (attributes and 
relationships) to be faulted out* (changed to nil values) at some point, though 
the timing of that behavior may be variable and an implementation detail.

All of this reflects my experience with 10.5 Core Data -- I don't know if the 
10.6 behavior is any different.


* Core Data has (AFAIK) the internal ability to "fault out" specific properties 
of an object, which is not the same thing as faulting out the object itself. 
It's a pity the property-level "faulting out" can't be accessed via API, 
because it would be useful for things like caching schemes for big-memory-use 
properties. But that's another story.


___

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: Utility/Floating window with titlebar on left side

2010-05-10 Thread Dan Ribe
Thanks Paul, that was helpful.

I am able to add the close button to my window using standardWindowButton,
but facing some refreshing problems.

First time when I load the window and add button to it, close button is able
to draw itself properly. But if i close this window and reopen it again,
then close button is not refreshing itself. When i move mouse on this button
and click it, redraw happens and it draws fine after that.

Any pointers on how this refreshing issue can be fixed?

Thanks for help.
Cheers!


On Thu, May 6, 2010 at 8:11 PM, Paul Sanders wrote:

>  > Already tried NSBorderlessWindowMask, but that doesn't supports the
> close
> > button functionality, which is required in my case.
>
> You can create a close button via +[NSWindow
> standardWindowButton:forStyleMask:]
>
> I think NSBorderlessWindowMask is the only game in town here.
>
> Paul Sanders.
>
___

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: simple CATextLayer scaling problem

2010-05-10 Thread Julian.
Have to say, that i'm new to cocoa and even newer to core animation. i have 
tried so far, bit trail&errorly: CAConstraint,  autoresizingMask, 
preferredFrameSize and googled for the problem. I know, newbie questions suck :)

lg, Julian.


Am 10.05.2010 um 04:33 schrieb Kyle Sluder:

> On May 9, 2010, at 2:44 AM, "Julian."  wrote:
> 
>> I'm having a simple scaling problem with CATextLayer, but i just couldn't 
>> figure it out:
>> I want the CATextLayer to proportionally grow in size with it's superlayer:
>> if the superlayer's width is 300 the text size of CATextLayer should be 12 
>> and if the supeview's width is 600 the text size should be 24.
>> I couldn't find a working solution!
>> 
> 
> What have you tried so far, and how has it failed you?
> 
> http://www.whathaveyoutried.com
> 
> --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: How do you set the text in an NSTextView?

2010-05-10 Thread Mark


On 10 May 2010, at 00:50:41, G S wrote:

You need to Control-drag to a region in the NSTextView that  
conceptually represents a first line of text (somewhere near the  
top) if it's empty, or to the visible text if it's not, to select  
the textView instead of the scrollView.


Yep, that's it!  Thanks.  Talk about OBSCURE.



It could be considered obscure.  Some people will find it, some won't  
I guess.  I think I found it by just moving the mouse around (it's a  
general trick to learn in IB because embedded objects often have  
certain hit targets for drag-connecting to those particular parts.  It  
can seem like a crazy mess until you figure this out).




Repeatedly clicking on it does drill down (there's only two  
classes), but again you need to click on the text region or the 'top  
line' if there's no text visible.  If you Control-Shift-click it you  
can see and select from the window's view hierarchy.


Not even Control-Shift-click will allow access to the real  
textView.  The bottom level in the pop-up list is, once again, the  
ScrollView.


You're clicking off the 'textView region' again and just hitting the  
content view of the scrollView (because the textView doesn't extend  
the full height of the scrollView's content view unless it has enough  
content to actually do so).  Try the Control-Shift-click up at the top  
and you'll see the full hierarchy.  Also try it in one of the  
scrollers, if they're visible, and you'll see an NSScroller instance  
(e.g. "Vertical Scroller").  It all makes sense if you think about how  
it's constructed.


The textView is a more obvious target if it contains some visible text  
in IB, but when empty it becomes rather small by definition, but it's  
not actually shrunk to zero height though, there's always a single  
line there to hold the caret and to give you something to click on.



___

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


Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
Hi, I am trying to override the setting of text size in my text storage 
subclass. I have overridden the setAttributes:range: method, and told the text 
to use a standard font size (keeping the other font attributes), but when I am 
editing, and use the font panel to set the font, although the correct font size 
is used, the text is moved up or down depending on the size of the font 
selected.

This seems to suggest that the font selection is doing something at the text 
view end independent of what is set in the text storage.

Can someone enlighten me as to what else I need to do to avoid this undesired 
effect? Do I need to override something in the NSTextView before it gets to the 
text storage?


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


KeyPathsForValuesAffectingValueForKey confusion

2010-05-10 Thread Trygve Inda
I have an NSArrayController containing items and a text field in a window
which is bound to a custom class "MyController" via model key path:
filteredResultsString


-(NSString *)filteredResultsString
{
return ([[NSNumber numberWithInt:[[itemsController arrangedObjects] count]]
stringValue]);
}


This works, except when the contents of the NSArrayController change it does
not update.

If I change the binding to controller key arrngedObjects model key path
@count it works perfectly, but I want to use my custom method to customize
the output in a way that a Display Pattern can't.

How do I get this to work?


___

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: KeyPathsForValuesAffectingValueForKey confusion

2010-05-10 Thread Keary Suska
On May 10, 2010, at 9:12 AM, Trygve Inda wrote:

> I have an NSArrayController containing items and a text field in a window
> which is bound to a custom class "MyController" via model key path:
> filteredResultsString
> 
> 
> -(NSString *)filteredResultsString
> {
> return ([[NSNumber numberWithInt:[[itemsController arrangedObjects] count]]
> stringValue]);
> }
> 
> 
> This works, except when the contents of the NSArrayController change it does
> not update.
> 
> If I change the binding to controller key arrngedObjects model key path
> @count it works perfectly, but I want to use my custom method to customize
> the output in a way that a Display Pattern can't.
> 
> How do I get this to work?

Maybe your keyPathsForValuesAffectingValueForKey is wrong. Can't say, since you 
don't show us what it is, nor anything else useful to help you in any way.

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


Symbolic link refresh issue in 10.5

2010-05-10 Thread Sravana Kumar
Hi all,

I am facing some weird refresh issue with Symbolic links. My application 'A'
is supposed to create/repair a shortcut in /Applications folder. This app
should be launched in elevated mode using 'AuthorizationCreate' and
launching the same process 'A' with this token (the shortcut is created in
authorized mode only).

During the execution of  process A, it launches another process 'B' (in the
elevated mode only) which creates some folders (.app) at '/Library'. Once
the process B completes .app copy, process A creates shortcuts to that
.app.
In reinstall mode, process B will backup(rename) the parent folder of .app
and create a fresh folder and copies the new .app and delete the backup
folder. Process A will remove the existing shortcut and create the new one
with the .app path as destination.

In the first time (fresh install) shortcut is proper.  In second time
(reinstalling) shortcut file says seems broken, but its a refresh problem.
If i try double clicking symbolic list a broken shortcut dialog is shown.
I checked the shortcut info thru terminal, the target looks proper.
If I forcibly relaunch the finder, the shortcut works fine.
If I lunch the actual application once and double click symbolic link then
also symbolic works fine.

This problem is occurring in 10.5.6/10.5.8 but it seems fine in 10.6.2.
Seems like a Apple Mac OS issue :-(.

I also tried to notify finder and syncronize file system for both symlink
and actual app using the following...
1) NSWorkspace's noteFileSystemChanged, and noteFileSystemChanged:
2) fsync, sync system commands.
3) LSRegisterFSRef
3) FSGetCatalogInfo method.

But it didn't helped.

I am missing any thing here ?

Thanks,
-Sra1
___

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: self = [super init], nil?

2010-05-10 Thread Thomas Wetmore
This is the initializer pattern I settled on a few years back:

- (id) init...
{
if (!(self = [super init])) return nil;
...
return self;
}

Trillions of calls later I can report upon its serviceability.

I come from an old school, formed in the mid 60's, the Savers Institute for 
Indentation Levels and Code, when Fortran on punch cards was de rigueur. My 
graduate work was done at the Bell Labs Institute of Advanced Obfuscation when 
C was cool. Both schools have since lost their raison d'être, and are sometimes 
ridiculed, but old alumni still cherish their dogmas.

Tom Wetmore, Chief Bottle Washer, DeadEnds Software

___

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: Overriding text size in NSTextStorage

2010-05-10 Thread Jens Alfke

On May 10, 2010, at 4:54 AM, Gideon King wrote:

> Hi, I am trying to override the setting of text size in my text storage 
> subclass. I have overridden the setAttributes:range: method, and told the 
> text to use a standard font size (keeping the other font attributes), but 
> when I am editing, and use the font panel to set the font, although the 
> correct font size is used, the text is moved up or down depending on the size 
> of the font selected.

That sounds like a dangerous thing to do — you’re violating the expected 
behavior of the class (i.e. what goes in is the same as what comes out.)

If you want to alter the characteristics of the text, you should do so before 
it goes into the text view, or in one of the explicit NSTextView delegate 
hooks. I’m pretty sure at least one delegate call allows you to alter the text 
(including its style) that’s about to be inserted.

—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: Problem mac os X version 10.6 when using sprinft

2010-05-10 Thread paul morel

Hi everybody,thanks a lot for your help. Actually you were right it size a 
problem of size. I increased the size and it works. The size was 20 because I 
thought that '\t'  or other thing like that were considered directly as the 
'final value', i.e. a space for example. And the value of n1 is 3.   But what 
is weird is that it seems that with Mac OS X 10.5 there is no problem, whereas 
when I use Mac OS 10.6 the problem occurs. Anyway i understand now,Thank a lot 
for you help,
Regards,Paul

> From: s...@rogue-research.com
> To: alast...@alastairs-place.net; elbomber...@hotmail.com
> CC: fri...@manoverboard.org; cocoa-dev@lists.apple.com
> Subject: Re: Problem mac os X version 10.6 when using sprinft
> Date: Fri, 7 May 2010 19:27:57 -0400
> 
> On Fri, 7 May 2010 21:50:46 +0100, Alastair Houghton said:
> 
> >On 7 May 2010, at 21:16, Sean McBride wrote:
> >
> >> Also, you should never use sprintf.  Use snprintf instead.
> >
> >snprintf() is safer, certainly, but "never" is a little strong for my
> >taste.  Like goto or longjmp(), it depends who is using it and what for.
> 
> Well, yes, there's an exception to every rule (even this one). :)
> 
> But really, sprintf is more evil than goto, especially since snprintf
> can be easily substituted.  Using sprintf is risking exploitable buffer
> overflows, a common security problem, especially if the string is user-
> input.  See also:
>  Conceptual/SecureCodingGuide/Articles/BufferOverflows.html#//apple_ref/
> doc/uid/TP40002577-SW10>
> 
> >*Anyway*, this is cocoa-dev, and that being the case, this entire
> >question is off-topic.  So to bring it back *on* topic, a better
> >alternative would be to use NSString's -stringWithFormat: method, which
> >is safer than sprintf() or snprintf(), and means you get an NSString
> >object which is a much richer type than a plain C string.  -
> >stringWithFormat: also supports pretty much the same set of specifiers
> >that printf() does, with the addition of %@, of course.
> >
> >Oh, and there's also NSNumberFormatter if you want to format numbers in
> >a more sophisticated manner.
> 
> Agreed!
> 
> -- 
> 
> Sean McBride, B. Eng s...@rogue-research.com
> Rogue Researchwww.rogue-research.com 
> Mac Software Developer  Montréal, Québec, Canada
> 
> 
  
_
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969___

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: prevent drag from QTMovieView

2010-05-10 Thread Rainer Standke
That is a very good idea, and it works, thank you. I have also tried this on 
the QTMovie:

[newMovie setDraggable:NO];

and that works too. However, there is no real telling what setting a private 
iVar will do, so I am glad you told me about a cleaner way of this.

R.

On May 8, 2010, at 13:28 , douglas welton wrote:

> did you try overriding the -mouseDragged: method in your subclass?
> 
> On May 8, 2010, at 1:15 AM, Rainer Standke wrote:
> 
>> Hello,
>> 
>> I have a Collection View whose prototype view includes a QTMovieView. I need 
>> the collection view to be a drag source, and that works fine.
>> 
>> I need the QTMovieView to not be a drag source, so I subclassed it with a 
>> method that looks like this:
>> 
>> - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal
>> {
>>  NSLog(@"nodrag");
>>  return NSDragOperationNone;
>> }
>> 
>> I can see "nodrag" logged when I start dragging from the movie view, and 
>> then a dragging image peels off, which is what I don't want.
>> 
>> For good measure I have turned off 'Editable' for the view in IB , and I am 
>> setting the movie to be not editable when I initialize it, to no avail.
>> 
>> I have done the same for the prototype view that includes the movie view, to 
>> no avail, either.
>> 
>> Any ideas about this one?
>> 
>> As always, thanks!
>> 
>> Rainer___
> 

___

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: Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
From a practical point of view, I haven't found a delegate method that allows 
you to alter the proposed attributes. The closest one is one that acts on 
proposed typing attributes, and I assume that could change with moving the 
insertion point, as well as when changing attributes, and would presumably be 
too late in the piece anyway.

From a conceptual point of view, my understanding of MVC means that a user 
initiated action should be reflected in the model (text storage), which should 
push it through to the view, which should mean that doing the changes in the 
text storage "should" be OK...and it works for everything except this case. The 
behavior I'm observing seems to clearly be a case of the view being out of sync 
with the text storage, until you type something, and then it syncs up again.

But anyway, I'm not here to argue what should or should not be the case - the 
fact is that there is an issue, and at this stage, I'm just looking for a 
solution...

Gideon

> 
> That sounds like a dangerous thing to do — you’re violating the expected 
> behavior of the class (i.e. what goes in is the same as what comes out.)
> 
> If you want to alter the characteristics of the text, you should do so before 
> it goes into the text view, or in one of the explicit NSTextView delegate 
> hooks. I’m pretty sure at least one delegate call allows you to alter the 
> text (including its style) that’s about to be inserted.
> 
> —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: KeyPathsForValuesAffectingValueForKey confusion

2010-05-10 Thread Trygve Inda
> On May 10, 2010, at 9:12 AM, Trygve Inda wrote:
> 
>> I have an NSArrayController containing items and a text field in a window
>> which is bound to a custom class "MyController" via model key path:
>> filteredResultsString
>> 
>> 
>> -(NSString *)filteredResultsString
>> {
>> return ([[NSNumber numberWithInt:[[itemsController arrangedObjects] count]]
>> stringValue]);
>> }
>> 
>> 
>> This works, except when the contents of the NSArrayController change it does
>> not update.
>> 
>> If I change the binding to controller key arrngedObjects model key path
>> @count it works perfectly, but I want to use my custom method to customize
>> the output in a way that a Display Pattern can't.
>> 
>> How do I get this to work?
> 
> Maybe your keyPathsForValuesAffectingValueForKey is wrong. Can't say, since
> you don't show us what it is, nor anything else useful to help you in any way.
> 
> Keary Suska
> Esoteritech, Inc.
> "Demystifying technology for your home or business"
> 

The key is question is/was: filteredResultsString

I moved things around to instead use:

[self addObserver:self forKeyPath:@"itemsController.arrangedObjects.count"
options:NSKeyValueObservingOptionNew context:NULL];

and

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary *)change context:(void *)context
{
// set the NSTextField
}

This seems to work fine.


___

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

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

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

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


Re: Problem mac os X version 10.6 when using sprinft

2010-05-10 Thread Jens Alfke

On May 10, 2010, at 8:54 AM, paul morel wrote:

> But what is weird is that it seems that with Mac OS X 10.5 there is no 
> problem, whereas when I use Mac OS 10.6 the problem occurs.

Buffer overflows can be sneaky. The effect depends on exactly how variables are 
laid out in the stack (or if it’s an allocated block, on the exact pattern of 
allocations so far.) Minor changes in the compiler or linker can change such a 
bug from being invisible to being a crasher. So on 10.5 you got lucky and there 
was no immediate manifestation; on 10.6 you didn’t.

That’s just one reason why such bugs are rightly feared. It’s well worth it to 
avoid calls like sprintf whenever possible, as people have already suggested. 
Either use the variants that take the buffer size as a parameter, like 
snprintf, or use a higher-level Cocoa API that works with safer collections 
like NSStrings that have range checking.

—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: Overriding text size in NSTextStorage

2010-05-10 Thread Jens Alfke

On May 10, 2010, at 9:19 AM, Gideon King wrote:

> From a conceptual point of view, my understanding of MVC means that a user 
> initiated action should be reflected in the model (text storage), which 
> should push it through to the view, which should mean that doing the changes 
> in the text storage "should" be OK…

The NSLayoutManager and associated classes are part of the model too. I think 
what’s happening is that those objects are seeing the text before it goes into 
your TextStorage, and interpreting the original attributes; while later on they 
pull the text out and see the altered attributes.

> The behavior I'm observing seems to clearly be a case of the view being out 
> of sync with the text storage, until you type something, and then it syncs up 
> again.

It’s the layout that’s out of sync, sounds like. The layout is part of the 
model and can be shared by multiple views.

—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: Problem mac os X version 10.6 when using sprinft

2010-05-10 Thread Alastair Houghton
On 10 May 2010, at 16:54, paul morel wrote:

> Hi everybody,
> thanks a lot for your help. 
> Actually you were right it size a problem of size. I increased the size and 
> it works.

See, that worries me.

> The size was 20 because I thought that '\t'  or other thing like that were 
> considered directly as the 'final value', i.e. a space for example. And the 
> value of n1 is 3.   
> But what is weird is that it seems that with Mac OS X 10.5 there is no 
> problem, whereas when I use Mac OS 10.6 the problem occurs. 
> Anyway i understand now,

Well, do you?  Increasing the size is only the right fix if you really 
understand what the size should be and why.  Using snprintf() doesn't always 
save you because it might truncate the result, which may or may not cause other 
problems (though at least you won't have a buffer overflow).

I'd use NSString if I were you---it's safer.

Kind regards,

Alastair.

-- 
http://alastairs-place.net



___

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

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

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

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


Re: Overriding text size in NSTextStorage

2010-05-10 Thread Kyle Sluder
On Mon, May 10, 2010 at 9:19 AM, Gideon King  wrote:
> From a practical point of view, I haven't found a delegate method that allows 
> you to alter the proposed attributes. The closest one is one that acts on 
> proposed typing attributes, and I assume that could change with moving the 
> insertion point, as well as when changing attributes, and would presumably be 
> too late in the piece anyway.

You want to implement -textStorageWillProcessEditing: in your text
storage delegate.

http://developer.apple.com/mac/library/documentation/cocoa/reference/NSTextStorageDelegate_Protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40008627-CH1-DontLinkElementID_2

--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: Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
Yeah, I thought that too, and tried calling glyphRangeForTextContainer: which 
is apparently supposed to force a re-layout, and also 
textContainerChangedGeometry: which I have used successfully in the past to get 
around some similar layout issues. Neither worked.

Regards

Gideon


> It’s the layout that’s out of sync, sounds like. The layout is part of the 
> model and can be shared by multiple views.
> 
> —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: Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
OK, tried that. I couldn't do anything there that would force glyph generation 
or layout because it is between a begin and end editing.
On 11/05/2010, at 3:16 AM, Kyle Sluder wrote:

> 
> You want to implement -textStorageWillProcessEditing: in your text
> storage delegate.

___

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: self = [super init], nil?

2010-05-10 Thread Thomas Davie
On 10 May 2010, at 16:49, Thomas Wetmore wrote:

> This is the initializer pattern I settled on a few years back:
> 
> - (id) init...
> {
>if (!(self = [super init])) return nil;
>...
>return self;
> }
> 
> Trillions of calls later I can report upon its serviceability.
> 
> I come from an old school, formed in the mid 60's, the Savers Institute for 
> Indentation Levels and Code, when Fortran on punch cards was de rigueur. My 
> graduate work was done at the Bell Labs Institute of Advanced Obfuscation 
> when C was cool. Both schools have since lost their raison d'être, and are 
> sometimes ridiculed, but old alumni still cherish their dogmas.

Just to add to the heap of style opinions...

I personally really dislike this one, for two reasons:
1) I hate that in C a statement can be an expression, it's not immediately 
clear when and how it'll be executed, and it's not immediately clear that your 
if statement might have a side effect.  Keeping if statements free of side 
effects is good.
2) While using a pointer in a comparison is not a type error in C, it certainly 
is in my brain – pointers and booleans are not the same thing.

Because of those two reasons I use:

- (id)init
{
  self = [super init];
  
  if (nil != self)
  {
...
  }
  
  return self;
}

Bob___

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: Overriding text size in NSTextStorage

2010-05-10 Thread Kyle Sluder
On Mon, May 10, 2010 at 11:07 AM, Gideon King  wrote:
> OK, tried that. I couldn't do anything there that would force glyph 
> generation or layout because it is between a begin and end editing.

Okay... why would you want to force glyph generation or layout? That
notification is your opportunity to replace the attributes being
applied to the run of text.

--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: self = [super init], nil?

2010-05-10 Thread Uli Kusterer
On May 10, 2010, at 8:19 PM, Thomas Davie wrote:
> I personally really dislike this one, for two reasons:

 Third reason: It gives the method multiple points of return, which is a tiny 
bit dangerous if you're allocating/releasing resources.

-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."



___

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: self = [super init], nil?

2010-05-10 Thread Sean McBride
On Mon, 10 May 2010 21:00:40 +0200, Uli Kusterer said:

>> I personally really dislike this one, for two reasons:
>
> Third reason: It gives the method multiple points of return, which is a
>tiny bit dangerous if you're allocating/releasing resources.

Fourth reason: it doesn't play well with code coverage.  If the 'if' and
its body are on the same line then knowing that that line executed does
not tell you as much as it could if the body was on its own line.

--

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


___

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

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

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

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


Interface Builder Plugin, IBInspector: Getting Auto Complete for Image Names

2010-05-10 Thread aaron smith
Yo, quick question.

I've got an IB plugin, one of the inspectors has a combo box. I'd like
it to behave like how the NSImageView inspector combo works. It gives
you a drop down of available images. Is there something I can bind the
combo box to in "inspectedObjectsController"?

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


iPad UIViewController craziness

2010-05-10 Thread banane
I'm porting an iPhone app to the iPad, and am having issues getting my
view to appear. I have a sample app I've created, and done nothing to
(except change background color). BTW I can do this many different
ways in iPhone, it's just issues in the iPad I'm having.

I brought the XIB and Classes from the sample app into the ported app
and I can't get that view to display either.

Everything looks kosher in IB:
(MainWindow)
- File owner is UIApp
- App delegate points to app delegate
- view controller load the right XIB and points to the app delegate
(this is all matched to the sample app, that works).
(ViewController)
view points to file owner
file owner shows view->view
(again, this same view controller works in sample app as is)

In the code, the classes all build with out warnings or errors, and
look like the sample app.

But for some reason this isn't displaying on the iPad.  the ported app
is also built from a sample app, with methods copied in (vs. trying to
jerryrig an iPhone app).

Are there any tips or warnings from folks who have successfully built
or ported apps to iPad? I've built a simple iPad app before, but was
starting from scratch not trying to move existing logic or objects
over.

I've googled it but haven't found anything re: iPad specific
viewControllers, etc. Oh, and this isn't a split view, just a simple
view controller.

Thanks
Anna
___

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: iPad UIViewController craziness

2010-05-10 Thread Luke the Hiesterman
For problems like this, you should post a sample project. Otherwise, it's just 
a guessing game as to what might be missing.

Luke

On May 10, 2010, at 1:10 PM, banane wrote:

> I'm porting an iPhone app to the iPad, and am having issues getting my
> view to appear. I have a sample app I've created, and done nothing to
> (except change background color). BTW I can do this many different
> ways in iPhone, it's just issues in the iPad I'm having.
> 
> I brought the XIB and Classes from the sample app into the ported app
> and I can't get that view to display either.
> 
> Everything looks kosher in IB:
> (MainWindow)
> - File owner is UIApp
> - App delegate points to app delegate
> - view controller load the right XIB and points to the app delegate
> (this is all matched to the sample app, that works).
> (ViewController)
> view points to file owner
> file owner shows view->view
> (again, this same view controller works in sample app as is)
> 
> In the code, the classes all build with out warnings or errors, and
> look like the sample app.
> 
> But for some reason this isn't displaying on the iPad.  the ported app
> is also built from a sample app, with methods copied in (vs. trying to
> jerryrig an iPhone app).
> 
> Are there any tips or warnings from folks who have successfully built
> or ported apps to iPad? I've built a simple iPad app before, but was
> starting from scratch not trying to move existing logic or objects
> over.
> 
> I've googled it but haven't found anything re: iPad specific
> viewControllers, etc. Oh, and this isn't a split view, just a simple
> view controller.
> 
> Thanks
> Anna
> ___
> 
> 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/luketheh%40apple.com
> 
> This email sent to luket...@apple.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: self = [super init], nil?

2010-05-10 Thread Henry McGilton

On May 9, 2010, at 7:56 PM, Scott Anguish wrote:

> This has been, or is being updated.
> 
> The suggested pattern is now
> 
> - (id)init 
> {
>  self = [super init];
>  if (self)
>  {
> 
>  }
>  return self;
> }
> 
> All our documentation has been updated to reflect this (even if it hasn’t 
> necessarily made it out to the users yet)


Hi Scott.  Is there any rationale for the change?  Or just Evolution In Action?

By the way, I concur with Thomas Davie: treating a pointer as a Boolean makes 
me nervous.

Cheers,
. . . . . . . . .Henry

___

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: self = [super init], nil?

2010-05-10 Thread David Duncan
On May 10, 2010, at 1:18 PM, Henry McGilton wrote:

> Hi Scott.  Is there any rationale for the change?  Or just Evolution In 
> Action?

I would imagine the biggest reason for the change is that if(self = [super 
init]) causes a warning for some project settings.

> By the way, I concur with Thomas Davie: treating a pointer as a Boolean makes 
> me nervous.


I don't see any reason not to make the comparison explicit if you desire. I do 
it all the time :).
--
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


How to setup idle timer in 64-bit 10.6?

2010-05-10 Thread Marc Respass
Hi All,

My application has a requirement that it "locks out" the user after X minutes 
of inactivity. I was using Uli Kusterer's excellent UKIdleTimer in my 
application and it worked great. Then I upgraded to 64-bit and it does not work 
any more. Does anyone have a good replacement or is my best bet to just go back 
to 32 bit? There are some new 10.6 event methods that I tried but they are more 
the opposite of an idle timer. It lets me handle all kinds of events but not 
"no event." I couldn't get that work well for me. If anyone has a 
recommendation, I would really appreciate it.

Thanks a lot
Marc
___

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: self = [super init], nil?

2010-05-10 Thread Todd Heberlein

On May 10, 2010, at 1:24 PM, David Duncan wrote:

>> By the way, I concur with Thomas Davie: treating a pointer as a Boolean 
>> makes me nervous.
> 
> I don't see any reason not to make the comparison explicit if you desire. I 
> do it all the time :).

This has been part of C since the beginning -- 0 or NULL is false, anything 
else is true. However, I always like to make the comparison explicit to improve 
readability. The only problem is that from time to time I enter a single = 
instead of a double ==, so it does ever so slightly increase the risk of a bug.

Todd

___

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: self = [super init], nil?

2010-05-10 Thread Fritz Anderson
On 10 May 2010, at 3:18 PM, Henry McGilton wrote:

> By the way, I concur with Thomas Davie: treating a pointer as a Boolean makes 
> me nervous.

It shouldn't. Until recently, there was no such thing as a Boolean in C; there 
was only the distinction between zero and nonzero. NULL-is-zero-is-false 
(semantically) is as ironclad an invariant of the language as the if statement. 
People should be able to read idiomatic C without needing Purell.

— 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: self = [super init], nil?

2010-05-10 Thread Thomas Wetmore
Being nervous about applying the ! operator to a pointer is needless. It has 
always been well defined. From the C specification:

"The operand of the ! operator must have arithmetic type or be a pointer, and 
the result is 1 if the value of its operand compares equal to 0, and 0 
otherwise. The type of the result is int."

The concept of Boolean isn't even mentioned here, as it is really just a 
fiction anyway. Know thy language.

>> By the way, I concur with Thomas Davie: treating a pointer as a Boolean 
>> makes me nervous.

Tom Wetmore

___

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


Finder refresh issue in Mac OS 10.5

2010-05-10 Thread Sachin Porwal
Hi,

I am facing some Symbolic link refresh issues in my application. My
application 'A' is supposed to create/repair a shortcut created in
/Applications folder. This app should be launched in elevated mode so i am
using 'AuthorizationCreate' to create elevated token and launching the same
process 'A' with this token (the shortcut is created in authorized mode
only).

During the execution of  process A, it another process 'B' is launched
(elevated mode) which creates some folders/.app at '/Library'. Once the
process B completes, process A creates shortcuts to the .app created by
process B. In repair mode, process B will backup(rename) the existing
folder/.app and create a fresh folder/.app & delete the backupfolder, then
process A will remove the existing shortcut and create the new one with the
.app path as destination.

If the application runs first time, it is fine and the shortcut is
appropriate. The refresh problem occurs in repair mode. If i try double
clicking post repair, a broken shortcut dialog is shown. I tried checking
the shortcut thru terminal, the target looks good & exist. If i forcibly
relaunch the finder, the shortcut works fine.

I also tried using noteFileSystemChanged after creating the shortcut :

[[NSWorkspace sharedWorkspace] noteFileSystemChanged]
[[NSWorkspace sharedWorkspace] noteFileSystemChanged:]
[[NSWorkspace sharedWorkspace] noteFileSystemChanged:]

But it didn't helped. This problem is occurring in 10.5.6/10.5.8 but it
seems fine in 10.6.2. Seems like a Apple Mac OS issue :-(.
Could somebody please help me.

Thanks,
Sachin
___

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


CCHmacInit - key?

2010-05-10 Thread Patrick M. Rutkowski
I'm really not getting what the "key" argument to CCHmacInit() is
supposed to be. I'm trying to implement oauth linked-in integration,
and linked-in has given me a "secret key" which looks something like:

Yj1-6OZZBInu-xiaBVX7RjAOTVSCFS9_3lmTtvto

(The "" bits are _purely_ just strings of upper or lower
case ASCII letters, which I ripped out because they key is supposed to
be a secret).

Am I just supposed to pass this string (encoded as ASCII) to CCHmacInit?

It sure doesn't look like base-64, since base-64 (as I know it)
doesn't have the chars "-" or "_".

I'm really confused here.

-Patrick
___

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: iPad UIViewController craziness

2010-05-10 Thread Rafael Cerioli
If you can't see the view, I'd say that the NIB file might not be loaded 
properly. You should check if your current target points toward the info.plist 
file you expect (project, edit active target, build tab, check Info.plist 
file), and then check that your info.plist  mentions the right NIB (key 
"NSMainNibFile").

Le 10 mai 2010 à 16:13, Luke the Hiesterman a écrit :

> For problems like this, you should post a sample project. Otherwise, it's 
> just a guessing game as to what might be missing.
> 
> Luke
> 
> On May 10, 2010, at 1:10 PM, banane wrote:
> 
>> I'm porting an iPhone app to the iPad, and am having issues getting my
>> view to appear. I have a sample app I've created, and done nothing to
>> (except change background color). BTW I can do this many different
>> ways in iPhone, it's just issues in the iPad I'm having.
>> 
>> I brought the XIB and Classes from the sample app into the ported app
>> and I can't get that view to display either.
>> 
>> Everything looks kosher in IB:
>> (MainWindow)
>> - File owner is UIApp
>> - App delegate points to app delegate
>> - view controller load the right XIB and points to the app delegate
>> (this is all matched to the sample app, that works).
>> (ViewController)
>> view points to file owner
>> file owner shows view->view
>> (again, this same view controller works in sample app as is)
>> 
>> In the code, the classes all build with out warnings or errors, and
>> look like the sample app.
>> 
>> But for some reason this isn't displaying on the iPad.  the ported app
>> is also built from a sample app, with methods copied in (vs. trying to
>> jerryrig an iPhone app).
>> 
>> Are there any tips or warnings from folks who have successfully built
>> or ported apps to iPad? I've built a simple iPad app before, but was
>> starting from scratch not trying to move existing logic or objects
>> over.
>> 
>> I've googled it but haven't found anything re: iPad specific
>> viewControllers, etc. Oh, and this isn't a split view, just a simple
>> view controller.
>> 
>> Thanks
>> Anna
>> ___
>> 
>> 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/luketheh%40apple.com
>> 
>> This email sent to luket...@apple.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/rafael.cerioli%40gmail.com
> 
> This email sent to rafael.ceri...@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: Finder refresh issue in Mac OS 10.5

2010-05-10 Thread Kyle Sluder
Someone posting under the name "Sravana Kumar" posted this exact
question a few hours ago.

This is incredibly rude. Sock puppeting the mailing list to solve your
personal problems faster is quite a low maneuver.

--Kyle Sluder

On Mon, May 10, 2010 at 7:36 AM, Sachin Porwal  wrote:
> Hi,
>
> I am facing some Symbolic link refresh issues in my application. My
> application 'A' is supposed to create/repair a shortcut created in
> /Applications folder. This app should be launched in elevated mode so i am
> using 'AuthorizationCreate' to create elevated token and launching the same
> process 'A' with this token (the shortcut is created in authorized mode
> only).
>
> During the execution of  process A, it another process 'B' is launched
> (elevated mode) which creates some folders/.app at '/Library'. Once the
> process B completes, process A creates shortcuts to the .app created by
> process B. In repair mode, process B will backup(rename) the existing
> folder/.app and create a fresh folder/.app & delete the backupfolder, then
> process A will remove the existing shortcut and create the new one with the
> .app path as destination.
>
> If the application runs first time, it is fine and the shortcut is
> appropriate. The refresh problem occurs in repair mode. If i try double
> clicking post repair, a broken shortcut dialog is shown. I tried checking
> the shortcut thru terminal, the target looks good & exist. If i forcibly
> relaunch the finder, the shortcut works fine.
>
> I also tried using noteFileSystemChanged after creating the shortcut :
>
> [[NSWorkspace sharedWorkspace] noteFileSystemChanged]
> [[NSWorkspace sharedWorkspace] noteFileSystemChanged:]
> [[NSWorkspace sharedWorkspace] noteFileSystemChanged:]
>
> But it didn't helped. This problem is occurring in 10.5.6/10.5.8 but it
> seems fine in 10.6.2. Seems like a Apple Mac OS issue :-(.
> Could somebody please help me.
>
> Thanks,
> Sachin
> ___
>
> 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/kyle.sluder%40gmail.com
>
> This email sent to kyle.slu...@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: CCHmacInit - key?

2010-05-10 Thread Sixten Otto
On Mon, May 10, 2010 at 12:28 PM, Patrick M. Rutkowski
 wrote:
> I'm really not getting what the "key" argument to CCHmacInit() is
> supposed to be. I'm trying to implement oauth linked-in integration,

Not really an answer to your question, but are you trying to implement
OAuth from scratch? Is there a reason why you'd choose to do that over
known-working code like http://code.google.com/p/oauth/ ?

For that matter, if it's LinkedIn you're after, might I humbly suggest
http://github.com/ResultsDirect/LinkedIn-iPhone ? (It's not a whole
solution yet, but should save you some time getting started. And the
engine part shouldn't be iPhone-dependent.)

Sixten
___

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: CCHmacInit - key?

2010-05-10 Thread Patrick M. Rutkowski
Eh, my rule of thumb is that if I can get it done in less than 48
hours, it's not worth pulling in a 3rd party library. Which does error
handling different, might have to be hacked around in different ways,
and generally just feels ugly.

If Linked-in doc page ( http://developer.linkedin.com/docs/DOC-1008 )
didn't leave out critical pieces of information like

(1) The sample consumer_secret that was used
(2) The format of the consumer_secret which was used to begin with

then I would have had this done a few hours ago I'd bet.

Whoever is supposed to manage that doc page at Linked-In is a total
slacker. People below in the comments are begging for the above points
(1) and (2) to be answered, but nobody has responded in weeks.

I'll take a look at that project for some sample code though, thanks :-)

On Mon, May 10, 2010 at 5:19 PM, Sixten Otto  wrote:
> On Mon, May 10, 2010 at 12:28 PM, Patrick M. Rutkowski
>  wrote:
>> I'm really not getting what the "key" argument to CCHmacInit() is
>> supposed to be. I'm trying to implement oauth linked-in integration,
>
> Not really an answer to your question, but are you trying to implement
> OAuth from scratch? Is there a reason why you'd choose to do that over
> known-working code like http://code.google.com/p/oauth/ ?
>
> For that matter, if it's LinkedIn you're after, might I humbly suggest
> http://github.com/ResultsDirect/LinkedIn-iPhone ? (It's not a whole
> solution yet, but should save you some time getting started. And the
> engine part shouldn't be iPhone-dependent.)
>
> Sixten
>
___

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: CCHmacInit - key?

2010-05-10 Thread Kyle Sluder
On Mon, May 10, 2010 at 2:26 PM, Patrick M. Rutkowski
 wrote:
> Eh, my rule of thumb is that if I can get it done in less than 48
> hours, it's not worth pulling in a 3rd party library. Which does error
> handling different, might have to be hacked around in different ways,
> and generally just feels ugly.

For anything that involves authentication or encryption, this is a
terrible, horrible, no good, very bad idea.

This is a very good parable to keep in mind:
http://chargen.matasano.com/chargen/2009/7/22/if-youre-typing-the-letters-a-e-s-into-your-code-youre-doing.html

--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: How to setup idle timer in 64-bit 10.6?

2010-05-10 Thread Jean-Daniel Dupas

Le 10 mai 2010 à 22:26, Marc Respass a écrit :

> Hi All,
> 
> My application has a requirement that it "locks out" the user after X minutes 
> of inactivity. I was using Uli Kusterer's excellent UKIdleTimer in my 
> application and it worked great. Then I upgraded to 64-bit and it does not 
> work any more. Does anyone have a good replacement or is my best bet to just 
> go back to 32 bit? There are some new 10.6 event methods that I tried but 
> they are more the opposite of an idle timer. It lets me handle all kinds of 
> events but not "no event." I couldn't get that work well for me. If anyone 
> has a recommendation, I would really appreciate it.

If it let you handle all kind of events, you can easily implement an idle 
timer. Create a timer, and each time you get an event, reset it and reschedule 
it. When the timer triggers, it means that you don't get any events for X 
minutes.

If I had to do something like that, I think I would create an NSApplication 
sublass which overrides -sendEvent: to reset the timer.

> Thanks a lot
> Marc

-- Jean-Daniel




___

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: self = [super init], nil?

2010-05-10 Thread Jean-Daniel Dupas

Le 10 mai 2010 à 22:24, David Duncan a écrit :

> On May 10, 2010, at 1:18 PM, Henry McGilton wrote:
> 
>> Hi Scott.  Is there any rationale for the change?  Or just Evolution In 
>> Action?
> 
> I would imagine the biggest reason for the change is that if(self = [super 
> init]) causes a warning for some project settings.
> 

Fortunately for people who like this old syntax, clang is smart enough to know 
the "if (self = [super initXXX])" is an usual construct and to not emit warning 
in this case when -Wparentheses is used :-)


-- Jean-Daniel




___

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: Overriding text size in NSTextStorage

2010-05-10 Thread Paul Sanders
> OK, tried that. I couldn't do anything there that would force glyph 
> generation or layout because it is between a begin and end editing.


I was able to achieve something similar to what you are trying to do by 
overriding [NSTextView didChangeText].  At that point, I am able to change the 
text in the view before calling super, but make sure that you test that you are 
not in an undo otherwise bad things will happen if you monkey with the text.

To know what range of text has been most recently changed, I stash this in an 
iVar in shouldChangeTextInRange:affectedCharRange:replacementString:  It ain't 
pretty, and there's probably some detail to work out, but it works for me.

Paul Sanders.
___

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


32/64-bit transition and memory expansion

2010-05-10 Thread Ben
I have been adapting an existing app to compile as a 32/64-bit universal, using 
the Apple doc "64-Bit Transition Guide for Cocoa".

All has been well and good until I got to the section on optimising memory 
performance. A quick look at Activity Monitor reports my app as using 26MB real 
memory (rsize) under 32-bit and 42MB running as 64-bit. 

Running Instruments with ObjectAlloc reports a peak memory usage of the above 
values, dropping to around 2-5MB when idle.

Questions: 
- Is Activity Monitor likely just reporting this high tide value?
- Is the increase in memory usage (of about 50%) normal?
- Either way, should I be concerned?

Lastly:
- HeapDiff reports the worst offender for memory expansion between 32/64-bit 
processes as NSCFDictionary. Instruments suggests it is CFBasicHash. Is 
CFBasicHash part of the internals for NSCFDictionary? Google doesn't have much 
info on this.


Thanks for any light shed on this

- Ben___

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 setup idle timer in 64-bit 10.6?

2010-05-10 Thread Paul Sanders
> My application has a requirement that it "locks out" the user after X minutes 
> of inactivity. 

I would override [NSApplication sendEvent:] and watch for mouse, keyboard and 
gesture events.  In addition, have a timer running which can check periodically 
when the last such was received.  Then you will know when to take action.

Paul Sanders.
___

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


Where to find?

2010-05-10 Thread ML

Can anyone point me in a direction of the proper way to find a users home 
directory and where to find where applications are installed or can I always 
assume /Applications?

Thank You,

-ML
___

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: CCHmacInit - key?

2010-05-10 Thread BJ Homer
That is terrifying.

I really wish the images worked in that link. Anyone know where you can find
them?

-BJ

On Mon, May 10, 2010 at 3:31 PM, Kyle Sluder  wrote:

> On Mon, May 10, 2010 at 2:26 PM, Patrick M. Rutkowski
>  wrote:
> > Eh, my rule of thumb is that if I can get it done in less than 48
> > hours, it's not worth pulling in a 3rd party library. Which does error
> > handling different, might have to be hacked around in different ways,
> > and generally just feels ugly.
>
> For anything that involves authentication or encryption, this is a
> terrible, horrible, no good, very bad idea.
>
> This is a very good parable to keep in mind:
>
> http://chargen.matasano.com/chargen/2009/7/22/if-youre-typing-the-letters-a-e-s-into-your-code-youre-doing.html
>
> --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/bjhomer%40gmail.com
>
> This email sent to bjho...@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: Where to find?

2010-05-10 Thread Kyle Sluder
On Mon, May 10, 2010 at 2:59 PM, ML  wrote:
>
> Can anyone point me in a direction of the proper way to find a users home 
> directory and where to find where applications are installed or can I always 
> assume /Applications?

http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/LowLevelFileMgmt/Articles/StandardDirectories.html#//apple_ref/doc/uid/20001279

--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: Where to find?

2010-05-10 Thread Joshua Tidsbury
I'd suggest that you look up NSHomeDirectory and NSHomeDirectoryForUser in the 
documentation.

And I'm afraid it's never safe to assume anything... especially given that 
users will often do such things as eternally run an application from the 
downloaded DMG, and wonder why launching takes a few moments as the computer 
unpacks the DMG every time they start the app from the dock...

Josh


Joshua Tidsbury | Systems Specialist, Creative Technology Systems
t 416.384.7253 | m 416.433.3968 | joshua.tidsb...@ctv.ca


On 2010-05-10, at 5:59 PM, ML wrote:

> 
> Can anyone point me in a direction of the proper way to find a users home 
> directory and where to find where applications are installed or can I always 
> assume /Applications?
> 
> Thank You,
> 
> -ML
> ___
> 
> 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/joshua.tidsbury%40ctv.ca
> 
> This email sent to joshua.tidsb...@ctv.ca
> 

___

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: Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
Oh I tried that too, but it made no difference, so was looking to find 
something that would force the layout. Considering the symptoms, I think that 
the update to the position of the text is happening in the text view is 
happening before it gets anywhere near the back end, and nothing I am doing in 
the text storage or layout manager is having any effect on the positioning of 
the text in the view, even though it is correctly updating the font size.
 
Regards

Gideon

On 11/05/2010, at 4:21 AM, Kyle Sluder wrote:

> On Mon, May 10, 2010 at 11:07 AM, Gideon King  wrote:
>> OK, tried that. I couldn't do anything there that would force glyph 
>> generation or layout because it is between a begin and end editing.
> 
> Okay... why would you want to force glyph generation or layout? That
> notification is your opportunity to replace the attributes being
> applied to the run of text.
> 
> --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: Where to find?

2010-05-10 Thread Uli Kusterer
On 10.05.2010, at 23:59, ML wrote:
> Can anyone point me in a direction of the proper way to find a users home 
> directory

 Look at NSHomeDirectory() or NSHomeDirectoryForUser() ?

> and where to find where applications are installed or can I always assume 
> /Applications?

 There is no place "where applications are installed" on the Mac. An 
application can be anywhere a user decides to put them. On the desktop, on a 
server, on a disk image. What would you use this information for? Why would you 
even care?

 If you are trying to find out whether a particular application is installed, 
ask Launch Services for an application with the same bundle ID. If you want to 
find what application is responsible for a certain type of file, Launch 
Services can also tell you that (or if you just want to launch a file with the 
right application, use NSWorkspace).

 If you want a list of all applications on a Mac, you may have to go through 
Spotlight. But that takes time, CPU, and as such is generally not what you want 
to do.

 If you tell us more precisely what you are trying to achieve, as a high-level 
task, we might be able to make a better suggestion.

-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.masters-of-the-void.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: 32/64-bit transition and memory expansion

2010-05-10 Thread Nick Zitzmann

On May 10, 2010, at 3:45 PM, Ben wrote:

> - Is Activity Monitor likely just reporting this high tide value?

Yes.

> - Is the increase in memory usage (of about 50%) normal?

Yes. Remember, long integers and pointer variables are now twice as large in 
64-bit apps. And common Cocoa integer types like CFIndex and NSInteger are 
typedefs for long integers.

> - Either way, should I be concerned?

Two years ago I would have said yes, because when we published our first 64-bit 
program around that time, we had several users write in and tell us they 
thought the app was using too much memory. 64-bit apps were really rare back 
then, and people weren't used to seeing them, so we obliged and went back to 
32-bit. But now, 64-bit apps are far more common than they were back then, and 
a lot of the bugs in Leopard's 64-bit frameworks were fixed in Snow Leopard, so 
now I wouldn't hold back. There is more to the transition than having a higher 
VM ceiling, e.g. 64-bit apps will run faster than 32-bit apps on Intel CPUs due 
to improvements in the ABI.

> Lastly:
> - HeapDiff reports the worst offender for memory expansion between 32/64-bit 
> processes as NSCFDictionary. Instruments suggests it is CFBasicHash. Is 
> CFBasicHash part of the internals for NSCFDictionary? Google doesn't have 
> much info on this.

I think so. A lot of Foundation objects are actually class clusters, and 
NSDictionary is one of them.

Nick Zitzmann


___

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

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

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

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


Re: Where to find?

2010-05-10 Thread ML

Hi Guys,

>> Can anyone point me in a direction of the proper way to find a users home 
>> directory

> Look at NSHomeDirectory() or NSHomeDirectoryForUser() ?

Oh, I am using currentUserHomeDirectory = NSHomeDirectoryForUser(NSUserName());
but I was told that this was not proper to be used anymore by another developer.

>> and where to find where applications are installed or can I always assume 
>> /Applications?

>There is no place "where applications are installed" on the Mac. An 
>application can be anywhere a user decides >to put them. On the desktop, on a 
>server, on a disk image. What would you use this information for? Why would 
>>you even care?

Ah, well, What I am trying to do is ensure what version and what application of 
ours they are running. Our app is a plugin and it can be put in a few locations 
and I want to know. I *can* always check the paths manually and decide, but 
yes, perhaps LaunchServices would be best.

Kyle, thank you for the link as well.

-ML
___

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: Where to find?

2010-05-10 Thread Uli Kusterer
On 11.05.2010, at 00:15, ML wrote:
> Ah, well, What I am trying to do is ensure what version and what application 
> of ours they are running. Our app is a plugin and it can be put in a few 
> locations and I want to know. I *can* always check the paths manually and 
> decide, but yes, perhaps LaunchServices would be best.

 If your application is a plug-in, it is probably a bundle. In that case 
NSBundle can be used to give you the path to your file. Or if you want the path 
to your host application, you can ask NSBundle for the mainBundle.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://groups.yahoo.com/group/mac-gui-dev/

___

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: Where to find?

2010-05-10 Thread ML

Uli,

On 11.05.2010, at 00:15, ML wrote:
>> Ah, well, What I am trying to do is ensure what version and what application 
>> of ours they are running. Our app >>is a plugin and it can be put in a few 
>> locations and I want to know. I *can* always check the paths manually >>and 
>> decide, but yes, perhaps LaunchServices would be best.

>If your application is a plug-in, it is probably a bundle. In that case 
>NSBundle can be used to give you the >path to your file. Or if you want the 
>path to your host application, you can ask NSBundle for the mainBundle.

Indeed it is a bundle.

Thanks for the reference on NSBundle. I think that should work for me.

-ML
___

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: 32/64-bit transition and memory expansion

2010-05-10 Thread Greg Parker
On May 10, 2010, at 3:13 PM, Nick Zitzmann wrote:
> On May 10, 2010, at 3:45 PM, Ben wrote:
>> - Either way, should I be concerned?
> 
> Two years ago I would have said yes, because when we published our first 
> 64-bit program around that time, we had several users write in and tell us 
> they thought the app was using too much memory. 64-bit apps were really rare 
> back then, and people weren't used to seeing them, so we obliged and went 
> back to 32-bit. But now, 64-bit apps are far more common than they were back 
> then, and a lot of the bugs in Leopard's 64-bit frameworks were fixed in Snow 
> Leopard, so now I wouldn't hold back. There is more to the transition than 
> having a higher VM ceiling, e.g. 64-bit apps will run faster than 32-bit apps 
> on Intel CPUs due to improvements in the ABI.

Another advantage for 64-bit: if your app is the only 32-bit app on an 
otherwise all-64-bit system, you will be solely responsible for loading the 
entire 32-bit library stack, and your launch time and RSIZE will suffer 
accordingly. (Admittedly, this is not currently a big issue since iTunes is 
32-bit.)

On Leopard this effect was a disadvantage for 64-bit, since it was likely that 
your app was the only 64-bit app. You don't want to be the odd-app-out because 
you won't share as much memory with everybody else.


-- 
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: simple CATextLayer scaling problem

2010-05-10 Thread douglas welton
Julian,



I would suggest that you use KVO to observe the value of the bounds property of 
your layer.  When you are notified of the property change, compute the new size 
for your font at that point.

you may be able to do this rather easily by setting the layers 
needsDisplayOnBoundsChange property to YES.  This should trigger a call to the 
layer's delegate with a -drawLayer:inContext message (where you can compute the 
font size as needed).

Alternately, you may be able to use the -actionForLayer: delegate message as 
well.  I'm not sure if there is an action for bounds change, but it's worth a 
check.



later,

douglas


On May 10, 2010, at 4:25 AM, Julian. wrote:

> Have to say, that i'm new to cocoa and even newer to core animation. i have 
> tried so far, bit trail&errorly: CAConstraint,  autoresizingMask, 
> preferredFrameSize and googled for the problem. I know, newbie questions suck 
> :)
> 
> lg, Julian.
> 
> 
> Am 10.05.2010 um 04:33 schrieb Kyle Sluder:
> 
>> On May 9, 2010, at 2:44 AM, "Julian."  wrote:
>> 
>>> I'm having a simple scaling problem with CATextLayer, but i just couldn't 
>>> figure it out:
>>> I want the CATextLayer to proportionally grow in size with it's superlayer:
>>> if the superlayer's width is 300 the text size of CATextLayer should be 12 
>>> and if the supeview's width is 600 the text size should be 24.
>>> I couldn't find a working solution!
>>> 
>> 
>> What have you tried so far, and how has it failed you?
>> 
>> http://www.whathaveyoutried.com
>> 
>> --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/douglas_welton%40earthlink.net
> 
> This email sent to douglas_wel...@earthlink.net

___

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

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

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

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


Re: simple CATextLayer scaling problem

2010-05-10 Thread Kyle Sluder
On Mon, May 10, 2010 at 3:45 PM, douglas welton
 wrote:
> I would suggest that you use KVO to observe the value of the bounds property 
> of your layer.  When you are notified of the property change, compute the new 
> size for your font at that point.

CALayer is not KVO-compliant for its properties.

> you may be able to do this rather easily by setting the layers 
> needsDisplayOnBoundsChange property to YES.  This should trigger a call to 
> the layer's delegate with a -drawLayer:inContext message (where you can 
> compute the font size as needed).

This has nothing to do with KVO, but it will work.

> Alternately, you may be able to use the -actionForLayer: delegate message as 
> well.  I'm not sure if there is an action for bounds change, but it's worth a 
> check.

There is no action key for bounds change.

--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: Overriding text size in NSTextStorage

2010-05-10 Thread Gordon Apple
There is a bug in the text system, which I have reported and filed
previously.  If you programmatically change the text, the KVO for the
bindings is not triggered and will not update the text storage.  If you then
use the keyboard for another edit, it will trigger it and will commit both
changes.  This could have some relation to your problem.


On 5/10/10 2:02 PM, "cocoa-dev-requ...@lists.apple.com"
 wrote:

> On May 10, 2010, at 9:19 AM, Gideon King wrote:
> 
>> From a conceptual point of view, my understanding of MVC means that a user
>> initiated action should be reflected in the model (text storage), which
>> should push it through to the view, which should mean that doing the changes
>> in the text storage "should" be OK∑
> 
> The NSLayoutManager and associated classes are part of the model too. I think
> what‚s happening is that those objects are seeing the text before it goes into
> your TextStorage, and interpreting the original attributes; while later on
> they pull the text out and see the altered attributes.
> 
>> The behavior I'm observing seems to clearly be a case of the view being out
>> of sync with the text storage, until you type something, and then it syncs up
>> again.
> 
> It‚s the layout that‚s out of sync, sounds like. The layout is part of the
> model and can be shared by multiple views.
> 
> ˜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: Overriding text size in NSTextStorage

2010-05-10 Thread Gideon King
That's good to know - I'll keep an eye out for it.

Gideon

On 11/05/2010, at 9:40 AM, Gordon Apple wrote:

> There is a bug in the text system, which I have reported and filed
> previously.  If you programmatically change the text, the KVO for the
> bindings is not triggered and will not update the text storage.  If you then
> use the keyboard for another edit, it will trigger it and will commit both
> changes.  This could have some relation to your 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


how would a beginner know about built-in outlets?

2010-05-10 Thread Matt Neuburg
I've been thinking about how to explain to a beginner that some classes have
built-in outlets, and it strikes me that the documentation falls down here.
For example, you know and I know that a UIViewController has a view outlet;
it is visible in the Connections inspector in IB when you select an object
that's a UIViewController (or a subclass thereof). But the UIViewController
class documentation never mentions this fact; and neither does the header,
if it comes to that. Doesn't this strike you as kind of odd? m.

-- 
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.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: how would a beginner know about built-in outlets?

2010-05-10 Thread Tom Hohensee
Yes it is kind of odd.  When I moved on from C to Objective-C and  
Cocoa I found there are many disconnects in the documentation.  More  
specifically, IB and class documentation seems to not tie in very well  
just as you are pointing to in you question.  I always figured it was  
because some concepts (and classes) where so broad and complex that it  
is best to limit the scope.  As to why it is not in the header files?  
I cannot specifically recall any class header files that list the  
built in outlets.
Anyway, very early on I got into the habit of checking for built in  
outlet in IB first then googling from there if needed.


Tom

On May 10, 2010, at 7:31 PM, Matt Neuburg wrote:

I've been thinking about how to explain to a beginner that some  
classes have
built-in outlets, and it strikes me that the documentation falls  
down here.
For example, you know and I know that a UIViewController has a view  
outlet;
it is visible in the Connections inspector in IB when you select an  
object
that's a UIViewController (or a subclass thereof). But the  
UIViewController
class documentation never mentions this fact; and neither does the  
header,

if it comes to that. Doesn't this strike you as kind of odd? m.

--
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.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/tomhoh%40mac.com

This email sent to tom...@mac.com


___

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

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

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

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


Re: how would a beginner know about built-in outlets?

2010-05-10 Thread Henry McGilton

On May 10, 2010, at 5:31 PM, Matt Neuburg wrote:

> I've been thinking about how to explain to a beginner that some classes have
> built-in outlets, and it strikes me that the documentation falls down here.
> For example, you know and I know that a UIViewController has a view outlet;
> it is visible in the Connections inspector in IB when you select an object
> that's a UIViewController (or a subclass thereof). But the UIViewController
> class documentation never mentions this fact; and neither does the header,
> if it comes to that. Doesn't this strike you as kind of odd? m.

It's listed under  'Properties'.

Cheers,
. . . . . . . .Henry

___

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 would a beginner know about built-in outlets?

2010-05-10 Thread Henry McGilton

On May 10, 2010, at 6:07 PM, Tom Hohensee wrote:

> Yes it is kind of odd.  When I moved on from C to Objective-C and Cocoa I 
> found there are many disconnects in the documentation.  More specifically, IB 
> and class documentation seems to not tie in very well just as you are 
> pointing to in you question.  I always figured it was because some concepts 
> (and classes) where so broad and complex that it is best to limit the scope.  
> As to why it is not in the header files? I cannot specifically recall any 
> class header files that list the built in outlets.
> Anyway, very early on I got into the habit of checking for built in outlet in 
> IB first then googling from there if needed.
> 
> Tom
> 
> On May 10, 2010, at 7:31 PM, Matt Neuburg wrote:
> 
>> I've been thinking about how to explain to a beginner that some classes have
>> built-in outlets, and it strikes me that the documentation falls down here.
>> For example, you know and I know that a UIViewController has a view outlet;
>> it is visible in the Connections inspector in IB when you select an object
>> that's a UIViewController (or a subclass thereof). But the UIViewController
>> class documentation never mentions this fact; and neither does the header,
>> if it comes to that. Doesn't this strike you as kind of odd? m.


As I said, it's listed under  Properties  in the documentation.

And in UIViewController, the .h file declares an instance variable:

UIView  *_view;

and the @property declaration declares it thus:

   @property(nonatomic,retain) UIView *view;

Cheers,
. . . . . . . .Henry


___

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 would a beginner know about built-in outlets?

2010-05-10 Thread Roland King
right - it's listed as a property but it doesn't tell you it's an outlet 
anywhere I can see, which would be vaguely useful to know I think.


Henry McGilton wrote:

On May 10, 2010, at 5:31 PM, Matt Neuburg wrote:



I've been thinking about how to explain to a beginner that some classes have
built-in outlets, and it strikes me that the documentation falls down here.
For example, you know and I know that a UIViewController has a view outlet;
it is visible in the Connections inspector in IB when you select an object
that's a UIViewController (or a subclass thereof). But the UIViewController
class documentation never mentions this fact; and neither does the header,
if it comes to that. Doesn't this strike you as kind of odd? m.



It's listed under  'Properties'.

Cheers,
. . . . . . . .Henry

___

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

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

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

This email sent to r...@rols.org

___

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

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

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

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


Re: simple CATextLayer scaling problem

2010-05-10 Thread douglas welton
> CALayer is not KVO-compliant for its properties.

Kyle...  Would you provide a pointer to where this is  explicitly stated in the 
documentation.  thx


___

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 would a beginner know about built-in outlets?

2010-05-10 Thread Matt Neuburg
On or about 5/10/10 6:38 PM, thus spake "Henry McGilton"
:

> As I said, it's listed under  Properties  in the documentation.

I don't think you understand the problem. Lots of things, for example, are
listed as properties in the UIViewController class documentation. But of
those, only view and searchDisplayController are outlets (in Interface
Builder). Nothing in the UIViewController class documentation distinguishes
these two; they are all just described as @property (not as @property
IBOutlet, the way you'd do it in code). That's my point. m.

-- 
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.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: how would a beginner know about built-in outlets?

2010-05-10 Thread Henry McGilton

On May 10, 2010, at 6:38 PM, Roland King wrote:

> right - it's listed as a property but it doesn't tell you it's an outlet 
> anywhere I can see, which would be vaguely useful to know I think.

Yes, you blokes have a Good Point.I wonder how that's done --- some magic 
in the 
Interface Builder templates, maybe?  I see that the Classes section in 
Interface Builder's
Library catalogue lists the outlets there.

Anybody from Developer Publications feel like chiming in?

> 
> Henry McGilton wrote:
>> On May 10, 2010, at 5:31 PM, Matt Neuburg wrote:
>>> I've been thinking about how to explain to a beginner that some classes have
>>> built-in outlets, and it strikes me that the documentation falls down here.
>>> For example, you know and I know that a UIViewController has a view outlet;
>>> it is visible in the Connections inspector in IB when you select an object
>>> that's a UIViewController (or a subclass thereof). But the UIViewController
>>> class documentation never mentions this fact; and neither does the header,
>>> if it comes to that. Doesn't this strike you as kind of odd? m.
>> It's listed under  'Properties'.
>>Cheers,
>>. . . . . . . .Henry

___

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 setup idle timer in 64-bit 10.6?

2010-05-10 Thread Kevin Wojniak
CGEventSourceSecondsSinceLastEventType() is what you want. See here:
http://www.noodlesoft.com/blog/2008/01/08/idle-hands/


On May 10, 2010, at 1:26 PM, Marc Respass wrote:

> Hi All,
> 
> My application has a requirement that it "locks out" the user after X minutes 
> of inactivity. I was using Uli Kusterer's excellent UKIdleTimer in my 
> application and it worked great. Then I upgraded to 64-bit and it does not 
> work any more. Does anyone have a good replacement or is my best bet to just 
> go back to 32 bit? There are some new 10.6 event methods that I tried but 
> they are more the opposite of an idle timer. It lets me handle all kinds of 
> events but not "no event." I couldn't get that work well for me. If anyone 
> has a recommendation, I would really appreciate it.
> 
> Thanks a lot
> Marc
> ___
> 
> 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/kainjow%40kainjow.com
> 
> This email sent to kain...@kainjow.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


Send me an SMS!

2010-05-10 Thread Rajashekhar Managoli

___

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