Re: onSocketDidDisconnect in CocoaAsyncSocket

2011-04-29 Thread Bing Li
Dear Michael,

"Disgracefully" means the client does not close normally. It might be
crashed or closed by killing the relevant thread or process. I did that by
clicking the red Tasks button in XCode. In this situation, the connection
must not be closed properly with the socket methods.

According to my test, [AsyncSocketDelegate onSocket:
willDisconnectWithError:] is not called either.

I got the sample code from
http://www.macresearch.org/cocoa-scientists-part-xxix-message. I am still a
new developer. I am not sure if the code has any problems.

Thanks so much for your help!

Best regards,
BIng

On Fri, Apr 29, 2011 at 6:56 AM, Michael Dautermann wrote:

> >
> > I started to use CocoaAsyncSocket to establish TCP connections among
> iPads.
> >
> > I got a problem. According to the references (
> > http://code.google.com/p/cocoaasyncsocket/wiki/Reference_AsyncSocket),
> > onSocketDidDisconnect would be invoked immediately if the connection is
> not
> > already disconnected. I felt confused. What does "not already
> disconnected"
> > mean? I think onSocketDidDisconnect should be called when a connection is
> > disconnected. The description in the reference is wrong?
> >
> > I implemented a server and a client using CocoaAsyncSocket. When closing
> the
> > client disgracefully, I noticed that onSocketDidDisconnect was NOT
> called.
> > Anything wrong with it?
>
> Here are some questions that might help get some further context:
>
> how are you closing the client "disgracefully"?
>
> did the companion [AsyncSocketDelegate onSocket: willDisconnectWithError:]
> method get called?
>
> did you properly set your delegate and define that your object (the one
> that holds your delegate methods) conforms to the delegate protocol in it's
> .h file?
>
>
>
___

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

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


iOS: Data sharing/upgrade

2011-04-29 Thread Phillip Mills
I have an application that uses iTunes file sharing for documents (PDF, rtf, 
Pages...) and Core Data with sqlite for storing metadata about those documents.

I'm thinking of creating a simpler version with the same essential capability 
but without some of the advanced features, partly to promote the main program 
and partly because some people don't need the full version.  The light edition 
would use the same document types and a subset of the Core Data structure.

My concern is that I'd like to support the scenario where someone starts with 
the simple version and then moves to the more complex one.  Logically, the data 
should be perfectly transferable but to actually share or copy files seems 
painful.

What I don't know is, is there any coding possible that helps this happen?


___

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

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


image rotation

2011-04-29 Thread Amy Heavey

Hi,

I'm trying to generate a new image that is made up of a combination of  
other images.


As I iterate over the array holding the images I want to do is...
- place the componant image in the new canvas at a certain point  
(150,187)

- rotate the componant image by a certain value (calculated previously)

I don't mind how the image fits in the new canvas, it doesn't have to  
be completely within it.


I think I need to use NSAffineTransform?

I was using drawinrect previously for non-rotated movement.

Do I need to draw the componant image to the canvas first then rotate  
it?


The code I have at the moment is

[code]
//calc rotation
double rotation = 360 / ki;
double rotateby = rotation;

//set coordinates to x,y -> 150,187 to start
float x = 150;
float y = 187;

//for each image
NSEnumerator *imageLoop = [kitImages objectEnumerator];
NSString *imgPath;

while ((imgPath = [imageLoop nextObject])) {
NSImage *img = [[NSImage 
alloc]initWithContentsOfFile:imgPath];

//rotate image


//apply image to view
[targetImage lockFocus];


			//[img drawInRect:NSMakeRect(x,y,xb,yb)  
fromRect:NSMakeRect(150,150,0,0) operation:NSCompositeCopy fraction:1];


//set new rotation
rotation = rotation+rotateby;
[/code]

I've tried looking at some of the samples, but they seem to be cover  
rotating in place and resizing which is more complicated than I'm  
looking for. I'm expecting to effectively have the componant images  
fan out on the canvas.


If anyone could help me with the process I'd be grateful, do I have to  
create a intermediary image to make the rotated image square?


Thanks,

Amy



Many Thanks

Amy Heavey
Willow Tree Crafts
www.willowtreecrafts.co.uk



___

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

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

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

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


Using affine transforms

2011-04-29 Thread McLaughlin, Michael P.
I am writing the drawRect routine for a custom view in which I need to draw
a simple X-Y graph, given the data.  Desiring to be elegant and up-to-date,
I decided that the best (Cocoa) way to do this was to construct a scaling
affine transform to change x,y coordinates into view coordinates using

CGAffineTransform matrix = CGAffineTransformMakeScale(360/(x2 - x1), 240/(y2
- y1));

followed by

CGContextConcatCTM(context, matrix);

When I tried this,

[graphPath stroke];

appeared to have applied the transform to the path linewidth as well.  Is
this how it is supposed to work?

Since this would seem to be a common task, is there a recommended way to
keep linewidth = 1 (and likewise for data-point circles) or would I be
better off just doing the transformations "manually" beforehand?

TIA.

-- 
Mike McLaughlin

___

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

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

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

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


Re: Using affine transforms

2011-04-29 Thread vincent habchi
Le 29 avr. 2011 à 17:01, McLaughlin, Michael P. a écrit :

> I am writing the drawRect routine for a custom view in which I need to draw
> a simple X-Y graph, given the data.  Desiring to be elegant and up-to-date,
> I decided that the best (Cocoa) way to do this was to construct a scaling
> affine transform to change x,y coordinates into view coordinates using
> 
> CGAffineTransform matrix = CGAffineTransformMakeScale(360/(x2 - x1), 240/(y2
> - y1));

[…]

I think this method has the drawback, as you said, to apply to the image as a 
whole, line width included.

Basically, if this helps, what I did for my simple GIS, where I also need to 
translate from one set of coordinates (geographical) to another (screen) was to 
use the Accelerate framework (CBLAS), that provides the dot product you're 
looking for and matrix multiplications to "concatenate" your various 
transforms. You can then compute the new coordinates and then draw directly to 
screen.

Vincent___

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

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


Hey,f

2011-04-29 Thread Nishad Kumar

Hey,
here is a good news i want to share with you ,i order 2 iphones from this 
company and receive them ,it is original much cheap than here . they can accept 
paypal of the payment ,this is very safe for the business 
if you are interested in ,you can go to check ,the website :www.myhamad.com
many thanks 

泛
  
___

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

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

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

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


Re: cpp class keywotd

2011-04-29 Thread koko
BJ -

Great response, thanks for being a professional!

-koko


On Apr 28, 2011, at 10:24 PM, B.J. Buchalter wrote:

> 
> On Apr 28, 2011, at 11:48 PM, koko wrote:
> 
>> Well, apparently, compiling for iOS app versus iOS static lib treats the 
>> processing of the .pch diifferently.
>> Moving some things out of .pch in the app build which are in the .pch of the 
>> lib build solved my problem.
>> I would like to know more about this if anyone can shed some light.
> 
> If you put it in the .pch, it will get compiled for each of the languages 
> used in your project, including obj-c (which does not understand "class'). 
> The lib probably does not have any .m files, whereas the app does.
> 
> That's my guess. You can put preprocessor conditionals around the C++ code so 
> that it only gets precompiled for the languages that support C++. 
> 
> For example:
> 
> #ifdef __cplusplus 
> 
> // code that requires C++ or obj-c++
> 
> #endif 
> 
> Best regards,
> 
> B.J. Buchalter
> Metric Halo 
> http://www.mhlabs.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: Aliases with NDAlias not appearing where I tell them to be.

2011-04-29 Thread Kevin Muldoon
Much thanks for the information everyone. Invaluable stuff, and I finally
have the behavior I was looking for.

I'm still fuzzy on the real function of 'fromPath:'. It's equiv in
FSNewAlias() appears to be fromFile which is defined as 'A pointer to the
starting point for a relative search...' and could be given a NULL value (at
least in fromFile). Of course my fuzziness on 'relative search' may stem
from my complete non-understanding of 'alias records'. It's all quite
overwhelming really.

@Sean -- My suggestion to change the var name 'aliasFilePath' to
'aliasFileName' stemmed from not 'grokking' that a path COULD go there. I
even think it SHOULD go there. I may recommend changing it back to it's
original name and for clarity sake, perhaps building an explicit path to the
alias much as is done with the path to the file it points to [
kDirOfTestProject stringByAppendingPathComponent:kTestFileName].

On the other hand, since I appear to be the only person in the world who was
confused, please take that suggestion with a 20lb grain of salt.

Alright. Back to the salt mines.

On Thu, Apr 28, 2011 at 2:48 PM, Sean McBride wrote:

> On Thu, 28 Apr 2011 14:05:46 -0400, Kevin Muldoon said:
>
> >[[NSWorkspace sharedWorkspace] selectFile:aliasFilePath
> >inFileViewerRootedAtPath:@""];
>
> This was wrong though, as 'aliasFilePath' was not a full path.  I've
> fixed that in git.
>
> --
> 
> 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


Arbitrary Shaped Windows

2011-04-29 Thread Abhinav K Tyagi

Hi,

How can i create an arbitrary shaped window? Mouse events should be
handled in the shape only and not the rectangular window portion.
For Ex. If my window is circular, then outside the circle, any mouse  
should

go to desktop or whatever is there behind it.
Using borderless and transparent mainwindow i can only display it  
circular

but mouse events still be there in rectangular region which i want to
be only in circular (or whatever defined) region.
If anyone can suggest the best possible way to do it would be great.

After this is done, i would like to dynamically change the window shape
depending on user inputs
Thanks in Advance


Abhinav K Tyagi
abhityag...@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: Arbitrary Shaped Windows

2011-04-29 Thread Laurent Daudelin
On Apr 29, 2011, at 09:46, Abhinav K Tyagi wrote:

> Hi,
> 
> How can i create an arbitrary shaped window? Mouse events should be
> handled in the shape only and not the rectangular window portion.
> For Ex. If my window is circular, then outside the circle, any mouse should
> go to desktop or whatever is there behind it.
> Using borderless and transparent mainwindow i can only display it circular
> but mouse events still be there in rectangular region which i want to
> be only in circular (or whatever defined) region.
> If anyone can suggest the best possible way to do it would be great.
> 
> After this is done, i would like to dynamically change the window shape
> depending on user inputs
> Thanks in Advance

I think a circular window, or almost any other shaped window, is a bad idea. 
That will confuse the user. In a circular window, where is the window title bar?

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.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: Arbitrary Shaped Windows

2011-04-29 Thread Philip Ershler

On Apr 29, 2011, at 12:00 PM, Laurent Daudelin wrote:

> On Apr 29, 2011, at 09:46, Abhinav K Tyagi wrote:
> 
>> Hi,
>> 
>> How can i create an arbitrary shaped window? Mouse events should be
>> handled in the shape only and not the rectangular window portion.
>> For Ex. If my window is circular, then outside the circle, any mouse should
>> go to desktop or whatever is there behind it.
>> Using borderless and transparent mainwindow i can only display it circular
>> but mouse events still be there in rectangular region which i want to
>> be only in circular (or whatever defined) region.
>> If anyone can suggest the best possible way to do it would be great.
>> 
>> After this is done, i would like to dynamically change the window shape
>> depending on user inputs
>> Thanks in Advance
> 
> I think a circular window, or almost any other shaped window, is a bad idea. 
> That will confuse the user. In a circular window, where is the window title 
> bar?
> 
> -Laurent.

If you really want to do this sort of thing, I think it would be better to just 
put your shape in a standard window.

Phil

Philip R. Ershler Ph.D.
University of Utah
Cardiovascular Research and Training Institute
95 South 2000 East
Salt Lake City, UT 84112-5000

phone: (801) 230-8771
alt ph: (801) 587-9528
fax: (801) 581-3128
e-mail: ersh...@cvrti.utah.edu


___

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

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


Local vs non-local drags and -ignoreModifierKeysWhileDragging

2011-04-29 Thread Kyle Sluder
I'm working on an application that uses a master-detail view. The
detail area includes a text area for freeform notes (each item can
have multiple notes). The note area parses references to other items
(a URL of the form "item:///item-number") and turns them into
clickable links.

Right now, dragging a row from the master table view puts an NSString
on the pasteboard containing a URL reference to the item. This is
suitable for dropping in the note area or in other applications.

I also want to provide alternate methods of dragging: a Cmd-Drag to
the note area would create a new note containing some boilerplate "See
also" text, followed by a URL reference to the item (rather than
attempting to insert the reference into whatever note text it was
dropped on). An option-drag would move all the source item's notes
into the destination item, and delete the source item (a merge
operation). The same behavior would occur for an option-drag solely
within the master table view.

These meanings conflict with the system-standard notions of dragging
modifier flags, described in the documentation for -[
draggingSourceOperationMask]. So I need to return NO from
-ignoreModifierKeysWhileDragging to prevent the system from ANDing the
wrong operation constants with what I return from
-dragSourceOperationMaskForLocal:. (Yes, there was a somewhat lengthy
discussion about whether it was appropriate to redefine the meaning of
modifier keys for this drag operation.)

But I don't necessarily want to alter the semantics of a non-local
drag. So overriding -ignoreModifierKeysWhileDragging to always return
NO seems incorrect. Quite frankly I'm puzzled why this is a method on
the source object in the first place, since it's the destination
that's going to have to determine what operation to select based on
the current event's modifier flags when -draggingUpdated: is called.

It would be okay if -ignoreModifierKeysWhileDragging had an isLocal
argument, so I could return YES or NO. Right now I'm stuck stuffing
the argument to -dragSourceOperationMaskForLocal: into an ivar, and
reading that ivar from -ignoreModifierKeysWhileDragging. But this
feels fairly hackish, and I don't see a guarantee that a call to
-ignoreModifierKeysWhileDragging will always be proceeded by a call to
-dragSourceOperationMaskForLocal:.

So, if you wanted to redefine the meaning of modifier flags only for
local drags, would you feel satisfied capturing the argument passed to
-dragSourceOperationMaskForLocal: and returning that value from
-ignoreModifierKeysWhileDragging? Do you agree with me that
-ignoreModifierKeysWhileDragging should either be removed, or also get
an isLocal argument?

Any input (including historical context about the relevant drag API)
is appreciated.

Thanks,
--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: Arbitrary Shaped Windows

2011-04-29 Thread Abhinav K Tyagi

Hi Laurent,

I too agree with you on this. The circular shape i just mention as a  
case.

It can be any shape.

Its just an idea.. good or bad will depend on how and when one finds its
application.

I remember that MSVC++ had a similar thing to set the "shape" of the  
window

but here how to do i am not sure of.

Thanks
Abhinav
On Apr 29, 2011, at 11:30 PM, Laurent Daudelin wrote:


On Apr 29, 2011, at 09:46, Abhinav K Tyagi wrote:


Hi,

How can i create an arbitrary shaped window? Mouse events should be
handled in the shape only and not the rectangular window portion.
For Ex. If my window is circular, then outside the circle, any  
mouse should

go to desktop or whatever is there behind it.
Using borderless and transparent mainwindow i can only display it  
circular

but mouse events still be there in rectangular region which i want to
be only in circular (or whatever defined) region.
If anyone can suggest the best possible way to do it would be great.

After this is done, i would like to dynamically change the window  
shape

depending on user inputs
Thanks in Advance


I think a circular window, or almost any other shaped window, is a  
bad idea. That will confuse the user. In a circular window, where is  
the window title bar?


-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.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: Arbitrary Shaped Windows

2011-04-29 Thread John Joyce

On Apr 29, 2011, at 11:46 AM, Abhinav K Tyagi wrote:

> Hi,
> 
> How can i create an arbitrary shaped window? Mouse events should be
> handled in the shape only and not the rectangular window portion.
> For Ex. If my window is circular, then outside the circle, any mouse should
> go to desktop or whatever is there behind it.
> Using borderless and transparent mainwindow i can only display it circular
> but mouse events still be there in rectangular region which i want to
> be only in circular (or whatever defined) region.
> If anyone can suggest the best possible way to do it would be great.
> 
> After this is done, i would like to dynamically change the window shape
> depending on user inputs
> Thanks in Advance
> 
> 
> Abhinav K Tyagi
> abhityag...@gmail.com
> 
The first place to start tinkering is with the sample code Round Transparent 
Window on the devcenter.

___

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

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

2011-04-29 Thread Fritz Anderson
On 29 Apr 2011, at 11:46 AM, Abhinav K Tyagi wrote:

> How can i create an arbitrary shaped window?

Look for the sample project "RoundTransparentWindow." I found it by typing 
"round window" in the Documentation organizer in Xcode 4. The Documentation 
browser in Xcode 3 should turn up the same thing.

— F

___

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

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

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

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


Re: Arbitrary Shaped Windows

2011-04-29 Thread Bhatnagar, Arvin
Laurent,

Look into subclassing the view and setting up a tracking area.

Thanks,
Arvin

On 4/29/11 2:16 PM, "Abhinav K Tyagi"  wrote:

>Hi Laurent,
>
>I too agree with you on this. The circular shape i just mention as a
>case.
>It can be any shape.
>
>Its just an idea.. good or bad will depend on how and when one finds its
>application.
>
>I remember that MSVC++ had a similar thing to set the "shape" of the
>window
>but here how to do i am not sure of.
>
>Thanks
>Abhinav
>On Apr 29, 2011, at 11:30 PM, Laurent Daudelin wrote:
>
>> On Apr 29, 2011, at 09:46, Abhinav K Tyagi wrote:
>>
>>> Hi,
>>>
>>> How can i create an arbitrary shaped window? Mouse events should be
>>> handled in the shape only and not the rectangular window portion.
>>> For Ex. If my window is circular, then outside the circle, any
>>> mouse should
>>> go to desktop or whatever is there behind it.
>>> Using borderless and transparent mainwindow i can only display it
>>> circular
>>> but mouse events still be there in rectangular region which i want to
>>> be only in circular (or whatever defined) region.
>>> If anyone can suggest the best possible way to do it would be great.
>>>
>>> After this is done, i would like to dynamically change the window
>>> shape
>>> depending on user inputs
>>> Thanks in Advance
>>
>> I think a circular window, or almost any other shaped window, is a
>> bad idea. That will confuse the user. In a circular window, where is
>> the window title bar?
>>
>> -Laurent.
>> -- 
>> Laurent Daudelin
>> AIM/iChat/Skype:LaurentDaudelin  
>> http://www.nemesys-soft.com/
>> Logiciels Nemesys Software   
>> laur...@nemesys-soft.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/arvin.bhatnagar%40verizon
>.com
>
>This email sent to arvin.bhatna...@verizon.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: Arbitrary Shaped Windows

2011-04-29 Thread Hank Heijink (Mailinglists)
Have you looked at this?

http://cocoawithlove.com/2008/12/drawing-custom-window-on-mac-os-x.html

Hank

On Apr 29, 2011, at 2:16 PM, Abhinav K Tyagi wrote:

> Hi Laurent,
> 
> I too agree with you on this. The circular shape i just mention as a case.
> It can be any shape.
> 
> Its just an idea.. good or bad will depend on how and when one finds its
> application.
> 
> I remember that MSVC++ had a similar thing to set the "shape" of the window
> but here how to do i am not sure of.
> 
> Thanks
> Abhinav

___

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

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


Customizing UIActionSheet button accessibility labels.

2011-04-29 Thread Eloy Duran
I have been unable to figure out if and how to customize the labels of the 
buttons in a UIActionSheet. I would have expected it would implement the 
UIAccessibilityContainer protocol, but it doesn't return useful data for any of 
the protocol's methods… What am I missing?

Eloy___

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

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


Binding multiple NSTableView and NSPopupButton to an NSArrayControler

2011-04-29 Thread Lorenzo Thurman
I have an NSTableView column bound to an NSArrayController which itself
is bound to an NSMutableArray. The mutable array resides in a different XIB.
The data is displayed as expected, but when I remove an item, although it
does disappear from the table, the
change is not written to disk when the application quits. I use
NSKeyedArchiver to persist the array to disk upon quitting. When the
application quits, the original array including the removed items is
written to disk.

I did some debugging and found that after the items are removed from the
array controller, the underlying array does indeed reflect the removal,
but something happens between there and quitting the application that
brings the removed items back into the array.

My application also uses an NSPopupButton to display these same items.
It is also bound to the same array controller as the table view column and
resides
in the same XIB as the array and controller.
Can someone enlighten me as to what's happening?

-- 
"My break-dancing days are over, but there's always the funky chicken"
--The Full Monty
___

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

Please do not post admin requests or moderator comments to the list.
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: Binding multiple NSTableView and NSPopupButton to an NSArrayControler

2011-04-29 Thread Quincey Morris
Your description of the problem is a bit fuzzy. Let me nitpick at your 
description -- it may be that if you straighten out your terminology you'll 
solve your problem:

On Apr 29, 2011, at 12:56, Lorenzo Thurman wrote:

> I have an NSTableView column bound to an NSArrayController which itself
> is bound to an NSMutableArray.

No, it's not bound to a NSMutableArray. It's bound to an array *property* of 
some object. If the array controller is in the XIB file, it's typically bound 
to one of File's Owner's properties.

> The mutable array resides in a different XIB.

Almost certainly not. At least, I hope not. Why would you put a mutable array 
in a XIB? A mutable array is likely used as the backing store of an array 
property of an object in your data model (or possibly of a controller object).

> The data is displayed as expected, but when I remove an item, although it
> does disappear from the table, the
> change is not written to disk when the application quits. I use
> NSKeyedArchiver to persist the array to disk upon quitting. When the
> application quits, the original array including the removed items is
> written to disk.

Which array? We haven't actually located the array yet. You might inadvertently 
have 2 arrays where you only intend there to be one.

> I did some debugging and found that after the items are removed from the
> array controller, the underlying array does indeed reflect the removal,
> but something happens between there and quitting the application that
> brings the removed items back into the array.

Another possibility is that you really did put an array into a XIB, which means 
the *same* array contents will be reloaded from the XIB every time that XIB is 
loaded. Are you sure "the array" isn't being written correctly to your 
persistent store? Perhaps it is, but the written value isn't being reloaded 
next time?

> My application also uses an NSPopupButton to display these same items.

Is this just additional information, or are you saying there's an issue with 
the the popup button too?


___

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

Please do not post admin requests or moderator comments to the list.
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: Aliases with NDAlias not appearing where I tell them to be.

2011-04-29 Thread Sean McBride
On Fri, 29 Apr 2011 12:31:07 -0400, Kevin Muldoon said:

>I'm still fuzzy on the real function of 'fromPath:'. It's equiv in
>FSNewAlias() appears to be fromFile which is defined as 'A pointer to the
>starting point for a relative search...'

That's right.

>and could be given a NULL value (at
>least in fromFile). Of course my fuzziness on 'relative search' may stem
>from my complete non-understanding of 'alias records'. It's all quite
>overwhelming really.

Using null is typical I'd say.

--

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


Re: FSCatalogInfo's dataPhysicalSize shows constant wrong size for all files on a network drive?

2011-04-29 Thread Laurent Daudelin
On Apr 29, 2011, at 11:10, Oleg Krupnov wrote:

> Hi,
> 
> My program determines sizes of all files in a particular folder on
> some drive. I use FSCatalogInfo + FSGetCatalogInfoBulk. I am
> interested in physical size, so I use the dataPhysicalSize field.
> 
> My code works fine on pretty much all disks I have ever tested.
> However, some users report that in rare cases, for some network
> drives, formatted for Windows, the reported file sizes are totally
> wrong. When I checked the log, I've found out that my program reports
> physical sizes of all files equal to 1048576 (2^20), without respect
> of their actual size. The stranger part of it is that the logical
> sizes of the same files (the dataLogicalSize field) are reported
> correctly.
> 
> The problem is very hard to reproduce. It does not occur on ALL
> network drives, and does not occur on ALL windows drives, and not even
> on ALL network Windows drives, but only on SOME network Windows
> drives. I am puzzled, what can the problem be caused by? Or at least,
> can I somehow detect such problematic drives in advance?

I've been dealing with Windows shares and support in Leopard/Snow Leopard is 
not very good for them. I know for a fact that the modification time is always 
off by a few seconds. And copying files from/to Windows shares is also 
problematic. What seems to help is to make sure that, on the Windows side, the 
user gives everybody full permissions on what he's sharing.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.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


delete entries in a tableView with the backspace-key on the keyboard

2011-04-29 Thread Martin Batholdy
Hi,


I have a tableView and a MutableArray as DataSource.

Below the tableView I have a delete button to delete selected entries.
That works fine. The entries disappear when pressing the delete button.

Now I would like to achieve the same effect with a press on the 
backspace-button.

How can I link this action (pressing the backspace key on the keyboard) to the 
delete-method?


thanks!

___

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

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

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

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


Re: delete entries in a tableView with the backspace-key on the keyboard

2011-04-29 Thread Sean McBride
On Fri, 29 Apr 2011 23:13:53 +0200, Martin Batholdy said:

>Below the tableView I have a delete button to delete selected entries.
>That works fine. The entries disappear when pressing the delete button.
>
>Now I would like to achieve the same effect with a press on the
>backspace-button.
>
>How can I link this action (pressing the backspace key on the keyboard)
>to the delete-method?

See:


--

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


iOS internaltional dialing plan

2011-04-29 Thread Fluffy D. Bunny
Hi All,

I just inherited a new iphone app that is being used internationally.
This app has an issue where non-us users are unable to click on
numbers in the app and have them dial. The numbers are formatted such
as +44 00 00  etc. It takes the number strips the spaces,
formatting and plus sign ans send it out in url (tel:) format to be dialed.
It only works in the us though.

My question is how are others dialing number world-wide? Any pointers
or info would be greatly appreciated. Also would love to know if there
any kits, blocks etc that handle this.

Thanks much!
___

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

Please do not post admin requests or moderator comments to the list.
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: Scroll view within scroll view blocks scrolling

2011-04-29 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 4/28/11 8:27 PM, Indragie Karunaratne wrote:
> Notice that in my code I'm making a call to super, so using the above
> code, scrolling inside the text view would scroll both the parent
> scroll view and the text view scroll view at the same time. In my
> case, 2) was the only important thing for me because my text views
> don't scroll vertically (only horizontally). You could make it behave
> like Safari by using an NSTimer to create the "cooling off" period,
> but this simple workaround was good enough for my needs :)

D'oh... somehow my eye skipped right past the call to super and landed
on nextResponder.  You are of course quite right.

Now I understand how this solution meets your needs, though I would
probably spend a bit of time implementing a timer so that six months
from now, when the requirements change, I'm not scratching my head and
wondering,  "how did this work again?"

:-)

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFNuzsGaOlrz5+0JdURAo4IAJwOjgc7BCUwcrnrxYR6vlxhpyABQQCeNuV5
7pI17CEA54nY/TBdNEVVsxE=
=73gG
-END PGP SIGNATURE-
___

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

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

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

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


Changing UISwitch text

2011-04-29 Thread Jon Sigman
Is there a straightforward way to change the text on the UISwitch ("ON" and 
"OFF") to something else? Alternatively, is there a way for a UIButton to act 
like a toggle (it stays highlighted until touched again)?
iOS 4.3
___

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

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

2011-04-29 Thread Luke Hiesterman
Neither of those things are possible with UISwitch. You'd have to write your 
won UIControl subclass.

Luke

On Apr 29, 2011, at 4:29 PM, Jon Sigman wrote:

> Is there a straightforward way to change the text on the UISwitch ("ON" and 
> "OFF") to something else? Alternatively, is there a way for a UIButton to act 
> like a toggle (it stays highlighted until touched again)?
> iOS 4.3
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com
> 
> This email sent to luket...@apple.com

___

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

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

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

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


Re: Changing UISwitch text

2011-04-29 Thread Dave DeLong

On Apr 29, 2011, at 4:29 PM, Jon Sigman wrote:

> Is there a straightforward way to change the text on the UISwitch ("ON" and 
> "OFF") to something else?

No, there is not.  UISwitch is not customizable.

> Alternatively, is there a way for a UIButton to act 
> like a toggle (it stays highlighted until touched again)?

No, but either the -highlighted or -selected property (I forget which) of 
UIButton can be set independently of the touch handling.  Or you could find a 
3rd party UISwitch replacement that does allow customization (there was a 
question about this a month or two ago).

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


Re: delete entries in a tableView with the backspace-key on the keyboard

2011-04-29 Thread Peter Lübke

Am 29.04.2011 um 23:19 schrieb Sean McBride:


See:



Sean,
is there a special reason why the sample code is working with [event  
characters]?

I've merely been doing
if ( [event keyCode] == 51) {
... }
to determine if the backspace key was pressed to delete a table row.

Is this a bad idea? Is the keycode for the backspace key possibly  
subject to changes?


- Peter

___

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

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

2011-04-29 Thread Roger Dalal
Jon:

UISwitch can not be customized. This question was asked a few weeks ago, and I 
recommended http://osiris.laya.com/projects/rcswitch/ by Sascha Hoehne and 
Robert Chin. 

If you wish to use a UIButton as a toggle, just change the button's image 
property to alternating states, as in:

if (condition)  
{
 [self.button setImage:offButtonImage forState:UIControlStateNormal];
condition == NO;
}
else 
{
[self.button setImage:onButtonImage forState:UIControlStateNormal]; 
condition == YES;
}

GoodLuck.

Roger Dalal
Assembled Apps


On Apr 29, 2011, at 7:29 PM, Jon Sigman wrote:

> Is there a straightforward way to change the text on the UISwitch ("ON" and 
> "OFF") to something else? Alternatively, is there a way for a UIButton to act 
> like a toggle (it stays highlighted until touched again)?
> iOS 4.3
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/roger.dalal%40gmail.com
> 
> This email sent to roger.da...@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: Changing UISwitch text

2011-04-29 Thread Jon Sigman
Thanks Peter, Dave, Roger. These are all good approaches!




From: Roger Dalal 
To: Jon Sigman 
Cc: cocoa-dev@lists.apple.com
Sent: Fri, April 29, 2011 4:41:36 PM
Subject: Re: Changing UISwitch text


Jon:


UISwitch can not be customized. This question was asked a few weeks ago, and I 
recommended http://osiris.laya.com/projects/rcswitch/ by Sascha Hoehne and 
Robert Chin. 

If you wish to use a UIButton as a toggle, just change the button's image 
property to alternating states, as in:

if(condition)
{
 [self.buttonsetImage:offButtonImage forState:UIControlStateNormal];
condition == NO;
}
else 
{
[self.button setImage:onButtonImage forState:UIControlStateNormal]; 
condition == YES;
}

GoodLuck.

Roger Dalal
Assembled Apps


On Apr 29, 2011, at 7:29 PM, Jon Sigman wrote:

Is there a straightforward way to change the text on the UISwitch ("ON" and 
>"OFF") to something else? Alternatively, is there a way for a UIButton to act 
>like a toggle (it stays highlighted until touched again)?
>iOS 4.3
>___
>
>Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
>Please do not post admin requests or moderator comments to the list.
>Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
>Help/Unsubscribe/Update your Subscription:
>http://lists.apple.com/mailman/options/cocoa-dev/roger.dalal%40gmail.com
>
>This email sent to roger.da...@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: Changing UISwitch text - correction

2011-04-29 Thread Roger Dalal
CORRECTION: Obviously, that would be 

condition = NO;
condition = YES;

How embarrassing. Sorry list.

Roger


On Apr 29, 2011, at 7:41 PM, Roger Dalal wrote:

> Jon:
> 
> UISwitch can not be customized. This question was asked a few weeks ago, and 
> I recommended http://osiris.laya.com/projects/rcswitch/ by Sascha Hoehne and 
> Robert Chin. 
> 
> If you wish to use a UIButton as a toggle, just change the button's image 
> property to alternating states, as in:
> 
> if (condition)
> {
>  [self.button setImage:offButtonImage forState:UIControlStateNormal];
> condition == NO;
> }
> else 
> {
> [self.button setImage:onButtonImage forState:UIControlStateNormal]; 
> condition == YES;
> }
> 
> GoodLuck.
> 
> Roger Dalal
> Assembled Apps
> 
> 
> On Apr 29, 2011, at 7:29 PM, Jon Sigman wrote:
> 
>> Is there a straightforward way to change the text on the UISwitch ("ON" and 
>> "OFF") to something else? Alternatively, is there a way for a UIButton to 
>> act 
>> like a toggle (it stays highlighted until touched again)?
>> iOS 4.3
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/roger.dalal%40gmail.com
>> 
>> This email sent to roger.da...@gmail.com
> 

___

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

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

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

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


Re: Using affine transforms

2011-04-29 Thread Graham Cox

On 30/04/2011, at 1:01 AM, McLaughlin, Michael P. wrote:

> appeared to have applied the transform to the path linewidth as well.  Is
> this how it is supposed to work?

Yes. A transform scales the whole drawing coordinate system, so the stroke 
width is scaled as well.

> Since this would seem to be a common task, is there a recommended way to
> keep linewidth = 1 (and likewise for data-point circles) or would I be
> better off just doing the transformations "manually" beforehand?


You can either a) compensate the linewidth by the inverse of the scale,  b) use 
a linewidth of 0, which will draw a 1-pixel wide line regardless of scale. 
However, this latter approach is not such a good idea if the view can be 
printed, because 1-pixel on a high resolution printer is extremely fine, or c) 
if your graph data is in the form of a path, you can scale the path by the 
transform rather than scale the view, then it will have the stroke width you 
give it. See [NSBezierPath transformUsingAffineTransform;] or 
[NSAffineTransform transformBezierPath:]

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