Anyone used kCFStreamSSLCertificates and kCFStreamPropertySSLPeerCertificates

2009-03-02 Thread SridharRao M
Hi all,Any one worked on  kCFStreamSSLCertificates and
kCFStreamPropertySSLPeerCertificates in cf streams.
Can you please guide how can i proceed to client side validating using SSL
certificate.
Sridhar.
___

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

Please do not post admin requests or moderator comments to the list.
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: Animate the way a HUD panel appears.

2009-03-02 Thread Gustavo Adolfo Pizano
Hello Fabian.

I just setup the HUD panel in IB, and inside the panel my CustomView which
has some layers . Teh HUD panel its controler by a ShipControllerPanel
class,  which has the init method that initialize the panel from the
NSBundle,  and load it to memory just once.
when you tell me subclass it, you mean this ShipControllerPanel class? this
is a NSWindowController, if im not wrong.

Thanks
Gustavo




On Sun, Mar 1, 2009 at 11:06 PM, slasktrattena...@gmail.com <
slasktrattena...@gmail.com> wrote:

> Subclass it, override orderBack and orderOut, do some funky stuff...
> what did you try?
>
> Fabian
>
> On Sun, Mar 1, 2009 at 7:05 PM, Gustavo Pizano
>  wrote:
> > Hello, I have an application that has a HUD panel, now, when I click the
> > button to show the panel the HUD panel simply appears, I was wondering if
> > there is a way to make it appear in a diferent way, kinda the way
> Aperture,
> > or iPhoto shows such panels, that they "scroll down",  when needed.
> >
> > I dunno how complex can this be.
> >
> > Thanks for your help
> >
> > Gustavo Pizano
> > ___
> >
> > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> >
> http://lists.apple.com/mailman/options/cocoa-dev/slasktrattenator%40gmail.com
> >
> > This email sent to slasktrattena...@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: Animate the way a HUD panel appears.

2009-03-02 Thread Gustavo Adolfo Pizano
Douglas hello.

will this apply also to the HUD Panel?, I was thinking something similar but
couldn't see a way to achieve it. inside the panel as I said, I have my
custom view, but  I dunno how to play with it to make it appear in a "fancy"
way.

I will look at the example once i get  home.

thanks

Gustavo


On Mon, Mar 2, 2009 at 1:47 AM, douglas welton  wrote:

> Gustavo,
>
> Have you looked at the documentation for NSViewAnimation?  This will class
> gives you a number of options for manipulating several attributes (frames,
> alpha, etc) for windows/views.
>
> You might want to also take a look at the Reducer example, in particular
> the Animated TabView Class that uses a custom NSAnimation class along with
> some custom drawing to produce visual effects using the default Core Image
> Transitions.
>
> regards,
>
> douglas
>
>
> On Mar 1, 2009, at 1:05 PM, Gustavo Pizano wrote:
>
>  Hello, I have an application that has a HUD panel, now, when I click the
>> button to show the panel the HUD panel simply appears, I was wondering if
>> there is a way to make it appear in a diferent way, kinda the way Aperture,
>> or iPhoto shows such panels, that they "scroll down",  when needed.
>>
>> I dunno how complex can this be.
>>
>> Thanks for your help
>>
>> Gustavo Pizano
>>
>
___

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

Please do not post admin requests or moderator comments to the list.
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: Animate the way a HUD panel appears.

2009-03-02 Thread douglas welton

Gustavo,

Yes - a HUD Panel is just a subclass of NSWindow.

regards,

douglas

On Mar 2, 2009, at 5:24 AM, Gustavo Adolfo Pizano wrote:


Douglas hello.

will this apply also to the HUD Panel?, I was thinking something  
similar but couldn't see a way to achieve it. inside the panel as I  
said, I have my custom view, but  I dunno how to play with it to  
make it appear in a "fancy" way.


I will look at the example once i get  home.

thanks

Gustavo


On Mon, Mar 2, 2009 at 1:47 AM, douglas welton > wrote:

Gustavo,

Have you looked at the documentation for NSViewAnimation?  This will  
class gives you a number of options for manipulating several  
attributes (frames, alpha, etc) for windows/views.


You might want to also take a look at the Reducer example, in  
particular the Animated TabView Class that uses a custom NSAnimation  
class along with some custom drawing to produce visual effects using  
the default Core Image Transitions.


regards,

douglas


On Mar 1, 2009, at 1:05 PM, Gustavo Pizano wrote:

Hello, I have an application that has a HUD panel, now, when I click  
the button to show the panel the HUD panel simply appears, I was  
wondering if there is a way to make it appear in a diferent way,  
kinda the way Aperture, or iPhoto shows such panels, that they  
"scroll down",  when needed.


I dunno how complex can this be.

Thanks for your help

Gustavo Pizano



___

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

Please do not post admin requests or moderator comments to the list.
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: Advice on building a complex user custom control

2009-03-02 Thread Graham Cox


On 02/03/2009, at 12:22 PM, Oliver Charles wrote:


I've started learning Objective-C and Cocoa, and while I'm fairly
experienced with programming, GUI programming is quite new to me.

I'm working on a small game engine, and as such, I want to create a
level editor for the game. I love the old style Doom level editors, so
that's what I'm going for [1]. Notice in that screenshot the amount
the user can interact with - moving vertices on the grid, creating
lines between vertices, adding/removing objects, etc.

At the moment, I have a main MapView control, which creates vertices
in an NSArrayController. I have 2 ways of viewing these vertices - one
is to handle rendering them directly in the MapView, and another
approach creates a new VertexView for each vertex, and adds it as a
subview of the MapView. From what I've read online, this is not going
to scale beyond maybe 50 vertices, so I don't think this is an
approach. However, handling *everything* in the MapView itself feels
like it drastically reduces the cohesion of the control.

How do people create controls like this? I suppose similar controls
(to a slightly lesser extent, may be helpful if you don't understand
the screenshot below) would be things like OmniGraffle and the Core
Data editor in Xcode.



This could be a good candidate for DrawKit, my framework for vector  
drawing. You'd need to take a look and see how closely it fits your  
needs but it handles all the interactive creation of objects for you.  
It's designed to be scalable and doesn't create a subview per object  
(which is crazy talk, BTW :). It might seem like overkill but you are  
not obliged to use everything, and the whole framework adds only about  
3.5MB to an app.


Setting up a complete view with interactive drawing tools takes a few  
minutes' work in IB, though be prepared to write a fair bit of export  
code to convert the "drawing" into your map data. Of course it has a  
learning curve on top of Cocoa itself, but doesn't need a lot of set- 
up to get working.


http://apptree.net/drawkit.htm

--Graham


___

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

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

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

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


Re: Animate the way a HUD panel appears.

2009-03-02 Thread Gustavo Adolfo Pizano
Douglas hi, so I should overwrite some methods that allow me to manipulate
the HUD panel in the PanelShioController class?, which is a subclas of
NSWindowController?

if yes, then I will check out which methods apply for my requirments,

Thanks

Gus


On Mon, Mar 2, 2009 at 12:16 PM, douglas welton <
douglas_wel...@earthlink.net> wrote:

> Gustavo,
> Yes - a HUD Panel is just a subclass of NSWindow.
>
> regards,
>
> douglas
>
> On Mar 2, 2009, at 5:24 AM, Gustavo Adolfo Pizano wrote:
>
> Douglas hello.
>
> will this apply also to the HUD Panel?, I was thinking something similar
> but couldn't see a way to achieve it. inside the panel as I said, I have my
> custom view, but  I dunno how to play with it to make it appear in a "fancy"
> way.
>
> I will look at the example once i get  home.
>
> thanks
>
> Gustavo
>
>
> On Mon, Mar 2, 2009 at 1:47 AM, douglas welton <
> douglas_wel...@earthlink.net> wrote:
>
>> Gustavo,
>>
>> Have you looked at the documentation for NSViewAnimation?  This will class
>> gives you a number of options for manipulating several attributes (frames,
>> alpha, etc) for windows/views.
>>
>> You might want to also take a look at the Reducer example, in particular
>> the Animated TabView Class that uses a custom NSAnimation class along with
>> some custom drawing to produce visual effects using the default Core Image
>> Transitions.
>>
>> regards,
>>
>> douglas
>>
>>
>> On Mar 1, 2009, at 1:05 PM, Gustavo Pizano wrote:
>>
>>  Hello, I have an application that has a HUD panel, now, when I click the
>>> button to show the panel the HUD panel simply appears, I was wondering if
>>> there is a way to make it appear in a diferent way, kinda the way Aperture,
>>> or iPhoto shows such panels, that they "scroll down",  when needed.
>>>
>>> I dunno how complex can this be.
>>>
>>> Thanks for your help
>>>
>>> Gustavo Pizano
>>>
>>
>
>
___

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

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

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

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


[MEET] CocoaHeads Sydney This Thursday

2009-03-02 Thread Mark Aufflick
Hi all,

It's time for CocoaHeads Sydney Australia again, and this month we
have our very own Nathan Day, hot from a state hopping speaking tour
to Brisbane
CocoaHeads, telling us about his broad range of Cocoa frameworks.
Presumably he presents his slides with [[NDSlides alloc] init]; or
something like that ;)

Please take a minute to fill out the RSVP form: http://is.gd/lpo4

David Morrison has again sorted out our UTS room and it is now
CB10.07.114 which means Building 10, Level 7, Room 114. Building 10 is
not the main tower. If memory serves me the best entry is on Jones st,
but don't quote me on that.

http://www.uts.edu.au/about/mapsdirections/bway.html

If you get lost you can call me on 0438 700 647

Hope to see you on Thursday!

Mark.

-- 
Mark Aufflick
  contact info at http://mark.aufflick.com/about/contact
___

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

Please do not post admin requests or moderator comments to the list.
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: Advice on building a complex user custom control

2009-03-02 Thread Paul Bruneau

On Mar 1, 2009, at 8:22 PM, Oliver Charles wrote:


At the moment, I have a main MapView control, which creates vertices
in an NSArrayController. I have 2 ways of viewing these vertices - one
is to handle rendering them directly in the MapView, and another
approach creates a new VertexView for each vertex, and adds it as a
subview of the MapView. From what I've read online, this is not going
to scale beyond maybe 50 vertices, so I don't think this is an
approach. However, handling *everything* in the MapView itself feels
like it drastically reduces the cohesion of the control.


I'm not sure what you mean by this. What could be more cohesive than  
handling all your drawing and manipulation in MapView? Maybe cohesive  
wasn't the word you were looking for or maybe I am misunderstanding.


You can have your vertices contain their own drawing code (you will  
make them know how to draw themselves), but many will say that is a  
violation of MVC practices. But Erik Buck once told me a way that I  
really like: "If you are worried about adding drawing code to a  
"Model" object, add the drawing code in a category of class> and maintain the category implementation in the "View"  
subsystem."


Then you can have things such as [aVertex draw] or [aVertex  
drawWithHighlight] etc, called from the drawRect: method of your view.

___

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

Please do not post admin requests or moderator comments to the list.
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: Animate the way a HUD panel appears.

2009-03-02 Thread Gustavo Adolfo Pizano
Ok i think I messed up a little.

the PanelShipController class is a sub class of  NSWindowController, which
is the one in charge  of loading the Panel. As fas as I have read thas the
best way to do it.

Now,  if i understand good, I have to create my custom class which inherits
from NSPanel, and in IB the class of the HUD panel will be then my custom
NSPanel class. am I ok?

if so then, in that custom class , what, should I have a NSViewAnimation
attribute? to apply the fadeIn fadeOut, or startFrame endFrame  properties?

as you can see im kidna new, so any help (as you have done so far, thanks
btw) I would appreciate it,

Gustavo


On Mon, Mar 2, 2009 at 12:45 PM, Gustavo Adolfo Pizano <
gustavxcodepic...@gmail.com> wrote:

> Douglas hi, so I should overwrite some methods that allow me to manipulate
> the HUD panel in the PanelShioController class?, which is a subclas of
> NSWindowController?
>
> if yes, then I will check out which methods apply for my requirments,
>
> Thanks
>
> Gus
>
>
>
> On Mon, Mar 2, 2009 at 12:16 PM, douglas welton <
> douglas_wel...@earthlink.net> wrote:
>
>> Gustavo,
>> Yes - a HUD Panel is just a subclass of NSWindow.
>>
>> regards,
>>
>> douglas
>>
>> On Mar 2, 2009, at 5:24 AM, Gustavo Adolfo Pizano wrote:
>>
>> Douglas hello.
>>
>> will this apply also to the HUD Panel?, I was thinking something similar
>> but couldn't see a way to achieve it. inside the panel as I said, I have my
>> custom view, but  I dunno how to play with it to make it appear in a "fancy"
>> way.
>>
>> I will look at the example once i get  home.
>>
>> thanks
>>
>> Gustavo
>>
>>
>> On Mon, Mar 2, 2009 at 1:47 AM, douglas welton <
>> douglas_wel...@earthlink.net> wrote:
>>
>>> Gustavo,
>>>
>>> Have you looked at the documentation for NSViewAnimation?  This will
>>> class gives you a number of options for manipulating several attributes
>>> (frames, alpha, etc) for windows/views.
>>>
>>> You might want to also take a look at the Reducer example, in particular
>>> the Animated TabView Class that uses a custom NSAnimation class along with
>>> some custom drawing to produce visual effects using the default Core Image
>>> Transitions.
>>>
>>> regards,
>>>
>>> douglas
>>>
>>>
>>> On Mar 1, 2009, at 1:05 PM, Gustavo Pizano wrote:
>>>
>>>  Hello, I have an application that has a HUD panel, now, when I click the
 button to show the panel the HUD panel simply appears, I was wondering if
 there is a way to make it appear in a diferent way, kinda the way Aperture,
 or iPhoto shows such panels, that they "scroll down",  when needed.

 I dunno how complex can this be.

 Thanks for your help

 Gustavo Pizano

>>>
>>
>>
>
___

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

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

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

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


Terminating a thread...

2009-03-02 Thread John Cebasek

Hi All:

I've got an NSThread that copies some data from one database to  
another. While the copy is occurring, there's a sheet that is updated  
with the progress of the copy. On that sheet there's also a stop  
button, so that if the user wants to stop the copy, he can.


I seem to be having some trouble trying to terminate the thread. In  
the IBaction for the stop button, I've got:


-(IBAction)closeProgressDialog:(id)sender
{
DebugLog(@"%@", @"ConvertV1Database:closeProgressDialog");

[m_migrateThread cancel];
[self closeProgressDialogSheet];
}

Where m_migrateThread is obtained via:

m_migrateThread = [[NSThread alloc] initWithTarget:self
  
selector:@selector(convertDatabaseToSQLite3:)
object:nil];
[m_migrateThread start];

Any hints on what I might be doing wrong?

Thanks in advance for your time


John
___

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

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

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

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


Re: Terminating a thread...

2009-03-02 Thread Mike Abdullah
Have you read the docs on -[NSThread cancel] ? Calling -cancel does  
NOT terminate the thread since this easily cause disastrous memory  
problems later down the line etc. Instead, your - 
convertDatabaseToSQLite3: method should periodically call [[NSThread  
currentThread] isCancelled] and finish up early if that returns YES.


Mike.

On 2 Mar 2009, at 14:58, John Cebasek wrote:


Hi All:

I've got an NSThread that copies some data from one database to  
another. While the copy is occurring, there's a sheet that is  
updated with the progress of the copy. On that sheet there's also a  
stop button, so that if the user wants to stop the copy, he can.


I seem to be having some trouble trying to terminate the thread. In  
the IBaction for the stop button, I've got:


-(IBAction)closeProgressDialog:(id)sender
{
DebugLog(@"%@", @"ConvertV1Database:closeProgressDialog");

[m_migrateThread cancel];
[self closeProgressDialogSheet];
}

Where m_migrateThread is obtained via:

m_migrateThread = [[NSThread alloc] initWithTarget:self
  
selector:@selector(convertDatabaseToSQLite3:)
object:nil];
[m_migrateThread start];

Any hints on what I might be doing wrong?

Thanks in advance for your time


John
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.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: The fieldEditor and a focus ring

2009-03-02 Thread Eric Gorr


On Feb 27, 2009, at 6:29 PM, Graham Cox wrote:



On 28/02/2009, at 7:07 AM, Eric Gorr wrote:

If I check the value of focusRingType for the fieldEditor which is  
currently handling the text input, I get a value back of  
NSFocusRingTypeDefault. But, even if I set the value to  
NSFocusRingTypeExterior, no focus ring is drawn.


Is this focus ring something I need to draw myself or is there some  
way to get the fieldEditor to draw it?



I could be wrong (check the documentation), but my understanding is  
that the field editor isn't responsible for this.


The documentation for the field editor doesn't mention the focus ring.

However, I suspect you are correctly, that the field editor isn't  
responsible for this - especially since it doesn't draw one.



If you are using the field editor with something other than a  
standard NSTextField, you are going to have to draw the focus ring  
yourself but based on the actual view or part of the view that is  
visible, not the field editor.



I tried following the comments found here:

http://www.cocoadev.com/index.pl?DrawingAFocusRingAlongAnArbitraryPath

So, this is what I have tried to which should be drawing the focus  
ring but doesn't:


[self lockFocus];
[NSGraphicsContext saveGraphicsState];
NSRect focusRingBounds = [self bounds];
NSSetFocusRingStyle( NSFocusRingOnly );
NSBezierPath *path = [NSBezierPath bezierPathWithRect:focusRingBounds];
[path setClip];
[path fill];
[NSGraphicsContext restoreGraphicsState];
[self unlockFocus];



I have checked [self lockFocusIfCanDraw] as well and this returns true.



Here is what the code is surrounded by:
(Taken from the /Developer/Examples/Accessibility/AXCanvas sample code)

// Create a field editor.
fieldEditor = (NSTextView *)[[self window] fieldEditor:YES  
forObject:self];

[fieldEditor setDelegate:self];
[fieldEditor setFrame:[self bounds]];
[fieldEditor setMinSize:[self bounds].size];
[fieldEditor setMaxSize:[self bounds].size];
[[fieldEditor textContainer]  
setContainerSize:NSMakeSize( NSWidth( [self bounds] ), CGFLOAT_MAX ) ];


[fieldEditor setSelectedRange:NSMakeRange(0, [[(ResourceItemData*) 
[controller representedObject] textContent] length])];

[fieldEditor setTextContainerInset:NSZeroSize];

[[fieldEditor textStorage] setAttributedString:[(ResourceItemData*) 
[controller representedObject] storage]];

[fieldEditor setRichText:NO];
[fieldEditor setAllowsDocumentBackgroundColorChange:NO];
[fieldEditor setBackgroundColor:[NSColor whiteColor]];
[fieldEditor setTypingAttributes:[(ResourceItemData*)[controller  
representedObject] textAttributes]];


[[fieldEditor textContainer] setWidthTracksTextView:NO];
[[fieldEditor textContainer] setHeightTracksTextView:NO];
[fieldEditor setHorizontallyResizable:NO];
[fieldEditor setVerticallyResizable:YES];

NSLayoutManager *layoutManager  = [ResourceItemLabel  
sharedLayoutManager];
NSTextContainer *container  = [[layoutManager textContainers]  
objectAtIndex:0];


[container setContainerSize:NSMakeSize( [self bounds].size.width,  
CGFLOAT_MAX )];


NSTextStorage *storage = [[controller representedObject] storage];
[storage addLayoutManager:layoutManager];

NSPoint location= [self convertPoint:[anEvent  
locationInWindow] fromView:nil];

CGFloat partialDistance;
NSUInteger  glyphIndex;

glyphIndex = [layoutManager glyphIndexForPoint:location
   inTextContainer:container
fractionOfDistanceThroughGlyph:&partialDistance];

if ( partialDistance > .5 )
glyphIndex++;

NSRange indicatorPosition = NSMakeRange( glyphIndex, 0 );
[fieldEditor setSelectedRange:indicatorPosition];
[storage removeLayoutManager:layoutManager];

[self lockFocus];
[NSGraphicsContext saveGraphicsState];
NSRect focusRingBounds = [self bounds];
NSSetFocusRingStyle( NSFocusRingOnly );
NSBezierPath *path = [NSBezierPath bezierPathWithRect:focusRingBounds];
[path setClip];
[path fill];
[NSGraphicsContext restoreGraphicsState];
[self unlockFocus];

// Activate the field editor.
[self addSubview:fieldEditor];
[[self window] makeFirstResponder:fieldEditor];
NSLog( @"ResourceItemLabel: START EDITING" );


___

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

Please do not post admin requests or moderator comments to the list.
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: Animate the way a HUD panel appears.

2009-03-02 Thread douglas welton

Gustavo,

The best thing would probably be for you to read the documentation on  
NSWindowController and NSWindow, then decide - based on your code's  
functionality - where to make the best additions to your code to  
accomplish your goal.


regards,

douglas


On Mar 2, 2009, at 9:31 AM, Gustavo Adolfo Pizano wrote:


Ok i think I messed up a little.

the PanelShipController class is a sub class of  NSWindowController,  
which is the one in charge  of loading the Panel. As fas as I have  
read thas the best way to do it.


Now,  if i understand good, I have to create my custom class which  
inherits from NSPanel, and in IB the class of the HUD panel will be  
then my custom NSPanel class. am I ok?


if so then, in that custom class , what, should I have a  
NSViewAnimation attribute? to apply the fadeIn fadeOut, or  
startFrame endFrame  properties?


as you can see im kidna new, so any help (as you have done so far,  
thanks btw) I would appreciate it,


Gustavo


On Mon, Mar 2, 2009 at 12:45 PM, Gustavo Adolfo Pizano > wrote:
Douglas hi, so I should overwrite some methods that allow me to  
manipulate the HUD panel in the PanelShioController class?, which is  
a subclas of NSWindowController?


if yes, then I will check out which methods apply for my requirments,

Thanks

Gus



On Mon, Mar 2, 2009 at 12:16 PM, douglas welton > wrote:

Gustavo,

Yes - a HUD Panel is just a subclass of NSWindow.

regards,

douglas

On Mar 2, 2009, at 5:24 AM, Gustavo Adolfo Pizano wrote:


Douglas hello.

will this apply also to the HUD Panel?, I was thinking something  
similar but couldn't see a way to achieve it. inside the panel as I  
said, I have my custom view, but  I dunno how to play with it to  
make it appear in a "fancy" way.


I will look at the example once i get  home.

thanks

Gustavo


On Mon, Mar 2, 2009 at 1:47 AM, douglas welton > wrote:

Gustavo,

Have you looked at the documentation for NSViewAnimation?  This  
will class gives you a number of options for manipulating several  
attributes (frames, alpha, etc) for windows/views.


You might want to also take a look at the Reducer example, in  
particular the Animated TabView Class that uses a custom  
NSAnimation class along with some custom drawing to produce visual  
effects using the default Core Image Transitions.


regards,

douglas


On Mar 1, 2009, at 1:05 PM, Gustavo Pizano wrote:

Hello, I have an application that has a HUD panel, now, when I  
click the button to show the panel the HUD panel simply appears, I  
was wondering if there is a way to make it appear in a diferent  
way, kinda the way Aperture, or iPhoto shows such panels, that they  
"scroll down",  when needed.


I dunno how complex can this be.

Thanks for your help

Gustavo Pizano







___

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

Please do not post admin requests or moderator comments to the list.
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: Live resizing NSTableView causes ghosting/nastiness in custom drawn NSTextFieldCell

2009-03-02 Thread Corbin Dunn


On Feb 27, 2009, at 4:02 PM, Andrew Yeaton wrote:

I have a custom subclass of an NSTextFieldCell that draws a right- 
aligned "badge" (like Mail.app's unread count). The column that uses  
the custom cell autoresizes with the width of the NSTableView (which  
resizes with the window).


The problem:

When the width of the column expands quickly, the cell width doesn't  
resize smoothly and seems to have ghosting.


My drawing code seems to be working, but appears to be drawing  
"under" a cached version from the original width. It's as if, my  
draw is happening correctly, but a cached image is being placed over  
top anyway.


Is there a way to make the column resize smoothly and draw correctly?


Ideally, overriding -preservesContentDuringLiveResize and returning NO  
should work, but unfortunately does not (this is a known problem).  
Instead, subclass NSTableView, override -drawRect:, and call [super  
drawRect:]. The "custom" drawing will turn off live-resize caching.


corbin


___

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

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


Can't use in/contains operator with collection FIRST

2009-03-02 Thread Daniel Child
I have a basic parent entity with two child entities. I set up a nib  
file using the default "entity" interface for all three. I can add and  
remove data fine, but for some reason, the search fields that are  
automatically provided do not work, and in fact cause the following  
error message:


Can't use in/contains operator with collection FIRST (not a collection)

I don't really know what the message refers to since I don't have a  
"FIRST" entity. (There is a "first" attribute (lower case), but I was  
not searching on that attribute anyway.) This happens regardless of  
whether I search a parent or child entity.


Is "FIRST" how Core Data sets up the automatically provided filter  
predicates (FIRST, SECOND, etc.)? Googling this came no with no  
matches at all.


Also, I wanted to examine the filter predicates associated with the  
search field, but I can't find a way to do that. Is there a way to  
modify them?


Finally, can anyone shed light on this error message?

Thanks.
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


Changing NSTableView cell immediately before editing

2009-03-02 Thread K . Darcy Otto
I want to change the contents of an NSTableView cell immediately prior  
to editing, but cannot figure out how to do this.  That is, I want to  
return YES to tableView:aTableView:shouldEditTableColumn:row:, to  
permit editing to begin, but before editing actually begins, modify  
the colour and text of the cell that is going to be edited.


I was thinking about putting the code into  
tableView:aTableView:shouldEditTableColumn:row:; but I'm pretty sure  
this would not be good form; and in any case, that method is called  
more than once at the beginning of an edit.  Any help would be greatly  
appreciated.

___

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

Please do not post admin requests or moderator comments to the list.
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: enabling Edit menu items in a modal window?

2009-03-02 Thread Steve Christensen

On Mar 1, 2009, at 11:38 PM, Paul Sanders wrote:


I added a text field to my modal window, and when it is the first
responder the cut, copy, paste and select all menu items are enabled.
Just for grins I added a second NSTableView to the window and
rebuilt. When that table has focus, the edit menu items are all
disabled, just like for the original table.



I admit the possibility that I'm doing something weird, but it must
be a NSTableView-only kind of weird...


You could write a little class that derives from NSTableView and  
override
validateMenuItem.  Putting a debugger breakpoint on that might tell  
you

more.  The ins-and-outs of it are covered here:

http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/ 
ApplicationKit/Protocols/NSMenuValidation_Protocol/Reference/ 
Reference.html


I tried doing that, both in my NSTableView subclass and, just to see  
if it would make a difference, in my window controller. No  
difference. This continues to be strange since NSTextFields work just  
great in that regard.


I also tried another test case and created a new Cocoa app project  
with a table in a window. When I ran it as-is, Select All was  
disabled. When I subclassed the table and added validateMenuItem:,  
Select All was enabled. So at this point I'm stuck because nobody  
even calls validateMenuItem: for my modal window...


steve

___

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

Please do not post admin requests or moderator comments to the list.
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 create a simple pop-up-menu

2009-03-02 Thread Ulai Beekam

Hi,

How do I create a Safari-style pop-up menu? I'm talking about the pop-up menu 
(be sure to correct me if this thing is not even called a pop-up menu) that 
appears when you click the ">>" button to show off-screen tabs. 

Just open Safari (use version 3) and keep creating new tabs until the ">>" 
button appears to the right. And then click that button. You will see the menu 
I want to achieve.

How can I programmatically make such a menu appear on my custom NSView in my 
mouseDown: method? Do you have some simple sample code please?

Thanks, U
_
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us___

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

Please do not post admin requests or moderator comments to the list.
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: enabling Edit menu items in a modal window?

2009-03-02 Thread Paul Sanders
> nobody even calls validateMenuItem: for my modal window...

Well, you're one step closer to getting to the bottom of it perhaps, knowing 
that.

Is the target of the menu item in question set to the first responder in IB? 
Forgive me if you know all this, but at the code level, this corresponds to 
setting a nil target for the menu item in question. This then searches the 
responder chain, starting with the first responder, for the first object 
than can respond to the selector defined for the menu item's 'sent action' 
in IB, and then sends that object a validateMenuItem message (if the object 
can respond to such a message that is, otherwise it just enables the menu 
item regardless).  This is all in the docs.

So it is (probably!) one of:
  - the target of the menu item is incorrectly set in IB
  - the action of the menu item is incorrectly set in IB
  - the control in question does not respond to the action set in IB
  - the responder chain is screwed up somehow (unlikely)

Having said all of which, I haven't tried any of this with a table view, 
only an edit field.

A bit of digging around in the debugger should reveal which it is.  IB sets 
up items 1 and 2 when you first create your application but maybe something 
has trampled on them.  Item 3 can be tested, I would think, by sending the 
table view the appropriate action message yourself in GDB.

HTH - 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: enabling Edit menu items in a modal window?

2009-03-02 Thread mmalc Crawford


On Mar 2, 2009, at 8:28 AM, Steve Christensen wrote:



http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/ApplicationKit/Protocols/NSMenuValidation_Protocol/Reference/Reference.html
I tried doing that, both in my NSTableView subclass and, just to see  
if it would make a difference, in my window controller. No  
difference. This continues to be strange since NSTextFields work  
just great in that regard.
I also tried another test case and created a new Cocoa app project  
with a table in a window. When I ran it as-is, Select All was  
disabled. When I subclassed the table and added validateMenuItem:,  
Select All was enabled. So at this point I'm stuck because nobody  
even calls validateMenuItem: for my modal window...



Is this on 10.4?
Are you possibly hitting the bug described in ?


mmalc

___

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

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

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

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


Re: Does CGImageSourceCreateThumbnailAtIndex max out at 5000 pixels?

2009-03-02 Thread David Duncan

On Mar 1, 2009, at 11:46 PM, Florian Soenens wrote:

Actually we are just looking for the fastest way of creating a 72  
dpi image (thumbnail) of our original 400 dpi image.
It seemed that CGImageSourceCreateThumbnailAtIndex was the fastest  
way to do this.



The thumbnail image isn't guaranteed to be of any particular DPI  
(unless the image source is PDF). If you want an image at a particular  
DPI, then I would get the image properties dictionary via  
CGImageSourceCopyPropertiesAtIndex() to get the size and DPI of the  
image, then use that value to calculate an appropriate value for the  
kCGImageSourceThumbnailMaxPixelSize key.

--
David Duncan
Apple DTS Animation and Printing

___

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

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

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

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


Re: Optimizing, uiview caching, and clearing that cached view.

2009-03-02 Thread David Duncan

On Feb 28, 2009, at 8:16 AM, James Cicenia wrote:

How do I skip over my populating code in ViewWillAppear to increase  
the response time of my app?


I'm guessing your doing what should be one-time creation of content  
for that view. If so, you should do this inside of -viewDidLoad rather  
than -viewDidAppear.

--
David Duncan
Apple DTS Animation and Printing

___

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

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

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

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


Re: NSTableView and CA backed views

2009-03-02 Thread David Duncan

On Feb 28, 2009, at 8:49 AM, Erwan Ripoll wrote:

It seems that any NSTableView in a NSVIew that has setWantsLayer:YES  
will flicker whenever the parent view is resized.



There is no work around for this issue short of disabling layer- 
backing. The basic problem is that a CATiledLayer throws away all of  
its content when it is resized, and the NSTableView is using a  
CATiledLayer for its display. Because of this, the entire table gets  
re-rendered, and because the resize is live, re-rendered again and  
again before the content is complete.

--
David Duncan
Apple DTS Animation and Printing

___

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

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

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

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


Re: How to create a simple pop-up-menu

2009-03-02 Thread Benjamin Dobson


On 2 Mar 2009, at 16:42:00, Ulai Beekam wrote:



Hi,

How do I create a Safari-style pop-up menu? I'm talking about the  
pop-up menu (be sure to correct me if this thing is not even called  
a pop-up menu) that appears when you click the ">>" button to show  
off-screen tabs.


Just open Safari (use version 3) and keep creating new tabs until  
the ">>" button appears to the right. And then click that button.  
You will see the menu I want to achieve.


How can I programmatically make such a menu appear on my custom  
NSView in my mouseDown: method? Do you have some simple sample code  
please?


Use NSPopUpButton.

___

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

Please do not post admin requests or moderator comments to the list.
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: Advice on building a complex user custom control

2009-03-02 Thread douglas welton

Oliver,

Have you considered using CALayers and Core Animation to model the  
elements of your MapView Control?  That's the direction I would go in,  
if this were my project.


regards,

douglas

On Mar 1, 2009, at 8:22 PM, Oliver Charles wrote:


Hi,

I've started learning Objective-C and Cocoa, and while I'm fairly
experienced with programming, GUI programming is quite new to me.

I'm working on a small game engine, and as such, I want to create a
level editor for the game. I love the old style Doom level editors, so
that's what I'm going for [1]. Notice in that screenshot the amount
the user can interact with - moving vertices on the grid, creating
lines between vertices, adding/removing objects, etc.

At the moment, I have a main MapView control, which creates vertices
in an NSArrayController. I have 2 ways of viewing these vertices - one
is to handle rendering them directly in the MapView, and another
approach creates a new VertexView for each vertex, and adds it as a
subview of the MapView. From what I've read online, this is not going
to scale beyond maybe 50 vertices, so I don't think this is an
approach. However, handling *everything* in the MapView itself feels
like it drastically reduces the cohesion of the control.

How do people create controls like this? I suppose similar controls
(to a slightly lesser extent, may be helpful if you don't understand
the screenshot below) would be things like OmniGraffle and the Core
Data editor in Xcode.

--
  Oliver Charles / aCiD2

[1]: http://www.doombuilder.com/img/builder_screen1.gif

___

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

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

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

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


Re: enabling Edit menu items in a modal window?

2009-03-02 Thread Steve Christensen

On Mar 2, 2009, at 8:47 AM, Paul Sanders wrote:


nobody even calls validateMenuItem: for my modal window...


Well, you're one step closer to getting to the bottom of it  
perhaps, knowing

that.

Is the target of the menu item in question set to the first  
responder in IB?
Forgive me if you know all this, but at the code level, this  
corresponds to
setting a nil target for the menu item in question. This then  
searches the
responder chain, starting with the first responder, for the first  
object
than can respond to the selector defined for the menu item's 'sent  
action'
in IB, and then sends that object a validateMenuItem message (if  
the object
can respond to such a message that is, otherwise it just enables  
the menu

item regardless).  This is all in the docs.

So it is (probably!) one of:
  - the target of the menu item is incorrectly set in IB
  - the action of the menu item is incorrectly set in IB
  - the control in question does not respond to the action set in IB
  - the responder chain is screwed up somehow (unlikely)

Having said all of which, I haven't tried any of this with a table  
view,

only an edit field.

A bit of digging around in the debugger should reveal which it is.   
IB sets
up items 1 and 2 when you first create your application but maybe  
something
has trampled on them.  Item 3 can be tested, I would think, by  
sending the

table view the appropriate action message yourself in GDB.


I think I mentioned in my original message that I'm writing an  
application plugin (for FCP, actually), so I wasn't involved in  
setting up the application's nib.


___

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

Please do not post admin requests or moderator comments to the list.
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: enabling Edit menu items in a modal window?

2009-03-02 Thread Steve Christensen

On Mar 2, 2009, at 9:10 AM, mmalc Crawford wrote:


On Mar 2, 2009, at 8:28 AM, Steve Christensen wrote:

http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/ 
ApplicationKit/Protocols/NSMenuValidation_Protocol/Reference/ 
Reference.html
I tried doing that, both in my NSTableView subclass and, just to  
see if it would make a difference, in my window controller. No  
difference. This continues to be strange since NSTextFields work  
just great in that regard.
I also tried another test case and created a new Cocoa app project  
with a table in a window. When I ran it as-is, Select All was  
disabled. When I subclassed the table and added validateMenuItem:,  
Select All was enabled. So at this point I'm stuck because nobody  
even calls validateMenuItem: for my modal window...



Is this on 10.4?
Are you possibly hitting the bug described in developer.apple.com/documentation/Cocoa/Conceptual/ 
NSPersistentDocumentTutorial104/08_CreationSheet/ 
chapter_9_section_6.html>?


Yes, this is on 10.4. I suppose it could be that bug, except that  
NSTextFields work just 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: enabling Edit menu items in a modal window?

2009-03-02 Thread Paul Sanders
> I think I mentioned in my original message that I'm writing an
> application plugin (for FCP, actually), so I wasn't involved in
> setting up the application's nib.

Oh yes, so you did.  So, I have now done what I should have done before and 
stuck a table view in my modal dialog to test it.  And ... the items in the 
edit menu all work perfectly.  Specifically, when editting a table cell, I 
can cut, copy, paste and select all.

I think that's all I can contribute really.  Good luck!

___

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

Please do not post admin requests or moderator comments to the list.
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: enabling Edit menu items in a modal window?

2009-03-02 Thread Paul Sanders
> Yes, this is on 10.4. I suppose it could be that bug, except that  
> NSTextFields work just fine...

My test were done on 10.5
___

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

Please do not post admin requests or moderator comments to the list.
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: Animate the way a HUD panel appears.

2009-03-02 Thread Sean McBride
On 3/1/09 7:05 PM, Gustavo Pizano said:

>Hello, I have an application that has a HUD panel, now, when I click
>the button to show the panel the HUD panel simply appears, I was
>wondering if there is a way to make it appear in a diferent way, kinda
>the way Aperture, or iPhoto shows such panels, that they "scroll
>down",  when needed.
>
>I dunno how complex can this be.

Funnily enough, this is really easy with Carbon.  There is an API called
TransitionWindow() that does what I think you're looking for.  Alas, it
is 32 bit only.  But you could investigate using it.

--

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


Custom file types and extensions

2009-03-02 Thread jeffs87

Hi,

My program uses a custom file type and I was wondering how to make sure 
my extension is unique.  On Apple's Data Type Registration page they 
only register creator codes.  They no longer register file types.  What 
about file extensions?


http://developer.apple.com/datatype/

Thanks
Jeff


___

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

Please do not post admin requests or moderator comments to the list.
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: Custom file types and extensions

2009-03-02 Thread Nick Zitzmann


On Mar 2, 2009, at 12:38 PM, jeff...@aol.com wrote:

My program uses a custom file type and I was wondering how to make  
sure my extension is unique.  On Apple's Data Type Registration page  
they only register creator codes.  They no longer register file  
types.  What about file extensions?



I think the best you can do here is use Google and see if there are  
any references to your preferred extension out there. I don't think  
there is any central repository of file extensions out there, because  
there is no way that could be controlled across platforms. But only  
Apple operating systems use creator codes, which is why Apple has had  
a registry for years.


As for type codes, you can use them however you wish; there are a few  
standards, like 'TEXT' and 'PDF ' you should probably avoid with a  
proprietary file type, but you probably knew that. Only the creator  
code really matters.


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: Custom file types and extensions

2009-03-02 Thread James Walker

Nick Zitzmann wrote:


On Mar 2, 2009, at 12:38 PM, jeff...@aol.com wrote:

My program uses a custom file type and I was wondering how to make 
sure my extension is unique.  On Apple's Data Type Registration page 
they only register creator codes.  They no longer register file 
types.  What about file extensions?



I think the best you can do here is use Google and see if there are any 
references to your preferred extension out there. I don't think there is 
any central repository of file extensions out there, because there is no 
way that could be controlled across platforms. But only Apple operating 
systems use creator codes, which is why Apple has had a registry for years.



There is a database at , though failing to find an 
extension there does not prove that the extension is not in use.



As for type codes, you can use them however you wish; there are a few 
standards, like 'TEXT' and 'PDF ' you should probably avoid with a 
proprietary file type, but you probably knew that. Only the creator code 
really matters.


Also, don't use all lower case for either the type or the creator, as 
those are reserved to Apple.


--
  James W. Walker, Innoventive Software LLC
  
___

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

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

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

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


Re: Custom file types and extensions

2009-03-02 Thread jeffs87

Hi


As for type codes, you can use them however you wish; there are a few
standards, like 'TEXT' and 'PDF ' you should probably avoid with a
proprietary file type, but you probably knew that. Only the creator
code really matters.


Thanks for the info, I will go with file type and creator instead of an 
extension.  I'm using dataRepresentationOfType to save the file (I need 
10.3 compatibility) but it does not set the file type and creator.  Do 
you set that after the file is saved or use something other than 
dataRepresentationOfType to save the file?


thanks
Jeff


___

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

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


Odd crash

2009-03-02 Thread Reza Farhad
I am getting an odd crash report from some of my end users at startup.  
The report attached below is generated by using a custom uncaught  
exceptions handlers. I can not make any sense of this as all the calls  
are within the Apple frameworks. Ay suggestions.

Thanks

Reza

System: Mac OS X 10.5.6 (Build 9G55)

NSUncaughtSystemExceptionException

Uncaught system exception: signal 10

NSExceptionHandlerUncaughtSignalHandler (in ExceptionHandling) + 65
_sigtramp (in libSystem.B.dylib) + 43
0x
-[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading]  
(in Foundation) + 87

_NSURLConnectionDidFinishLoading (in Foundation) + 147
URLConnectionClient::clientDidFinishLoading() (in CFNetwork) + 174
URLConnectionClient 
::ClientConnectionEventQueue 
::processAllEventsAndConsumePayload(XConnectionEventInfoXClientEventParams>*, long) (in CFNetwork) + 281

URLConnectionClient::processEvents() (in CFNetwork) + 114
MultiplexerSource::perform() (in CFNetwork) + 189
CFRunLoopRunSpecific (in CoreFoundation) + 3141
CFRunLoopRunInMode (in CoreFoundation) + 88
RunCurrentEventLoopInMode (in HIToolbox) + 283
ReceiveNextEventCommon (in HIToolbox) + 374
BlockUntilNextEventMatchingListInMode (in HIToolbox) + 106
_DPSNextEvent (in AppKit) + 657
-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in  
AppKit) + 128

-[NSApplication run] (in AppKit) + 795
NSApplicationMain (in AppKit) + 574
start (in Qu-s) + 54
0x2
___

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

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


Do I need to relase @"string" ??

2009-03-02 Thread James Cicenia

hello

Here is my code:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath: 
(NSIndexPath *)indexPath {
	WhatsFreshAppDelegate *appDelegate = (WhatsFreshAppDelegate *) 
[[UIApplication sharedApplication] delegate];


if(indexPath.row == 0){
[appDelegate setCurrentMiles:@"200"];
}else if(indexPath.row==1){
[appDelegate setCurrentMiles:@"500"];
}else if(indexPath.row==2){
[appDelegate setCurrentMiles:@"1000"];
}else if(indexPath.row==3){
[appDelegate setCurrentMiles:@"1500"];
}else if(indexPath.row==4){
[appDelegate setCurrentMiles:@"2000"];
}else if(indexPath.row==5){
[appDelegate setCurrentMiles:@"2500"];
}else if(indexPath.row==6){
[appDelegate setCurrentMiles:@"5000"];
}else if(indexPath.row==7){
[appDelegate setCurrentMiles:@"1"];
}
	[appDelegate  setupStateDisplay:[appDelegate currentLatitude]  
longString:[appDelegate currentLongitude] milesString:[appDelegate  
currentMiles]];	

[appDelegate refreshLocation:TRUE];
[(MyLocationViewController *)myParentController resetMiles];

}


DO I HAVE TO WORRY ABOUT RELEASING currentMiles somewhere?

Thanks
James Cicenia

___

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

Please do not post admin requests or moderator comments to the list.
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: Do I need to relase @"string" ??

2009-03-02 Thread Dave DeLong
For good practice, yes.  In this isolated example, I don't believe so  
(because I'm pretty sure NSConstantString overrides -retainCount so  
that it can't ever be released).


You may also want to consider simplifying your code to:
...
	NSString * miles[8] = {@"200", @"500", @"1000", @"1500", @"2000",  
@"2500", @"5000", @"1"};

[appDelegate setCurrentMiles:miles[indexPath.row]];
...

HTH,

Dave

On Mar 2, 2009, at 1:58 PM, James Cicenia wrote:


hello

Here is my code:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath: 
(NSIndexPath *)indexPath {
	WhatsFreshAppDelegate *appDelegate = (WhatsFreshAppDelegate *) 
[[UIApplication sharedApplication] delegate];


if(indexPath.row == 0){
[appDelegate setCurrentMiles:@"200"];
}else if(indexPath.row==1){
[appDelegate setCurrentMiles:@"500"];
}else if(indexPath.row==2){
[appDelegate setCurrentMiles:@"1000"];
}else if(indexPath.row==3){
[appDelegate setCurrentMiles:@"1500"];
}else if(indexPath.row==4){
[appDelegate setCurrentMiles:@"2000"];
}else if(indexPath.row==5){
[appDelegate setCurrentMiles:@"2500"];
}else if(indexPath.row==6){
[appDelegate setCurrentMiles:@"5000"];
}else if(indexPath.row==7){
[appDelegate setCurrentMiles:@"1"];
}
	[appDelegate  setupStateDisplay:[appDelegate currentLatitude]  
longString:[appDelegate currentLongitude] milesString:[appDelegate  
currentMiles]];	

[appDelegate refreshLocation:TRUE];
[(MyLocationViewController *)myParentController resetMiles];

}


DO I HAVE TO WORRY ABOUT RELEASING currentMiles somewhere?

___

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

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

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

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


Re: Custom file types and extensions

2009-03-02 Thread Nick Zitzmann


On Mar 2, 2009, at 1:41 PM, jeff...@aol.com wrote:

Thanks for the info, I will go with file type and creator instead of  
an extension.


You might want to do both. Using only a type & creator will keep Mac  
purists happy - until they try sending an attachment over E-Mail, in  
which case the codes might be lost unless both clients support  
flattening and unflattening the metadata. Keep in mind that there  
aren't many Mac purists left, and the ones that are left are usually  
trolls.


I'm using dataRepresentationOfType to save the file (I need 10.3  
compatibility) but it does not set the file type and creator.  Do  
you set that after the file is saved or use something other than  
dataRepresentationOfType to save the file?



You need to use Carbon and the FSSetCatalogInfo() function to set type  
and creator data. Read up about FileInfo for more details.


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: Do I need to relase @"string" ??

2009-03-02 Thread Kyle Sluder
On Mon, Mar 2, 2009 at 3:58 PM, James Cicenia  wrote:
> DO I HAVE TO WORRY ABOUT RELEASING currentMiles somewhere?

YOU MIGHT WANT TO WORRY about releasing your Shift key.  ;-)

Just follow the memory management guides.  You didn't use +alloc,
+new, or -copy to make the object, so you don't own it.  Therefore you
don't have to worry about releasing it.

--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: Custom file types and extensions

2009-03-02 Thread Kyle Sluder
On Mon, Mar 2, 2009 at 4:05 PM, Nick Zitzmann  wrote:
> You might want to do both. Using only a type & creator will keep Mac purists
> happy - until they try sending an attachment over E-Mail, in which case the
> codes might be lost unless both clients support flattening and unflattening
> the metadata. Keep in mind that there aren't many Mac purists left, and the
> ones that are left are usually trolls.

You need to have a file extension.  UTIs are derived from file
extensions, not creator codes:
http://www.cocoabuilder.com/archive/message/cocoa/2009/1/29/228935

Besides, what if someone tosses the file on a FAT32 flash drive?

--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: Do I need to relase @"string" ??

2009-03-02 Thread Dave DeLong
My understanding was that he was referring to the setter in his  
AppDelegate class.  Since the only thing (apparently) getting passed  
into the setter was an NSConstantString, it would seem that he  
wouldn't need to worry about releasing that property.  (Assuming the  
setter was retaining it)


Dave

On Mar 2, 2009, at 2:18 PM, Kyle Sluder wrote:

On Mon, Mar 2, 2009 at 3:58 PM, James Cicenia   
wrote:

DO I HAVE TO WORRY ABOUT RELEASING currentMiles somewhere?


YOU MIGHT WANT TO WORRY about releasing your Shift key.  ;-)

Just follow the memory management guides.  You didn't use +alloc,
+new, or -copy to make the object, so you don't own it.  Therefore you
don't have to worry about releasing it.

--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: Custom file types and extensions

2009-03-02 Thread Nick Zitzmann


On Mar 2, 2009, at 2:21 PM, Kyle Sluder wrote:


Besides, what if someone tosses the file on a FAT32 flash drive?



Actually, the Finder (and probably cp, NSFileManager, etc. as well)  
will automatically flatten resource forks and Finder metadata in this  
case. The flattened data is stored in a file with the same name,  
prefixed with a dot-underscore. I'd be more concerned with other  
transmission mechanisms; that's why I mentioned E-Mail earlier.


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: enabling Edit menu items in a modal window?

2009-03-02 Thread Steve Christensen

On Mar 2, 2009, at 10:47 AM, Paul Sanders wrote:


I think I mentioned in my original message that I'm writing an
application plugin (for FCP, actually), so I wasn't involved in
setting up the application's nib.


Oh yes, so you did.  So, I have now done what I should have done  
before and
stuck a table view in my modal dialog to test it.  And ... the  
items in the
edit menu all work perfectly.  Specifically, when editting a table  
cell, I

can cut, copy, paste and select all.


What happens if you're not actually editing a cell but the table has  
focus? I would expect that Select All would be enable so that you  
could select all rows, right? That's the behavior I'm interested in...


steve

___

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

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


NSTreeController, NSOutlineView and Core Data (again)

2009-03-02 Thread Peter Ferrett


I have Core Data objects bound to an NSOutlineView via a  
NSTreeController.  It is a  schema that is common to other threads on  
this group:  one entity for the group, one entity for the leaf, and a  
with the "children" relationship containing the groups/leafs of the  
next level.  The controller prepares the content.  Everything works  
fine, except that all objects appear at the root level.  As observed  
by others, I need to put a "parent == nil" fetch predicate to prevent  
all objects appearing at the root level.


 However ... with the fetch predicate is in place, the outline view  
does not get updated until a new group/leaf with the "parent == nil"  
predicate is inserted.  When new leaf objects are inserted, they do  
not appear in the outline view (until the next time that the an object  
with the predicate is inserted).


I tried the following:  observe  
NSManagedObjectContextObjectsDidChangeNotification notifications, and  
call [outlineView reloadItem: parent reloadChildren: YES] when the  
notifications are received.  The debugger indicates that the  
notifications are being called and the reloadItem:reloadChildren:  
method is called on the correct object (the parent of the new inserted  
leaf).  However, nothing happens.


Is this one of those methods that is no longer accessible when using  
bindings?  I am not sure what is happening and would welcome  
suggestions on how to update the outline view to reflect the new  
objects in the MOC.


thanks in advance

Peter 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


Locally Saving Data Acquired by my Cocoa App?

2009-03-02 Thread Darren Minifie
Hello everyone

I am building an application that requires me to collect data from services
like Last.fm and Pandora etc.  I am grabbing xml data about each song, as
well as small thumbnails for the album art.   I want to store this data
locally so I don't need to make another batch of requests each time my app
is run.  I originally thought about putting this data in the NSUserDefaults
database, as that would probably be the easiest thing to do at the moment.
Would there be any potential pitfalls to this approach?  My thinking is that
it may be the case that a lot of data would go into the database if every
track were to have some data and an album photo associated with it.  Are
there performance implications for putting a ton of stuff in the
UserDefaults db?

On the other hand, I may not want to have every piece of album art loaded
into memory at once. It may be better to save album art in a folder
somwhere.  What is the accepted way to create a folder on the user's machine
to support an application?  If anybody could point me at a resource that
explains how to install such directories on a users computer and how to
unintall them when the user decides to remove the application would be most
helpful.

Thank you.

PS: I'm aware of the album art folder in the iTunes directory, but I will
require something a bit different for my purpose.

-- 
Darren Minifie
Graduate Studies: Computer Science
www.myavalon.ca
www.ohsnapmusic.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


Query Active Directory

2009-03-02 Thread GARRISON, TRAVIS J.
Would anyone know how to query an attribute from Active Directory? I would like 
to query the scriptPath attribute and return 1 if it has a value in it and 0 if 
it is empty? How would I do this in cocoa? I would like to only use the /Search 
path since we use ADmitMac currently.

Travis Garrison
Data Storage Systems Administrator
Ozarks Technical Community College
417-447-7522
garri...@otc.edu

Certified Xiotech Engineer - Magnitude 3D
Certificate - ICON Manager Administrator - 2.2
Certificate - Microsoft Operations Manager 2007


___

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

Please do not post admin requests or moderator comments to the list.
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: Locally Saving Data Acquired by my Cocoa App?

2009-03-02 Thread I. Savant
On the other hand, I may not want to have every piece of album art  
loaded

into memory at once. It may be better to save album art in a folder
somwhere.


  Have you considered Core Data with a SQLite store type and merely  
referencing cached images stored in a cache folder somewhere?




What is the accepted way to create a folder on the user's machine
to support an application?


  How about ~/Library/Application Support/ ?



If anybody could point me at a resource


  http://developer.apple.com/referencelibrary/

  ... and ...

  http://www.google.com/

  ... would've answered your questions nicely. For example, searching  
the Apple reference library for "where to store application files"  
yields the answer to that question (and questions you didn't know you  
should ask about the file system) in the first hit.


--
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 arch...@mail-archive.com


Re: The fieldEditor and a focus ring

2009-03-02 Thread Kirk Swenson


On Mar 2, 2009, at 7:42 AM, cocoa-dev-requ...@lists.apple.com wrote:


On Feb 27, 2009, at 6:29 PM, Graham Cox wrote:


On 28/02/2009, at 7:07 AM, Eric Gorr wrote:

Is this focus ring something I need to draw myself or is there  
some way to get the fieldEditor to draw it?


If you are using the field editor with something other than a  
standard NSTextField, you are going to have to draw the focus ring  
yourself but based on the actual view or part of the view that is  
visible, not the field editor.


I tried following the comments found here:

http://www.cocoadev.com/index.pl?DrawingAFocusRingAlongAnArbitraryPath

So, this is what I have tried to which should be drawing the focus  
ring but doesn't:


[self lockFocus];
[NSGraphicsContext saveGraphicsState];
NSRect focusRingBounds = [self bounds];
NSSetFocusRingStyle( NSFocusRingOnly );
NSBezierPath *path = [NSBezierPath  
bezierPathWithRect:focusRingBounds];

[path setClip];
[path fill];
[NSGraphicsContext restoreGraphicsState];
[self unlockFocus];


Essentially the same code is working for me, except that I'm not  
calling the setClip method. Have you tried without the call to setClip?


Kirk Swenson
KCP Technologies, Inc.

___

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

Please do not post admin requests or moderator comments to the list.
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: Custom file types and extensions

2009-03-02 Thread Kyle Sluder
On Mon, Mar 2, 2009 at 4:24 PM, Nick Zitzmann  wrote:
> Actually, the Finder (and probably cp, NSFileManager, etc. as well) will
> automatically flatten resource forks and Finder metadata in this case. The
> flattened data is stored in a file with the same name, prefixed with a
> dot-underscore. I'd be more concerned with other transmission mechanisms;
> that's why I mentioned E-Mail earlier.

I can't say I've looked too deeply into it (it "just works" from my
perspective), but does Finder metadata include creator and type codes?
 I thought those were originally filesystem properties.

--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: NSTreeController, NSOutlineView and Core Data (again)

2009-03-02 Thread Quincey Morris

On Mar 2, 2009, at 11:41, Peter Ferrett wrote:

I have Core Data objects bound to an NSOutlineView via a  
NSTreeController.  It is a  schema that is common to other threads  
on this group:  one entity for the group, one entity for the leaf,  
and a with the "children" relationship containing the groups/leafs  
of the next level.  The controller prepares the content. Everything  
works fine, except that all objects appear at the root level.  As  
observed by others, I need to put a "parent == nil" fetch predicate  
to prevent all objects appearing at the root level.


However ... with the fetch predicate is in place, the outline view  
does not get updated until a new group/leaf with the "parent == nil"  
predicate is inserted. When new leaf objects are inserted, they do  
not appear in the outline view (until the next time that the an  
object with the predicate is inserted).


There's an essential difference, in this setup, between what's going  
on at the top level (the NSTreeController is in effect using the  
result of a Core Data fetch request) and what's going on at all the  
other levels (the NSTreeController is in effect monitoring the NSSet  
that represents the "children" relationship of the non-leaf objects).  
In the latter case, the NSTreeController monitors the relationship  
using KVO.


The most likely reason that isn't working is that, when you insert a  
new child object into the managed object context, you're not setting  
the relationship in a KVO-compliant manner.


How are you establishing the parent/child relationship between  
objects? Assuming you specified the parent and children relationships  
as inverses, all of the following would be KVO-compliant (and  
equivalent):


[child setValue: parent forKey: @"parent"];
child.parent = parent;
[[parent mutableSetValueForKey: @"children"] addObject: child];
	[parent addChildrenObject: child]; // using Core Data's dynamic  
accessor


but this would not:

[parent addObject: child];


___

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

Please do not post admin requests or moderator comments to the list.
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: The fieldEditor and a focus ring

2009-03-02 Thread Graham Cox


On 03/03/2009, at 2:30 AM, Eric Gorr wrote:


[self lockFocus];
[NSGraphicsContext saveGraphicsState];
NSRect focusRingBounds = [self bounds];
NSSetFocusRingStyle( NSFocusRingOnly );
NSBezierPath *path = [NSBezierPath  
bezierPathWithRect:focusRingBounds];

[path setClip];
[path fill];
[NSGraphicsContext restoreGraphicsState];
[self unlockFocus];



Couple of things:

First, the focus ring is typically drawn around the control which  
means it's outside the view's bounds. You have to focus on the  
superview (parent). convert the coordinates and draw it in that view.  
It can still be drawn by 'this' view, but you need to lockFocus on the  
parent.


Second, the focus ring is drawn as a stroke along the path, so if you  
clip to that same path, you'll only see half of the ring - the part  
that falls inside. So don't bother clipping.


I just had a look at a control I wrote a while back that handles a  
focus ring, here's the code that draws it:


[[self superview] lockFocus];
NSRect fr = [self frame];
NSSetFocusRingStyle(NSFocusRingOnly);
[[NSBezierPath bezierPathWithRect:fr] fill];
[[self superview] unlockFocus];


--Graham


___

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

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

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

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


Re: do i need to create autorelease pool?

2009-03-02 Thread Michael Ash
On Sun, Mar 1, 2009 at 9:58 PM, Memo Akten  wrote:
> Michael, so does this mean that CFRunLoopTimer and NSTimer don't behave the
> same way? I always assumed 'toll-free bridged' meant that you could use them
> interchangeably, the NSxxx were just Cocoa wrappers for the CF stuff, but it
> seems behavior is not the same...

Toll-free bridged means that objects of the two classes can be used
interchangeably. In other words, you can do this:

CFRunLoopTimerRef timer = ...;
[timer invalidate];

Or you can do this:

NSTimer *timer = ...;
CFRunLoopTimerSetNextFireDate(timer, date);

But it does *not* mean that two different APIs on either side of the
divide will behave identically. The NSTimer method sends a message to
an object. The CFRunLoopTimer method calls a function. This is
*already* a difference in behavior, and further differences in
behavior should not be any sort of surprise.

Another example: CFDictionarySetValue() will allow you to set a NULL
value, whereas -[NSMutableDictionary setObject:forKey:] will not.
There's nothing unusual about that, they're two different things. TFB
does not say that they will behave identically, it says that you can
pass an NSMutableDictionary to CFDictionarySetValue(), or that you can
send -setObject:forKey: to a CFMutableDictionary.

Mike
___

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

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

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

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


Re: NSTreeController, NSOutlineView and Core Data (again)

2009-03-02 Thread Peter Ferrett


Quincey,

Thank you very much.  I think you have hit the nail on the head  
there.  Because I wanted to do some alterations (ordering, etc) to the  
children objects I actually bound the tree controller to a custom  
children method.  When I bind the tree controller to the original  
children method, it updates fine (albeit no longer with my required  
alterations).


Peter



On 2 Mar 2009, at 23:02, Quincey Morris wrote:


On Mar 2, 2009, at 11:41, Peter Ferrett wrote:

I have Core Data objects bound to an NSOutlineView via a  
NSTreeController.  It is a  schema that is common to other threads  
on this group:  one entity for the group, one entity for the leaf,  
and a with the "children" relationship containing the groups/leafs  
of the next level.  The controller prepares the content. Everything  
works fine, except that all objects appear at the root level.  As  
observed by others, I need to put a "parent == nil" fetch predicate  
to prevent all objects appearing at the root level.


However ... with the fetch predicate is in place, the outline view  
does not get updated until a new group/leaf with the "parent ==  
nil" predicate is inserted. When new leaf objects are inserted,  
they do not appear in the outline view (until the next time that  
the an object with the predicate is inserted).


There's an essential difference, in this setup, between what's going  
on at the top level (the NSTreeController is in effect using the  
result of a Core Data fetch request) and what's going on at all the  
other levels (the NSTreeController is in effect monitoring the NSSet  
that represents the "children" relationship of the non-leaf  
objects). In the latter case, the NSTreeController monitors the  
relationship using KVO.


The most likely reason that isn't working is that, when you insert a  
new child object into the managed object context, you're not setting  
the relationship in a KVO-compliant manner.


How are you establishing the parent/child relationship between  
objects? Assuming you specified the parent and children  
relationships as inverses, all of the following would be KVO- 
compliant (and equivalent):


[child setValue: parent forKey: @"parent"];
child.parent = parent;
[[parent mutableSetValueForKey: @"children"] addObject: child];
	[parent addChildrenObject: child]; // using Core Data's dynamic  
accessor


but this would not:

[parent addObject: child];


___

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

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

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

This email sent to pe...@minapre.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: Odd crash

2009-03-02 Thread Michael Ash
On Mon, Mar 2, 2009 at 3:52 PM, Reza Farhad  wrote:
> I am getting an odd crash report from some of my end users at startup. The
> report attached below is generated by using a custom uncaught exceptions
> handlers. I can not make any sense of this as all the calls are within the
> Apple frameworks. Ay suggestions.
> Thanks
>
> Reza
>
> System: Mac OS X 10.5.6 (Build 9G55)
>
> NSUncaughtSystemExceptionException
>
> Uncaught system exception: signal 10
>
> NSExceptionHandlerUncaughtSignalHandler (in ExceptionHandling) + 65
> _sigtramp (in libSystem.B.dylib) + 43
> 0x
> -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] (in
> Foundation) + 87
> _NSURLConnectionDidFinishLoading (in Foundation) + 147
> URLConnectionClient::clientDidFinishLoading() (in CFNetwork) + 174
> URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo XClientEventParams>*, long) (in CFNetwork) + 281
> URLConnectionClient::processEvents() (in CFNetwork) + 114
> MultiplexerSource::perform() (in CFNetwork) + 189
> CFRunLoopRunSpecific (in CoreFoundation) + 3141
> CFRunLoopRunInMode (in CoreFoundation) + 88
> RunCurrentEventLoopInMode (in HIToolbox) + 283
> ReceiveNextEventCommon (in HIToolbox) + 374
> BlockUntilNextEventMatchingListInMode (in HIToolbox) + 106
> _DPSNextEvent (in AppKit) + 657
> -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit)
> + 128
> -[NSApplication run] (in AppKit) + 795
> NSApplicationMain (in AppKit) + 574
> start (in Qu-s) + 54
> 0x2

I'm clueless as to why this would show up as an NSException, but
signal 10 is SIGBUS, a.k.a. bus error, which is a common symptom of
memory management problems. Turn on zombies (or tell the user to) and
see if a more informative error is given.

Mike
___

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

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

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

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


Re: Do I need to relase @"string" ??

2009-03-02 Thread Bryan Henry
Assuming that the setter is copying the value passed in (which it  
should be, considering setCurrentMiles: should accept a single  
NSString*), yes James, you should release currentMiles in your - 
(void)dealloc implementation for that class. The release won't affect  
the constant strings, but to be correct and prevent leaks in the case  
where setCurrentMiles: may be passed an non-constant string, you need  
to do that.


Quick note:
If you're using properties and synthesized accessors, NSString*  
properties should be copy and not retain unless you have a good reason  
otherwise.
If you're writing the setter and getter yourself, use -copy and not - 
retain when its an NSString*.


The reason being that, for immutable objects, -copy will be  
effectively the same as -retain...but if setCurrentMiles: is passed an  
NSMutableString* it actually creates a new immutable instance.


Bryan

On Mar 2, 2009, at 4:21 PM, Dave DeLong wrote:

My understanding was that he was referring to the setter in his  
AppDelegate class.  Since the only thing (apparently) getting passed  
into the setter was an NSConstantString, it would seem that he  
wouldn't need to worry about releasing that property.  (Assuming the  
setter was retaining it)


Dave

On Mar 2, 2009, at 2:18 PM, Kyle Sluder wrote:

On Mon, Mar 2, 2009 at 3:58 PM, James Cicenia   
wrote:

DO I HAVE TO WORRY ABOUT RELEASING currentMiles somewhere?


YOU MIGHT WANT TO WORRY about releasing your Shift key.  ;-)

Just follow the memory management guides.  You didn't use +alloc,
+new, or -copy to make the object, so you don't own it.  Therefore  
you

don't have to worry about releasing it.

--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/bryanhenry%40mac.com

This email sent to bryanhe...@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: enabling Edit menu items in a modal window?

2009-03-02 Thread Paul Sanders
> What happens if you're not actually editing a cell but the table has  
> focus? I would expect that Select All would be enable so that you  
> could select all rows, right? That's the behavior I'm interested in...

Oh, I see.  No, it doesn't do that.
___

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

Please do not post admin requests or moderator comments to the list.
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: Odd crash

2009-03-02 Thread Paul Sanders
> I am getting an odd crash report from some of my end users at startup.
> The report attached below is generated by using a custom uncaught
> exceptions handlers. I can not make any sense of this as all the calls
> are within the Apple frameworks. Ay suggestions.
> Thanks

As the man said, over-releaseing something, perhaps.

Can I scrounge* a copy of you custom exception handler please?  If it's 
convenient, perhaps you cluld email me a copy.  I won't mind if you say no.

---

*Scrounge: beg, steal, borrow, or all three :) 

___

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

Please do not post admin requests or moderator comments to the list.
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: NSFileManager reads from invalid memory

2009-03-02 Thread Chris Parker

Hi Tim,

On 27 Feb 2009, at 10:57 AM, Tim Murison wrote:

I noticed an issue in my code related to NSFileManager. When running  
my

program with gmalloc, I got a seg fault. I traced the cause back to
NSFileManager and wrote a simple reproducible program to illustrate  
the
issue. Can one of the gurus here point out a flaw, or is this a real  
bug?


[code elided]

I was able to reproduce this on 10.5.6 (9G55) - the backtrace shows  
the crash happening deep in LaunchServices; this is a known bug which  
has been fixed.


.chris

--
Chris Parker
Cocoa Frameworks
Apple Inc.

___

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

Please do not post admin requests or moderator comments to the list.
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: Do I need to relase @"string" ??

2009-03-02 Thread Joel Norvell
While it's important to keep Objective C's memory management model and rules in 
mind, I've found the LLVM/Clang Static Analyzer to be the perfect tool for 
double-checking my code.  It's a lot less neurotic than trying to remember 
everything, all the time, especially when you're starting out.

Eric Orion Anderson did this very helpful tutorial:

http://www.therareair.com/2008/09/26/tutorial-how-to-static-analyze-your-objective-c-code-using-the-clang-static-analyzer-tool/

http://tinyurl.com/d7p3pp

Sincerely,
Joel




  
___

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

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


float from NSData

2009-03-02 Thread Jay Kickliter
I have a case where I'm sending IEEE 754 32-bit floats to my Cocoa  
program over a wireless serial link, they are being sent MSB first.  
I'm using AMSerialPort to handle my data, and after a little parsing,  
I'm left with a 4 byte NSData, which has the 32-bit float split into 4  
bytes.


I know I have to play around to make sure the bytes are in the right  
order. But what I can't seem to figure out, is how I create a float  
from those 4 bytes stored in an instance of NSData. Has anybody run  
into this situation? 
___


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

Please do not post admin requests or moderator comments to the list.
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: float from NSData

2009-03-02 Thread Graham Cox


On 03/03/2009, at 12:32 PM, Jay Kickliter wrote:

I have a case where I'm sending IEEE 754 32-bit floats to my Cocoa  
program over a wireless serial link, they are being sent MSB first.  
I'm using AMSerialPort to handle my data, and after a little  
parsing, I'm left with a 4 byte NSData, which has the 32-bit float  
split into 4 bytes.


I know I have to play around to make sure the bytes are in the right  
order. But what I can't seem to figure out, is how I create a float  
from those 4 bytes stored in an instance of NSData. Has anybody run  
into this situation?___



Have a look at NSSwapBigFloatToHost and friends

--Graham


___

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

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

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

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


I can't find the leak on this simple table view.

2009-03-02 Thread James Cicenia

Hello -

I have a table view that I popup. However it is giving me leaks and  
something about NSIndexPath is shown in leaks in instruments.


It is leaking upon showing the table view.

I have a mainview --> PopupView --> PopupView2

the PopupView2 is the one giving me the leak upon display.


here is the code:

- (UITableViewCell *)tableView:(UITableView *)tableView  
cellForRowAtIndexPath:(NSIndexPath *)indexPath {


static NSString *CellIdentifier = @"MilesCell_ID";

MilesCell *cell =(MilesCell *) [tableView  
dequeueReusableCellWithIdentifier:CellIdentifier];

if (cell == nil) {
cell =(MilesCell *) [[[MilesCell alloc]  
initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];

}
if(indexPath.row == 0){
[[cell numberImageView]setImage:image200];
}else if(indexPath.row==1){
[[cell numberImageView]setImage:image500];
}else if(indexPath.row==2){
[[cell numberImageView]setImage:image1000];
}else if(indexPath.row==3){
[[cell numberImageView]setImage:image1500];
}else if(indexPath.row==4){
[[cell numberImageView]setImage:image2000];
}else if(indexPath.row==5){
[[cell numberImageView]setImage:image2500];
}else if(indexPath.row==6){
[[cell numberImageView]setImage:image5000];
}else if(indexPath.row==7){
[[cell numberImageView]setImage:image1000];
}
return cell;
}

The Item cell inherits from another cell and doesn't override  
anything. And that superclass cell doesn't leak.


So how do I track this kind of leak down?

Thanks
James


___

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

Please do not post admin requests or moderator comments to the list.
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: I can't find the leak on this simple table view.

2009-03-02 Thread mmalc Crawford


On Mar 2, 2009, at 5:52 PM, James Cicenia wrote:


So how do I track this kind of leak down?


To be somewhat facetious on this occasion:
	

It's a known issue.

mmalc

___

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

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

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

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


Exel and PowerPoint

2009-03-02 Thread Тимофей Даньшин

Hello.
Are there any abstractions in Cocoa to open and handle Exel and  
PowerPoint files?

Thank you.
Timofey.
___

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

Please do not post admin requests or moderator comments to the list.
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: I can't find the leak on this simple table view.

2009-03-02 Thread James Cicenia

No ,,, facetious works for me

thanks..

just trying hard to make my little app more like a vault and less  
like a bank...


not to be facetious.

;-)



On Mar 2, 2009, at 8:10 PM, mmalc Crawford wrote:



On Mar 2, 2009, at 5:52 PM, James Cicenia wrote:


So how do I track this kind of leak down?


To be somewhat facetious on this occasion:
	

It's a known issue.

mmalc



___

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

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

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

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


Re: float from NSData

2009-03-02 Thread Ben Lachman
Just to note.  Depending on how many of these you're sending over the  
link, I think having an NSData for every 4 byte float is a bit  
overkill and could probably end up being a bottle neck.  I'm not  
saying you should optimize early, but there might be a more straight  
forward way of creating a float out of the raw data than first shoving  
it into a data then some other object and then finally outputting it  
as a 32-bit float.

--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

email: blach...@mac.com
twitter: @benlachman
mobile: 740.590.0009



On Mar 2, 2009, at 8:32 PM, Jay Kickliter wrote:

I have a case where I'm sending IEEE 754 32-bit floats to my Cocoa  
program over a wireless serial link, they are being sent MSB first.  
I'm using AMSerialPort to handle my data, and after a little  
parsing, I'm left with a 4 byte NSData, which has the 32-bit float  
split into 4 bytes.


I know I have to play around to make sure the bytes are in the right  
order. But what I can't seem to figure out, is how I create a float  
from those 4 bytes stored in an instance of NSData. Has anybody run  
into this situation?___


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

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

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

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


Getting NSDate from EXIF of a image

2009-03-02 Thread Jushin
I need to get time and date from EXIF of a image.
Following is the code snippet I used:

NSDictionary *metadata = (NSDictionary *)
CGImageSourceCopyPropertiesAtIndex(source, 0, NULL);
NSMutableDictionary *muMetadata = [[metadata mutableCopy] autorelease];
[metadata release];

NSMutableDictionary *EXIFDictionary = [[[muMetadata
objectForKey:(NSString *)kCGImagePropertyExifDictionary]

mutableCopy] autorelease];

NSString *EXIFDate = [[EXIFDictionary objectForKey:(NSString
*)kCGImagePropertyExifDateTimeDigitized] retain];
NSLog(EXIFDate);

NSDate *aDate = [[NSDate alloc] initWithString: EXIFDate];


Here are my questions:

1. the last line, NSDate *aDate returns null.
I think it is because the format of EXIFDate string that was created
right above isn't correct.
When I did NSLog(EXIFDate), I get followings:
2008:11:06 19:12:51

According to the NSDate documentation, string format of time should be:
2008-11-06 19:12:51

2. the returned date string (EXIFData) doesn't have timezone information.
Is it possible to get timezone info as well from the EXIF information?

3. Well... eventually what I want to do is, I want to create "unix
time" format of date from image EXIF using timeIntervalSince1970.
Is there any other better way to get this?
___

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

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


Latent objects remain associated in NSTokenField after they are deleted/removed?

2009-03-02 Thread Honey Pot
Hello,

I have three token fields, each of which has a special case within

- (NSArray *)tokenField:(NSTokenField *)tokenField
completionsForSubstring:(NSString *)substring
   indexOfToken:(int)tokenIndex
indexOfSelectedItem:(int *)selectedIndex

for when one of the fields contains a value vs when one does not.

For Example..

If Field 1 contains a value

Then Field 2 bases its completions off a sub-set of data based on the
value from Field 1.

Like so:

=
---Field 1 (Group X)
-Field 2 (Users only from Group X)

Or

---Field 1 (Empty)
-Field 2 (Users from All Groups)
=

Also - (id)tokenField:(NSTokenField *)tokenField
representedObjectForEditingString: (NSString *)editingString

returns the corresponding object for each NSTokenField(Cell?).


Problem:


Whenever a value is entered into Field 1, then Field 2 searches based
off it. Whenever a value is removed from Field 1, or Field 2, or both,
Field 2 now ALWAYS searches based on the data that WAS in Field 1 (but
is no longer.) This still occurs even if I [ TokenField
setStringValue:@"" ]; .  From the UI perspective, the Field 1 token
field is empty, even programatically setting the field to be an empty
string, completionsForSubstring still acts as though there is a value
in Field 1, and follows the corresponding code path.

Here is how I check to see if there is a value in the field

if( [ [ TokenField objectValue ] count ] > 0 )

It works fine if I close the window & reopen it. But once a value is
committed to any field, it has the residual effect of impacting all
future completionsForSubstring, by effectively limiting the results to
only include Users from Group X, even when Field 1 is now "empty"
___

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

Please do not post admin requests or moderator comments to the list.
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: Logical and - second operator evaluated?

2009-03-02 Thread Sam Schapmann
Have you checked that you have initialized the "timer" pointer to  
nil?   Like C, in Objective-C local variables (as opposed to instance  
variables) are allocated on the stack frame and have unspecified  
initial values.  About the only thing you can count on for sure is  
that the initial value is NOT nil (i.e. 0x0).


So, if your code is structured like the below snippet, then I would  
expect BAD_ACCESS every time.  That's because the first check is TRUE  
(timer indeed is not nil), and the second check has the side effect of  
attempting to invoke the isValid method at a memory location that is  
1) random, and 2) certainly not even an Obj-C object.  The BAD ACCESS  
would result from the Obj-C runtime attempting to dereference the  
timer pointer out to no-man's memory land.


Instance variables and static variables are initialized to bitwise  
0's, so the above analysis would not apply in that case.


Just some thoughts.

-S

-(void)aMethod
{
   NSTimer *timer;
 if(timer!=nil && [timer isValid]) [timer invalidate];
}
___

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

Please do not post admin requests or moderator comments to the list.
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: Exel and PowerPoint (??????? ???????)

2009-03-02 Thread David Hoerl


Hello.
Are there any abstractions in Cocoa to open and handle Exel and 
PowerPoint files?

Thank you.
Timofey.


Well, there are ways to read and write excel files - look on 
sourceforge for libxls and xlslib (the first library can read an .xls 
file, and xlslib can write one). I contribute to the first and 
support the second.


I have an unpublished cocoa framework (to be released any day now :-) 
) that uses the xlslib source to create .xls files - if you want to 
test it let me know.


David
___

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

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

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

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


Re: Odd crash

2009-03-02 Thread Kyle Sluder
On Mon, Mar 2, 2009 at 7:02 PM, Paul Sanders  wrote:
> As the man said, over-releaseing something, perhaps.

0x is on the call stack... maybe it's defensive scribbling,
not an overrelease.

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


Path for writeToFile

2009-03-02 Thread Pierce Freeman
Hi everyone:

I am running into a bit of a problem when trying to use writeToFile with
NSDictionary.  My problem is that I want to be able to get a file on the
Desktop but I can't find a way to do that without knowing the directory
structure of the user.  If anyone could point me in the right direction, it
would be great.


Pierce


___

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

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

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

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


Re: Getting NSDate from EXIF of a image

2009-03-02 Thread Jushin
I found that in order to convert NSString format of date to NSDate, we
need timezone.
But, EXIF doesn't support timezone unless GPS tags exist.
So, here is what I have come up with:

NSDictionary *metadata = (NSDictionary *)
CGImageSourceCopyPropertiesAtIndex(source, 0, NULL);
NSMutableDictionary *muMetadata = [[metadata mutableCopy] autorelease];
[metadata release];

NSMutableDictionary *EXIFDictionary = [[[muMetadata
objectForKey:(NSString *)kCGImagePropertyExifDictionary]

mutableCopy] autorelease];

NSString *EXIFDate = [[EXIFDictionary objectForKey:(NSString
*)kCGImagePropertyExifDateTimeDigitized] retain];

NSArray *listItems = [EXIFDate componentsSeparatedByString:@":"];

NSString *newFormatedDate = [NSString stringWithFormat:@"%...@-%@-%@:%@:%@ %d",
 
[listItems objectAtIndex:0], [listItems objectAtIndex:1],
[listItems objectAtIndex:2],
 
[listItems objectAtIndex:3], [listItems objectAtIndex:4],
 
(([[NSTimeZone systemTimeZone] secondsFromGMT]/60)/60)];

NSDate *aDate = [[NSDate alloc] initWithString:newFormatedDate];

I still think these are not clever way. If you have better idea,
please share it with me :)

On Mon, Mar 2, 2009 at 10:00 PM, Jushin  wrote:
> I need to get time and date from EXIF of a image.
> Following is the code snippet I used:
>
> NSDictionary *metadata = (NSDictionary *)
> CGImageSourceCopyPropertiesAtIndex(source, 0, NULL);
> NSMutableDictionary *muMetadata = [[metadata mutableCopy] autorelease];
> [metadata release];
>
> NSMutableDictionary *EXIFDictionary = [[[muMetadata
> objectForKey:(NSString *)kCGImagePropertyExifDictionary]
>                                                                               
>  mutableCopy] autorelease];
>
> NSString *EXIFDate = [[EXIFDictionary objectForKey:(NSString
> *)kCGImagePropertyExifDateTimeDigitized] retain];
> NSLog(EXIFDate);
>
> NSDate *aDate = [[NSDate alloc] initWithString: EXIFDate];
>
>
> Here are my questions:
>
> 1. the last line, NSDate *aDate returns null.
> I think it is because the format of EXIFDate string that was created
> right above isn't correct.
> When I did NSLog(EXIFDate), I get followings:
> 2008:11:06 19:12:51
>
> According to the NSDate documentation, string format of time should be:
> 2008-11-06 19:12:51
>
> 2. the returned date string (EXIFData) doesn't have timezone information.
> Is it possible to get timezone info as well from the EXIF information?
>
> 3. Well... eventually what I want to do is, I want to create "unix
> time" format of date from image EXIF using timeIntervalSince1970.
> Is there any other better way to get this?
>
___

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

Please do not post admin requests or moderator comments to the list.
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: Do I need to relase @"string" ??

2009-03-02 Thread Michael Ash
On Mon, Mar 2, 2009 at 7:50 PM, Joel Norvell  wrote:
> While it's important to keep Objective C's memory management model and rules 
> in mind, I've found the LLVM/Clang Static Analyzer to be the perfect tool for 
> double-checking my code.  It's a lot less neurotic than trying to remember 
> everything, all the time, especially when you're starting out.
>
> Eric Orion Anderson did this very helpful tutorial:
>
> http://www.therareair.com/2008/09/26/tutorial-how-to-static-analyze-your-objective-c-code-using-the-clang-static-analyzer-tool/
>
> http://tinyurl.com/d7p3pp

Note that the clang static analyzer still has many false positives and
false negatives. It is an extremely useful tool, but I would hesitate
to use it as a substitute for remembering the rules. I would
definitely use it as a second check in case you happened to have a
lapse, though.

Also, there's really only one rule. Since they don't want us
rephrasing them on the list, I'll just link to it:

http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html

There really is just not that much to remember. It's hard at the
beginning, that is true, but my advice is to concentrate on learning
and internalizing it, not finding substitutes for having it in your
brain.

Mike
___

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

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

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

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


Re: Path for writeToFile

2009-03-02 Thread Graham Cox


On 03/03/2009, at 3:36 PM, Pierce Freeman wrote:


Hi everyone:

I am running into a bit of a problem when trying to use writeToFile  
with
NSDictionary.  My problem is that I want to be able to get a file on  
the
Desktop but I can't find a way to do that without knowing the  
directory
structure of the user.  If anyone could point me in the right  
direction, it

would be great.



FindFolder with a type of kDesktopFolderType.

--Graham


___

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

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

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

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


Re: Path for writeToFile

2009-03-02 Thread Michael Ash
On Mon, Mar 2, 2009 at 11:36 PM, Pierce Freeman
 wrote:
> Hi everyone:
>
> I am running into a bit of a problem when trying to use writeToFile with
> NSDictionary.  My problem is that I want to be able to get a file on the
> Desktop but I can't find a way to do that without knowing the directory
> structure of the user.  If anyone could point me in the right direction, it
> would be great.

Looking up the path to a standard location without hardcoding the
directory structure is just the sort of thing that the
NSSearchPathForDirectoriesInDomains() is for.

Mike
___

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

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

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

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


Re: Exel and PowerPoint

2009-03-02 Thread Andrew Farmer

On 02 Mar 09, at 18:16, Тимофей Даньшин wrote:

Hello.
Are there any abstractions in Cocoa to open and handle Exel and  
PowerPoint files?

Thank you.


No. You'll need to either write this code yourself or find a library  
that'll do it for you.___


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

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


EXC_BAD_ACCESS in _class_changeInfo

2009-03-02 Thread Dave DeLong

Hey everyone,

I've just come across something that I'm totally lost on.

I've got an app that I'm making that uses the Flying Meat database  
system (this may or may not be relevant; I have no idea), a couple  
static arrays[], and an "EditMyTeamsViewController".


When I call:

EditMyTeamsViewController * editMyTeams = [[EditMyTeamsViewController  
alloc] init];


I get an EXC_BAD_ACCESS on line 11 of the assembly in  
_class_changeInfo (presumably in the runtime):  0x941e6d4a  <+0022>   
mov0x10(%edx),%eax  (in case you really wanted to know)


The stacktrace is:
_class_changeInfo
_class_setInitialized
_class_initialize
_class_lookupMethodAndLoadCache
_objc_msgSend
[MyCallingClass callingMethod]

I have verified that the result of the +alloc call is non-nil, but  
other than that I have no clue how to begin debugging this.


Any ideas?

Thanks!

Dave
___

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

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

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

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


Code Signing for Dummies

2009-03-02 Thread Seth Willits


Alright, so I've read the docs on code signing, but it's a little too  
detailed in some areas and has no big picture. I have a typical  
bundled Cocoa app that uses a few frameworks. I want to use code  
signing so that each time I update the app, users don't get the  
keychain nag dialog. (Actually, it's more for myself since I rebuild  
the app several times a day and it nags me each time :p )


So do I just create self-signed certificate and select it in the Xcode  
build settings and that's it? Everything is as desirable and as  
functional as need be?




--
Seth Willits



___

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

Please do not post admin requests or moderator comments to the list.
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: Odd crash

2009-03-02 Thread Paul Sanders
(Reza sent me the message below privately but I thought it might be useful 
to copy the reply to the list.  Excuse me if you have heard it all before).

> So you would think this is happening in the Exception Handling code?

No, I don't think it's happening on the exception handler.   I think that is 
trapping it, rather than causing it.  To help track the problem down, take a 
look at this:

http://developer.apple.com/technotes/tn2004/tn2124.html

As a starting point, try running your program under GDB with Guard Malloc 
enabled.  This often traps memory allocation errors at source, although it 
can slow things down a lot.  If that is too slow, try setting 
MallocScribble, MallocPreScribble, MallocGuardEdges and MallocStackLogging 
in your environment as described in the article.  You can set these 
variables in XCode via Get Info - Arguements on your executable.  Check out 
also NSZombieEnabled, see http://www.cocoadev.com/index.pl?NSZombieEnabled. 
When this is set in the environment, the runtime will trap any reference to 
a freed object.

Hope this helps and thanks very much for sending me your code  - Paul. 

___

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

Please do not post admin requests or moderator comments to the list.
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: Odd crash

2009-03-02 Thread Andrew Farmer

On 02 Mar 09, at 20:22, Kyle Sluder wrote:
On Mon, Mar 2, 2009 at 7:02 PM, Paul Sanders  
 wrote:

As the man said, over-releaseing something, perhaps.


0x is on the call stack... maybe it's defensive scribbling,
not an overrelease.


Given that it's between the (presumably) crashing code and _sigtramp,  
my bet is that it's some sort of signal handler goop.

___

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

Please do not post admin requests or moderator comments to the list.
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: Odd crash

2009-03-02 Thread Paul Sanders
> Given that it's between the (presumably) crashing code and _sigtramp,
> my bet is that it's some sort of signal handler goop.

Oh!  I just took a copy of that code :).  I'll look at it when I get a 
moment. 

___

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

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