[Moderator] Message size reminder

2008-10-12 Thread CocoaDev Admins

Just a quick reminder...

The allowable message size is limited. If you need to post something  
larger than 25K, please just post a link.


The mailing list software catches larger posts and flags them for  
moderation. They always get rejected.


Sorry for the trouble.

Scott
[moderator]
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Handler not called on table cell edit

2008-10-12 Thread Ken Tozier

Thanks Kyle

I just tried your suggestion, but no luck. I read your links but I'm  
not sure how they apply. I'm hoping to avoid getting fancy with the  
text editor and doing tons of configuration etc. Basically a i need is  
when a user hits return in an editable cell, it calls my supplied  
action hander. Anything else jump out at you?


On Oct 13, 2008, at 2:33 AM, Kyle Sluder wrote:

On Mon, Oct 13, 2008 at 2:13 AM, Ken Tozier <[EMAIL PROTECTED]>  
wrote:
Seems like it should be pretty straightforward. Anyone see what I'm  
doing

wrong?


Have you sent the column [pageColumn setEditable:YES]?

http://cocoadev.com/index.pl?SubclassedNSTextFieldCellTargetAction

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTableColumn_Class/Reference/Reference.html#/ 
/apple_ref/occ/instm/NSTableColumn/setEditable:


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


custom nstextview

2008-10-12 Thread chris struhar
I'm trying to modify the default behavior of an NSTextView to behave
more like that of programming IDEs (xcode or textmate) where if you
tab over and then press return, it automatically tabs you to the  same
indentation level on the new line.

Could someone point me in the right direction? My guess is that I need
to add some ruler to the view but I don't know where to go beyond
that.

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


Remove help menu shortcut

2008-10-12 Thread Benjamin Dobson

Hi,

In Leopard, pressing ⌘? automatically activates the Help menu.  
Unfortunately, this means the ⌘? shortcut cannot be assigned to  
anything else. In my application, the ⌘? shortcut needs to perform a  
different action to the pre-built one. (It is a full-screen  
application, help is written on a simple panel.)


How can I rewire the ⌘? shortcut to my showHelp: 
method?___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Handler not called on table cell edit

2008-10-12 Thread Kyle Sluder
On Mon, Oct 13, 2008 at 2:13 AM, Ken Tozier <[EMAIL PROTECTED]> wrote:
> Seems like it should be pretty straightforward. Anyone see what I'm doing
> wrong?

Have you sent the column [pageColumn setEditable:YES]?

http://cocoadev.com/index.pl?SubclassedNSTextFieldCellTargetAction

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTableColumn_Class/Reference/Reference.html#//apple_ref/occ/instm/NSTableColumn/setEditable:

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


Handler not called on table cell edit

2008-10-12 Thread Ken Tozier

Hi

I have a dynamically created table with one editable column (page  
number), but when I change the number and hit "return", my assigned  
handler never gets called.


Here's how the cell is defined:

pageCell = [[NSTextFieldCell alloc] init];
[pageCell setEditable: YES];
[pageCell setTarget: self];
[pageCell setAction: @selector(handlePageNumberChange:)];


Here's where it's added to the "page number" column:

pageColumn  = [[NSTableColumn alloc] initWithIdentifier: @"page"];
[pageColumn setWidth: 20];
[pageColumn setMinWidth: 20];
[pageColumn setMaxWidth: 20];
[pageColumn setDataCell: pageCell]; // <- CELL ADDED HERE
[pageColumn bind: @"value" toObject: self withKeyPath:  
@"pages.pageNumber" options: nil];



And here's the hander:

- (void) handlePageNumberChange:(id) inSender
{
NSLog(@"handlePageNumberChange: %@", inSender);
}


Seems like it should be pretty straightforward. Anyone see what I'm  
doing wrong?


Thanks for any help

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: waiting for an NSThread

2008-10-12 Thread Omar Qazi

Yes.


NSThread *newThread = [self startTheThread];
[[NSNotificationCenter defaultCenter]addObserver:self  
selector:@selector(threadExited:) name:NSThreadWillExitNotification  
object:newThread];


- (void)threadExited:(NSNotification *)noti {
NSLog(@"Thread exited");
}

On Oct 12, 2008, at 8:42 PM, John Zorko wrote:

  Can I have Cocoa notify me when a thread ends, like it notifies me  
when an observed property changes?


smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: creating a printer

2008-10-12 Thread Dave Camp

On Oct 12, 2008, at 6:54 PM, Scott Ribe wrote:


But how do I add a printer to the system? Any pointers to the right
docs?


I think you'll have to use lpadmin, via NSTask, and it's not  
particularly
easy to figure out the right options without knowing a good bit  
about CUPS,

which I don't...


You can do it programatically by sending IPP requests directly to the  
CUPS server (which is how the lpadmin tool does it) via libcups.


Point your bowser at http://localhost:631 to get documentation on  
libcups.


To see what requests lpadmin makes to create printers, grab the CUPS  
source from the Darwin repository or download a snapshot from cups.org.


Dave
___

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

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

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

This email sent to [EMAIL PROTECTED]


NSComboBox, bindings, and auto-complete, oh my!

2008-10-12 Thread Randall Meadows

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: waiting for an NSThread

2008-10-12 Thread Roland King
did you try looking at the documentation for NSThread? There's an 
NSThreadWillExitNotification listed there, sent to the default 
notification center just before the thread goes out of existence when 
+exit is called. Earlier in the documentation it says that after 
detachNewThreadSelector:toTarget:withObject: is called, the detached 
thread is exited (using the exit class method) as soon as aTarget has 
completed executing the aSelector method. So it would seem quite likely 
that notification would do what you want.


John Zorko wrote:



Hello, all ...

I've another n00b Cocoa question: How can I wait for a thread to  
finish without depending on a flag that may be reset and set before  
the thread i'm waiting for has time to check it?  For instance, in  
Win32 (i'm not saying Win32 is the best, it's just what i've the most  
experience in), I can ::WaitForSingleObject(thread_id).  In Cocoa,  
once I start the new thread via NSThread detachNewThreadSelector(),  
how can I be sure it ended i.e. how can I wait for it to end before  
starting another?  Can I have Cocoa notify me when a thread ends, 
like  it notifies me when an observed property changes?


Regards,

John

Falling You - exploring the beauty of voice and sound
http://www.fallingyou.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/rols%40rols.org

This email sent to [EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


waiting for an NSThread

2008-10-12 Thread John Zorko


Hello, all ...

I've another n00b Cocoa question: How can I wait for a thread to  
finish without depending on a flag that may be reset and set before  
the thread i'm waiting for has time to check it?  For instance, in  
Win32 (i'm not saying Win32 is the best, it's just what i've the most  
experience in), I can ::WaitForSingleObject(thread_id).  In Cocoa,  
once I start the new thread via NSThread detachNewThreadSelector(),  
how can I be sure it ended i.e. how can I wait for it to end before  
starting another?  Can I have Cocoa notify me when a thread ends, like  
it notifies me when an observed property changes?


Regards,

John

Falling You - exploring the beauty of voice and sound
http://www.fallingyou.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 [EMAIL PROTECTED]


Re: creating a printer

2008-10-12 Thread Stephen J. Butler
On Sun, Oct 12, 2008 at 8:54 PM, Scott Ribe <[EMAIL PROTECTED]> wrote:
>> But how do I add a printer to the system? Any pointers to the right
>> docs?
>
> I think you'll have to use lpadmin, via NSTask, and it's not particularly
> easy to figure out the right options without knowing a good bit about CUPS,
> which I don't...

Note that in 10.5 you need to be an administrator to install printers.
lpadmin will prompt for an admin user/pass if the current user isn't
root. So if you want a normal user to be able to install printers w/o
being bothered, you need to write an SUID helper tool.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: creating a printer

2008-10-12 Thread Scott Ribe
> But how do I add a printer to the system? Any pointers to the right
> docs?

I think you'll have to use lpadmin, via NSTask, and it's not particularly
easy to figure out the right options without knowing a good bit about CUPS,
which I don't...

-- 
Scott Ribe
[EMAIL PROTECTED]
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: iPhone: Editing with cursor but without keyboard

2008-10-12 Thread Sherm Pendley
On Sun, Oct 12, 2008 at 7:28 PM, Mike Westerfield <[EMAIL PROTECTED]> wrote:

> I'm trying to edit text in a UITextView object on the iPhone


There was a recent announcement that the NDA terms would be relaxed soon,
and a new NDA released for developers to sign. The list moderators have said
that they'd post an announcement here when the change took effect. But the
new NDA hasn't been released yet, and no announcement has been made here, so
the old NDA still applies.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.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 [EMAIL PROTECTED]


Re: KVC Question

2008-10-12 Thread mmalc crawford


On Oct 12, 2008, at 4:18 PM, Joseph Crawford wrote:

What I need to know is if there is something I should be doing to  
*notify* the array controller telling it to update.






Programmatic modifications to arrays not noticed by table view

mmalc

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSSet primitive methods

2008-10-12 Thread Glen Low

Mike

On 11/10/2008, at 10:27 PM, Mike Abdullah wrote:


Can I enquire as to why you wish to subclass it?


I have an existing data structure defined in C that I need to wrap  
with an Objective-C veneer. Rather than struggle to keep the C and an  
actual Objective-C NSSet in sync, I'd rather just define a NSSet  
subclass instead that passes all relevant operations to the C  
structure/functions. Also the data structure is more akin to an  
unordered set than an ordered array e.g. it's non-trivial to retrieve  
an indexed member of the structure.





Cheers, Glen Low


---
pixelglow software | simply brilliant stuff
www.pixelglow.com
aim: pixglen

___

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

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

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

This email sent to [EMAIL PROTECTED]


iPhone: Editing with cursor but without keyboard

2008-10-12 Thread Mike Westerfield
I'm trying to edit text in a UITextView object on the iPhone using  
buttons, rather than the keyboard. The only way I can find to make the  
insertion point appear is by calling


   [myText becomeFirstResponder];

This does, indeed, cause the insertion point to appear and blink, but  
it also brings up the keyboard.


How can I get the insertion point to blink without the keyboard being  
visible?


Thanks,

Mike Westerfield
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Remote debugging - Could not open socket: /tmp/.XcodeGDBRemote-3439-0

2008-10-12 Thread I. Savant
I am trying to remote debug an app, but keep getting the following  
error:


  This is more of an Xcode question than a Cocoa question. The xcode- 
dev list is the better resource and may already have answers for you  
in the archives.


--
I.S.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: KVC Question

2008-10-12 Thread Joseph Crawford
I would like to thank everyone who responded to my last e-mail,  
especially Nathan for helping out so much off-list.


I do have another question however.

I have a class that is set to be the File Owner for a view.  This View  
has an array controller that is bound to an NSMutableArray in the File  
Owner so


[SearchNameViewController result]

The issue I am running into is that when I do [result addObject:obj]  
the array controller does not seem to update so the UI does not load  
the data.


Nathan suggested changing that code to [resultsArrayController  
addObject:obj] and that works perfect.


What I need to know is if there is something I should be doing to  
*notify* the array controller telling it to update.


Thanks,
Joseph Crawford
___

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

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

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

This email sent to [EMAIL PROTECTED]


Remote debugging - Could not open socket: /tmp/.XcodeGDBRemote-3439-0

2008-10-12 Thread Patrick Neave


Hi,

I am trying to remote debug an app, but keep getting the following  
error:


Could not open socket: /tmp/.XcodeGDBRemote-3439-0 to get mobile  
device file descriptor.


Can anyone shed any light on this, as it has had me stumped for a few  
days.



Regards,

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


Re: Instruments leaks.

2008-10-12 Thread Michael Ash
On Sun, Oct 12, 2008 at 12:08 PM, Fritz Anderson
<[EMAIL PROTECTED]> wrote:
> On 12 Oct 2008, at 10:00 AM, Sandro Noel wrote:
>
>> but i wonder, will the variable automatically be released when it falls
>> out of scope? i don't think so but i  might be wrong.
>> i'll have to look it up in the doc again :)
>
> No. It will not be automatically released, unless you use garbage collection

Note that this is not the case. It will be automatically
*deallocated*, but it will not be automatically released.

This is kind of pedantic, but I think it's important. In the context
of Cocoa, "release" means to decrement the reference count. It does
*not* mean to deallocate the object. (Although deallocation is
sometimes a consequence.) I think this is important because one of the
most common errors I see Cocoa newbies making is confusing "release"
with "dealloc". They are very different and the two terms and methods
are not interchangeable.

I know what you meant, but just for the sake of accuracy, I wanted to
point out the above.

Mike
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Add animation layer and then remove animation layer

2008-10-12 Thread Steven Riggs

Matt,

Thanks for the help!  I have a split view and I will replace the  
subview of the right half when a particular button is pressed in the  
menu.  changeRightView is the method that handles it. The subview may  
be a tableview or a scrollview/textview and resizing the window or  
splitview will cause a blinking fade effect (default animation) in the  
right half of the splitview while it redraws the subview. From what I  
read, as long as the CALayer is there, it will have an animation of  
some kind and that's where the blinky fade effect is coming from.  It  
seemed that setWantsLayer:NO was the right answer to get rid of the  
CALayer. Maybe it still is but my timing is bad?


Also, depending on what view is chosen to appear, I will have the push  
animation come from Right, Left or Top. I have a routine that will  
apply kCATransitionFromRight, kCATransitionFromLeft, or  
kCATransitionFromTop respectively.  So I won't know what animation  
direction to come from till the user presses a button.


Here's what happens (is supposed to happen) in my program...
1. user presses button to change view
2. KVO gets a notification of button pressed and a if() statement  
decides which button was pressed.

3. setWantsLayer:YES
4. create CATransition and add the correct push animation direction  
per the button pressed

5. CATransition delegate set to self
6. Set those animations for the rightPlaceHolderView
7. replace the subview (hopefully cool animation happens here)
8. animationDidStop:finished: is called and setWantsLayer:NO

Thanks,
Steve

On Oct 11, 2008, at 11:04 PM, Matt Long wrote:


Hey Steve,

Your call to setWantsLayer won't take effect until the next run  
loop. So here is what happens (I think).


- First call to changeRightView:
- turns on layer backing for next run loop
- adds the animation (transition) for next run loop
- sets the delegate for the transition for next run loop
- animation doesn't actually run
- Second call to changeRightView:
- runs the animation added in previous call
- turns on layer backing
- adds the animation
	- callback (animationDidStop) gets called since the animation ran  
and finished

- callback turns off layer backing
- Third call to changeRightView:
- turns on layer backing for next run loop
- adds the animation (transition) for next run loop
- sets the delegate for the transition for next run loop
	- runs the animation added in previous loop, but won't actually run  
(or be visible) because layer backing was turned off.

- Fourth call same as the second:
- runs the animation added in previous call
- turns on layer backing
- adds the animation
	- callback (animationDidStop) gets called since the animation ran  
and finished

- callback turns off layer backing

lather, rinse, repeat.

This will cause your transitions to do exactly what you describe-- 
every other iteration will look right.


Ok. So now how to solve your problem Not sure about that. If you  
can clarify what you are doing exactly, I might be able to offer a  
different solution. What do you mean by "I want the animation layer  
to go away". And I'm not sure how you're getting "blinky window  
resizing and other fun fade effects".  Maybe show some more code?


Best Regards,

-Matt

p.s. Don't assume animationDidStop never gets called. Set a  
breakpoint or call NSLog() to be sure. ;-)



On Oct 10, 2008, at 6:53 PM, Steven Riggs wrote:

I'm enabling a core animation when I replace a subview and I want  
the animation layer to go away when the transition is finished so I  
don't have the blinky window resizing and other fun fade effects  
that I don't want.
I have a problem with my code. The first time I changeRightView the  
CALayer appears and the view is transitioned from the right and the  
CALayer is gone. That's just what I wanted. The next time I  
changeRightView the CALayer appears but the view transitions using  
the default fade and then the CALayer stays.  I assume  
animationDidStop:finished: never gets called because the  
CATransition never gets created or applied.  So every other  
transition fails like this.  good, bad, good, bad, good, bad...
what did I miss?


See code below. Thanks for the help!

-Steve


- (void) changeRightView
{
//enable CA layer
[rightPlaceHolderView setWantsLayer:YES];

//transition comes from the right
CATransition *transition = [CATransition animation];
[transition setType:kCATransitionPush];
[transition setSubtype:kCATransitionFromRight];
//set delegate for CAAnimation
[transition setDelegate:self];

	[rightPlaceHolderView setAnimations:[NSDictionary  
dictionaryWithObject:transition

  
  forKey:@"subviews"]];
//re

Re: Drawing?

2008-10-12 Thread Steven Degutis
Ah yes, that's right. Well I wrote a workaround for this very specific
situation for my own iPhone app:
void SDPathAddRoundedRect(CGMutablePathRef path, CGRect rect, CGFloat radius
) {
CGFloat left = rect.origin.x, top = rect.origin.y, width =
rect.size.width, height = rect.size.height;

CGPathMoveToPoint(path, NULL, left, top + radius);
CGPathAddArcToPoint(path, NULL, left, top, left + radius, top,
radius);
CGPathAddLineToPoint(path, NULL, left + width - radius, top);
CGPathAddArcToPoint(path, NULL, left + width, top, left + width, top
+ radius, radius);
CGPathAddLineToPoint(path, NULL, left + width, top + height - radius
);
CGPathAddArcToPoint(path, NULL, left + width, top + height, left +
width - radius, top + height, radius);
CGPathAddLineToPoint(path, NULL, left + radius, top + height);
CGPathAddArcToPoint(path, NULL, left, top + height, left, top +
height - radius, radius);

CGPathCloseSubpath(path);
}

On Sun, Oct 12, 2008 at 12:14 PM, Dave DeLong <[EMAIL PROTECTED]> wrote:

> Unfortunately, NSBezierPath does not exist on the iPhone.
>
> Dave
>
> On 12 Oct, 2008, at 10:50 AM, Steven Degutis wrote:
>
>  Finally, if you want to get fancy drawing boxes with rounded corners, have
>> a look at
>> NSBezierPath.
>>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/steven.degutis%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>



-- 
Steven Degutis
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Drawing?

2008-10-12 Thread Dave DeLong

Unfortunately, NSBezierPath does not exist on the iPhone.

Dave

On 12 Oct, 2008, at 10:50 AM, Steven Degutis wrote:

Finally, if you want to get fancy drawing boxes with rounded  
corners, have a look at

NSBezierPath.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Drawing?

2008-10-12 Thread Steven Degutis
Your questions specifically on how to use OpenGL and CoreGraphics are too
broad to answer in the context of this email. However, neither are necessary
to draw small rectangular boxes. Have a look first of all at geometry.h, to
get a feel for NSRect structs and all you can do with them. Also look in
Xcode's documentation for NSRectFill() and have al look at other functions
on that page. Also very important to doing this is NSColor. Finally, if you
want to get fancy drawing boxes with rounded corners, have a look at
NSBezierPath. Keep in mind, none of this touches CoreGraphics or OpenGL in
the slightest. One more solution is to use a CALayer object. Using this
alone, you can create a very lightweight object with all these properties,
including the rounded borders and a background color of your choice (and
more), with all the other goodness of CoreAnimation. The good thing about
CALayer is that they don't need to be redrawn all the time, saving CPU
cycles. This is important on the iPhone. Hope this helps!

On Sun, Oct 12, 2008 at 11:36 AM, J. Todd Slack <
[EMAIL PROTECTED]> wrote:

> Hi All,
>
> I need to draw some very small rectangular boxes on screen (iphone) for a
> small play app that I am working on to gain some experience. I must say I
> have never needed to custom draw shapes, etc (except back about 5 years ago
> on Windows).
>
> Letters will go in each box.
>
> Do I use Open-GL? Core Graphics?
>
> I would appreciate thoughts and how I might accomplish this.
>
> Thanks everyone!
>
> -Jason
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/steven.degutis%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>



-- 
Steven Degutis
___

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

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

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

This email sent to [EMAIL PROTECTED]


Drawing?

2008-10-12 Thread J. Todd Slack

Hi All,

I need to draw some very small rectangular boxes on screen (iphone)  
for a small play app that I am working on to gain some experience. I  
must say I have never needed to custom draw shapes, etc (except back  
about 5 years ago on Windows).


Letters will go in each box.

Do I use Open-GL? Core Graphics?

I would appreciate thoughts and how I might accomplish this.

Thanks everyone!

-Jason

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Instruments leaks.

2008-10-12 Thread Fritz Anderson

On 12 Oct 2008, at 10:00 AM, Sandro Noel wrote:

description is a local function variable, but at this particular  
point it is getting replaced by the new assignation.

description = [description trimWhiteSpace];

and access to the pointer of the old value will be lost.
at least that's what I understand.


Yes. But the old pointer will not be released, unless it was  
autoreleased or you use garbage collection.


Where did the old pointer come from? When you obtained it, did you  
retain it? The retain should then be balanced with an (auto)release.


but i wonder, will the variable automatically be released when it  
falls out of scope? i don't think so but i  might be wrong.

i'll have to look it up in the doc again :)


No. It will not be automatically released, unless you use garbage  
collection



Thank you for the language correction :) i'll remember it :)


I'm glad you took it as I intended. I worried I was rude. Your English  
is very clear.


— F

--
Fritz Anderson -- Xcode 3 Unleashed: Now in its second 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 [EMAIL PROTECTED]


Re: Read-only properties

2008-10-12 Thread DKJ

On 12 Oct, 2008, at 08:56, Roland King wrote:
If however you don't want the caller to modify the properties of the  
objects *in* the array, then unless those objects are immutable,  
returning a copy of the array won't help you anyway. Remember an  
array of objects is just an array of pointers to the objects in the  
array,


Indeed, I hadn't remembered that! So I may as well go ahead and  
synthesise a read-only property, and make the array elements immutable  
somehow.


Thanks for your replies.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Read-only properties

2008-10-12 Thread Roland King
well first off you're returning an NSArray which is immutable, so  
nobody can change the actual array itself, ie add or delete members  
(unless of course you really actually return a mutable one and the  
caller ignores the warnings and mutates it). If however you don't want  
the caller to modify the properties of the objects *in* the array,  
then unless those objects are immutable, returning a copy of the array  
won't help you anyway. Remember an array of objects is just an array  
of pointers to the objects in the array, a normal copy of that just  
copies the pointers and you can copy the array itself as much as you  
like and the objects inside it are still mutable.


So .. if you really don't want the objects themselves mutated you  
either need to make them immutable or take a look at deep copying them.



On Oct 12, 2008, at 11:44 PM, DKJ wrote:


I'd like to have something like this in my class:

@property(readonly) *NSArray myArray;

But I don't want any of the individual objects in the array to be  
modified, so I'd like to return a copy of the array. Is there a way  
of getting @synthesise to ensure this? Or do I need to write my own  
getter method?___


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

Please do not post admin requests or moderator comments to the list.
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 [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Read-only properties

2008-10-12 Thread Steven Degutis
I may be mistaken on this, but it sounds like there isn't a way to do what
you're trying to without making each array item immutable (such as NSString
instead of NSMutableString). The reason for this lies behind how pointers
work: once you have a reference, you can alter whatever is inside that
reference, and other objects that have references will see these changes.
Hope this helps.

On Sun, Oct 12, 2008 at 10:46 AM, DKJ <[EMAIL PROTECTED]> wrote:

> oops... of course that should have been:
>
>@property(readonly) NSArray *myArray;
>
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/steven.degutis%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>



-- 
Steven Degutis
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Read-only properties

2008-10-12 Thread DKJ

oops... of course that should have been:

@property(readonly) NSArray *myArray;


___

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

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

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

This email sent to [EMAIL PROTECTED]


Read-only properties

2008-10-12 Thread DKJ

I'd like to have something like this in my class:

@property(readonly) *NSArray myArray;

But I don't want any of the individual objects in the array to be  
modified, so I'd like to return a copy of the array. Is there a way of  
getting @synthesise to ensure this? Or do I need to write my own  
getter method? 
___


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

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

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

This email sent to [EMAIL PROTECTED]


Re: Instruments leaks.

2008-10-12 Thread Sandro Noel

Fritz.

description is a local function variable, but at this particular point  
it is getting replaced by the new assignation.

description = [description trimWhiteSpace];

and access to the pointer of the old value will be lost.
at least that's what I understand.

but i wonder, will the variable automatically be released when it  
falls out of scope? i don't think so but i  might be wrong.

i'll have to look it up in the doc again :)

Thank you for the language correction :) i'll remember it :)
Sandro.


On 12-Oct-08, at 10:35 AM, Fritz Anderson wrote:


On 11 Oct 2008, at 11:31 PM, Sandro Noel wrote:

for instance, the leek tells me that i have a leek here in this  
functions.

it is a NSString categorie.


- (NSString *) trimWhiteSpace {

NSMutableString *s = [[self mutableCopy] autorelease];

CFStringTrimWhitespace ((CFMutableStringRef) s);

return (NSString *) [[s copy] autorelease];
} /*trimWhiteSpace*/


and the way the function is being used is like this.

description = [description trimWhiteSpace];

i'm still looking into understanding, so it's kind of hard for me  
to be more precise, i'm sorry...


The question is then what happens to the "description" pointer later.

Suppose "description" is an instance variable. Do you later retain/ 
copy it? When you make the assignment you show, into "description,"  
do you first release/autorelease the old value (if you had retained/ 
copied/alloced it)?


It's that sort of history, of what you do later with the pointer,  
that determines whether the pointer has been leaked.


Another thought: It appears you are not using garbage collection,  
but are you? I understand -- someone please correct me --  
Instruments/Leaks is not accurate under GC.


By the way, the word you want is "leak." A "leek" is a vegetable.

— F

--
Fritz Anderson -- Xcode 3 Unleashed: Now in its second 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 [EMAIL PROTECTED]


Re: Instruments leaks.

2008-10-12 Thread Sandro Noel
Joar, thank you for the clear explanation, it will help with my leak  
research.


Sandro.

On 12-Oct-08, at 1:07 AM, j o a r wrote:



On Oct 11, 2008, at 9:31 PM, Sandro Noel wrote:

for instance, the leek tells me that i have a leek here in this  
functions.



So this is actually not really true. What leaks will initially tell  
you is where the leaked object was created. That's not the same  
thing as where that object was leaked. Leaks can't tell you exactly  
where the object was leaked, unfortunately. What it can tell you  
though, is all the places where the object was retained & released  
(and autoreleased). Using this information, you can typically figure  
out where you retained some object when you shouldn't have, creating  
a leak.


Example:

- (NSString *) giveMeAString {
// String created here. No memory management error at this 
point.
return [NSString stringWithString: @"A String"];
}

- (void) someMethod {
NSString *aString = [self giveMeAString];
		[aString retain]; // String retained here, but never subsequently  
released. This is a leak!

}

Notice how the string is created in one place, but how the actual  
memory management error that leaks that object happens elsewhere.



j o a r




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Instruments leaks.

2008-10-12 Thread Fritz Anderson

On 11 Oct 2008, at 11:31 PM, Sandro Noel wrote:

for instance, the leek tells me that i have a leek here in this  
functions.

it is a NSString categorie.


- (NSString *) trimWhiteSpace {

NSMutableString *s = [[self mutableCopy] autorelease];

CFStringTrimWhitespace ((CFMutableStringRef) s);

return (NSString *) [[s copy] autorelease];
} /*trimWhiteSpace*/


and the way the function is being used is like this.

description = [description trimWhiteSpace];

i'm still looking into understanding, so it's kind of hard for me to  
be more precise, i'm sorry...


The question is then what happens to the "description" pointer later.

Suppose "description" is an instance variable. Do you later retain/ 
copy it? When you make the assignment you show, into "description," do  
you first release/autorelease the old value (if you had retained/ 
copied/alloced it)?


It's that sort of history, of what you do later with the pointer, that  
determines whether the pointer has been leaked.


Another thought: It appears you are not using garbage collection, but  
are you? I understand -- someone please correct me -- Instruments/ 
Leaks is not accurate under GC.


By the way, the word you want is "leak." A "leek" is a vegetable.

— F

--
Fritz Anderson -- Xcode 3 Unleashed: Now in its second 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 [EMAIL PROTECTED]