Re: Crashes while reordering columns in a NSTableView

2009-07-22 Thread Rob Keniger


On 22/07/2009, at 2:42 AM, Nick Zitzmann wrote:

One thought: Are you using the -CGImage method of NSBitmapImageRep  
anywhere? If so, then you absolutely must not deallocate the  
NSBitmapImageRep while the CGImageRef is live, because the  
CGImageRef acquired via -CGImage is still using the  
NSBitmapImageRep's data.



Hm, that's interesting. I'm using Garbage Collection, so does this  
mean that I can't do this and get away with it?:


@implementation NSImage (Additions)
- (CGImageRef)CGImage;
{
	return [[[NSBitmapImageRep alloc] initWithData:[self  
TIFFRepresentation]] CGImage];

}
@end

Could explain a few things...

--
Rob Keniger



___

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

Please do not post admin requests or moderator comments to the list.
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 iPhone SDK OpenGL ES Application template

2009-07-22 Thread Wilson Chen
Thank you David for the tip!


On Wed, Jul 22, 2009 at 5:11 AM, David Duncan david.dun...@apple.comwrote:

 On Jul 21, 2009, at 10:18 AM, Wilson Chen wrote:

  My question is: since an EAGLView is a subclass of UIView, is there a
 particular reason for the template to not follow the common pattern to
 adhere the beloved MVC?



 There is really no difference in if you want to have the view controller or
 not. About the only thing to keep in mind is that if you do use a view
 controller, don't use the orientation change support.
 --
 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


Recording phone calls

2009-07-22 Thread Mahaboob
Is it possible to develop an application for recording phone calls?
I'm using iPhone OS 2.2.

Thanks in advance
Mahaboob


___

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

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

2009-07-22 Thread Roland King
No. Not using published APIs in 2.2 (or 3.0). No access to the phone 
piece whatsoever.



Mahaboob wrote:

Is it possible to develop an application for recording phone calls?
I'm using iPhone OS 2.2.

Thanks in advance
Mahaboob


___

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

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

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

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

___

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

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

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

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


Re: Recording phone calls

2009-07-22 Thread John C. Randolph


On Jul 22, 2009, at 2:19 AM, Mahaboob wrote:


Is it possible to develop an application for recording phone calls?


Possible?  Maybe.  Supported?  No.

-jcr

___

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

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


Apple's Reducer Example

2009-07-22 Thread Andreas Zeitler

Hi,

I am currently writing something VERY similiar to Apple's Reducer App:
http://developer.apple.com/SampleCode/Reducer/index.html

I'm a Noob and have re-written the code to fit my needs (which is just  
the rescaling part) to my needs but there is one Binding i can't get  
working.
I can't open the Nib file (it needs the IB Plugin/Palette which comes  
with the project but can't be compiled)


So i need someone who is kind enough to have a look at the Apple Code  
(and maybe mine) to tell how i have to set up the Bindings for the  
Filetype Popup Menu.


In this ZIP file you will find two project:

* One's called Reducer, which is Apple's original Reducer.app
* The other on is called Reduzer which is my rewrite.

http://music.zettt.de/tmp/reducer.zip

Thanks,
Zettt
___

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

Please do not post admin requests or moderator comments to the list.
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 default button cell in Cocoa Application

2009-07-22 Thread Kerms Technical Services
I have a window winUser with two buttons bntEnter and bntBuild.  
I am trying to switch the default button between the two as the  
program progresses.


Initially both buttons are disabled. After the user enters some text  
fields I  set bntEnter as the default with

[winUser setDefaultButtonCell:[btnEnter cell]];
which works fine. The button highlights and acts on Return key.

In the Enter handler I attempt to switch to bntBuild as the  
default button cell using:

[winUser setDefaultButtonCell:[btnBuild cell]];

The Build button highlights but when I press Return key the  
Enter button flashes and the Enter  handler is called, NOT the  
Build handler.


I put in debug code to query and log the winUser's default button cell  
at IT reports the (desired) values of btnEnter and btnBuild  
respectively. It seems that once the default is set it cannot be  
changed.


I am developing with XCode 3.1.2 in Leopard but targeting to 10.4.

I have tried disabling and enabling the default button cell as part of  
the process, and using setKeyEquivalent but always get the same  
result.


Is there more to switching the default button cell than  
setDefaultButton?


Help 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: Recording phone calls

2009-07-22 Thread Jonathan del Strother
Well, technically I suppose the user could start a phone call, then
hit the home button  launch your recording app, then you could start
recording whatever the microphone picks up...

On Wed, Jul 22, 2009 at 10:26 AM, Roland Kingr...@rols.org wrote:
 No. Not using published APIs in 2.2 (or 3.0). No access to the phone piece
 whatsoever.


 Mahaboob wrote:

 Is it possible to develop an application for recording phone calls?
 I'm using iPhone OS 2.2.

 Thanks in advance
 Mahaboob


 ___

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

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

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

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

 ___

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

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

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

 This email sent to maill...@steelskies.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: Found Re: List FAQ and Cocoa learning resources

2009-07-22 Thread Alastair Houghton

On 21 Jul 2009, at 19:22, Erik Buck wrote:


Sorry.  Right after I posted, I found http://www.cocoadev.com/index.pl?FAQs


I should add, since the top link on that page is mine, that I haven't  
updated that document for ages, and while it covers some basic things  
and links to some other useful documents, there's a lot of newer stuff  
(notably things like Core Data, and ObjC 2 features like properties  
and fast enumeration) that just aren't covered.


It'd be nice to have an official FAQ for the list...

Kind regards,

Alastair.

--
http://alastairs-place.net



___

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

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

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

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


Re: Recording phone calls

2009-07-22 Thread Mahaboob
I did like this, but the voice is not getting recorded while I'm making a
call. 

If I developed this application, will apple store approve this?

On 7/22/09 3:06 PM, Jonathan del Strother maill...@steelskies.com wrote:

 Well, technically I suppose the user could start a phone call, then
 hit the home button  launch your recording app, then you could start
 recording whatever the microphone picks up...
 
 On Wed, Jul 22, 2009 at 10:26 AM, Roland Kingr...@rols.org wrote:
 No. Not using published APIs in 2.2 (or 3.0). No access to the phone piece
 whatsoever.
 
 
 Mahaboob wrote:
 
 Is it possible to develop an application for recording phone calls?
 I'm using iPhone OS 2.2.
 
 Thanks in advance
 Mahaboob
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
 
 This email sent to r...@rols.org
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/maillist%40steelskies.com
 
 This email sent to maill...@steelskies.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: Recording phone calls

2009-07-22 Thread Roland King
well that's impossible to say and not a cocoa question. If you use only 
public APIs and satisfy the other store conditions then I don't see why 
not. But you really cannot say and I've certainly not read the app 
conditions document recently.


If it worked just grabbing from the microphone, the built-in voice 
recording app would do this but that explicitly disables that when 
you're on a call.


Mahaboob wrote:

I did like this, but the voice is not getting recorded while I'm making a
call. 


If I developed this application, will apple store approve this?

On 7/22/09 3:06 PM, Jonathan del Strother maill...@steelskies.com wrote:



Well, technically I suppose the user could start a phone call, then
hit the home button  launch your recording app, then you could start
recording whatever the microphone picks up...

On Wed, Jul 22, 2009 at 10:26 AM, Roland Kingr...@rols.org wrote:


No. Not using published APIs in 2.2 (or 3.0). No access to the phone piece
whatsoever.


Mahaboob wrote:


Is it possible to develop an application for recording phone calls?
I'm using iPhone OS 2.2.

Thanks in advance
Mahaboob


___

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

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

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

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


___

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

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

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

This email sent to maill...@steelskies.com





___

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

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

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

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

___

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

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

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

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


Re: Recording phone calls

2009-07-22 Thread Kyle Sluder

On Jul 22, 2009, at 3:12 AM, Mahaboob mahab...@newtok.com wrote:


If I developed this application, will apple store approve this?


None of us is in any position to speculate about the actions of the  
App Store approval team on a hypothetical application.


But it is important to note that wiretapping laws in the Unites States  
vary from state to state, and most states require the consent of both  
parties for one party to record the conversation. Apple might want to  
limit their liability in this regard.


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


dragging to move objects around?

2009-07-22 Thread Darren Minifie
Hi

I am trying to implement the ability to move subviews around a view by
dragging them.  The simple code I have thus far:

- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint
operation:(NSDragOperation)operation{
[self setFrameOrigin:[self convertPointFromBase:aPoint]];
}

Here the image that is moving about is an exact copy of the original
subview.  When the endedAt method executes, I would like the subview's frame
to be changed to where the last position of the dragged image was.  The code
I have thus far is producing some undpredictable results.  for example, i'll
drag the subview straight down ( no change in x) but the subview will be
moved somehwere far to the left or right.

-- 
Darren Minifie
Computer Science Masters Candidate
University of Victoria, BC. Canada
My Rants: www.noisyair.com
My Band: 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


Re: Changing default button cell in Cocoa Application

2009-07-22 Thread Dave Fernandes
You can make this change without using setDefaultButtonCell at all.  
Just make sure you change btnEnter's key equivalent to be something  
other than return before changing btnBuild's to be return.


[btnEnter setKeyEquivalent:@];
[btnBuild setKeyEquivalent:@\r];


On Jul 21, 2009, at 11:43 AM, Kerms Technical Services wrote:

I have a window winUser with two buttons bntEnter and  
bntBuild. I am trying to switch the default button between the  
two as the program progresses.


Initially both buttons are disabled. After the user enters some text  
fields I  set bntEnter as the default with

[winUser setDefaultButtonCell:[btnEnter cell]];
which works fine. The button highlights and acts on Return key.

In the Enter handler I attempt to switch to bntBuild as the  
default button cell using:

[winUser setDefaultButtonCell:[btnBuild cell]];

The Build button highlights but when I press Return key the  
Enter button flashes and the Enter  handler is called, NOT the  
Build handler.


I put in debug code to query and log the winUser's default button  
cell at IT reports the (desired) values of btnEnter and btnBuild  
respectively. It seems that once the default is set it cannot be  
changed.


I am developing with XCode 3.1.2 in Leopard but targeting to 10.4.

I have tried disabling and enabling the default button cell as part  
of the process, and using setKeyEquivalent but always get the same  
result.


Is there more to switching the default button cell than  
setDefaultButton?


Help 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/dave.fernandes%40utoronto.ca

This email sent to dave.fernan...@utoronto.ca


___

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

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

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

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


When saving the managed object context

2009-07-22 Thread Squ Aire

How can I do some custom stuff before my NSManagedObjectContext saves? (I want 
to cleanup some garbage that might get created while my app is running). In 
my case this would be faster to do than override my NSManagedObject 
didTurnIntoFault.

So, to do this, is it safe for me to subclass NSManagedObjectContext and 
override save:? Or is this one of those methods I should not override? Any 
better ways?
_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx___

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

Please do not post admin requests or moderator comments to the list.
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: dragging to move objects around?

2009-07-22 Thread Greg Titus

Hi Darren,

The point passed into -draggedImage:endedAt:operation: is in screen  
coordinates, which is different from the window base coordinates that - 
convertPointFromBase: expects. You want to convert from screen to  
base, and then from base to your superview's coordinate system  
(because the frame rect that you are setting is in terms of your  
superview's coordinates):


aPoint = [[self window] convertScreenToBase:aPoint];
aPoint = [[self superview] convertPointFromBase:aPoint];
[self setFrameOrigin:aPoint];

I'll also mention that what you are doing here is not what is  
generally intended by the dragged image protocol. It is usually used  
for things like dragging icons or URLs to different apps/windows. If  
you want to move something around within a single view you'd generally  
detect what you clicked on in -mouseDown: and track the mouse in - 
mouseDragged:. You can reset your view's frame on every mouseDragged:  
call, so that the user will see the original view being moved around  
on your view instead of an image lifted up from your window and  
dragged anywhere on screen and then dropped.


Hope this helps,
- Greg

On Jul 22, 2009, at 4:27 AM, Darren Minifie wrote:


Hi

I am trying to implement the ability to move subviews around a view by
dragging them.  The simple code I have thus far:

- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint
operation:(NSDragOperation)operation{
   [self setFrameOrigin:[self convertPointFromBase:aPoint]];
}

Here the image that is moving about is an exact copy of the original
subview.  When the endedAt method executes, I would like the  
subview's frame
to be changed to where the last position of the dragged image was.   
The code
I have thus far is producing some undpredictable results.  for  
example, i'll
drag the subview straight down ( no change in x) but the subview  
will be

moved somehwere far to the left or right.

--
Darren Minifie
Computer Science Masters Candidate
University of Victoria, BC. Canada
My Rants: www.noisyair.com
My Band: 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/greg%40omnigroup.com

This email sent to g...@omnigroup.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: When saving the managed object context

2009-07-22 Thread mmalc Crawford


On Jul 22, 2009, at 7:22 AM, Squ Aire wrote:


How can I do some custom stuff before my NSManagedObjectContext saves?


Register for NSManagedObjectContextWillSaveNotification.

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: Recording phone calls

2009-07-22 Thread Alex Kac

Recorder on the app store does it.

-- CEO WebIS
Sent from my phone

On Jul 22, 2009, at 4:26 AM, Roland King r...@rols.org wrote:

No. Not using published APIs in 2.2 (or 3.0). No access to the phone  
piece whatsoever.



Mahaboob wrote:

Is it possible to develop an application for recording phone calls?
I'm using iPhone OS 2.2.
Thanks in advance
Mahaboob
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
This email sent to r...@rols.org

___

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

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

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

This email sent to a...@webis.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: When saving the managed object context

2009-07-22 Thread Squ Aire

I see no such thing in my docs. Only DidSave. Not WillSave.


 From: mmalc_li...@me.com
 Date: Wed, 22 Jul 2009 07:54:30 -0700
 To: cocoa-dev@lists.apple.com
 Subject: Re: When saving the managed object context


 On Jul 22, 2009, at 7:22 AM, Squ Aire wrote:

 How can I do some custom stuff before my NSManagedObjectContext saves?

 Register for NSManagedObjectContextWillSaveNotification.

 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/squ4r3%40live.com

 This email sent to squ...@live.com

_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx___

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

Please do not post admin requests or moderator comments to the list.
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: When saving the managed object context

2009-07-22 Thread mmalc Crawford


On Jul 22, 2009, at 8:05 AM, Squ Aire wrote:

On Jul 22, 2009, at 7:22 AM, Squ Aire wrote:
How can I do some custom stuff before my NSManagedObjectContext  
saves?

Register for NSManagedObjectContextWillSaveNotification.

I see no such thing in my docs. Only DidSave. Not WillSave.


Sorry, I've got used to answering iPhone-related questions...

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: dragging to move objects around?

2009-07-22 Thread Erik Buck
I didn't see any actual question.  I think you also need to post more code if 
you want anything better than wild guesses about what you are doing.

Start here: 
http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html

I assume you are using - (void)dragImage:(NSImage *)anImage 
at:(NSPoint)imageLoc offset:(NSSize)mouseOffset event:(NSEvent *)theEvent 
pasteboard:(NSPasteboard *)pboard source:(id)sourceObject 
slideBack:(BOOL)slideBack

What offset are you using, and does that account for changes in x position?

___

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

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

2009-07-22 Thread Roland King
not really, not if we're talking about the same app. The one I've seen  
pushes calls through an external service and the recording is done  
there ...


Can Recorder record phone calls?
Yes. Recorder 10 can record outgoing calls through an external  
service. Because we have to work directly with the phone company to do  
this, there is a per minute charge, and it only works in the US for now.




On Jul 22, 2009, at 11:03 PM, Alex Kac wrote:


Recorder on the app store does it.

-- CEO WebIS
Sent from my phone

On Jul 22, 2009, at 4:26 AM, Roland King r...@rols.org wrote:

No. Not using published APIs in 2.2 (or 3.0). No access to the  
phone piece whatsoever.



Mahaboob wrote:

Is it possible to develop an application for recording phone calls?
I'm using iPhone OS 2.2.
Thanks in advance
Mahaboob
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
This email sent to r...@rols.org

___

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

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

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

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


NSSlider with multiple values?

2009-07-22 Thread ALEXander

Hello all,

I have an NSSlider which can relate to multiple different values. What  
would be a good way of showing the user that if the touches the slider  
he will change all these values to the value on the slider? Like the  
dash in an NSCheckBox, but just for NSSlider.


Best, ALEXander.
___

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

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


UUID method Garbage Collection safe?

2009-07-22 Thread Squ Aire

I've been using this method to make UUID strings:

+ (NSString *)stringWithUUID{  CFUUIDRef uuidObj = CFUUIDCreate(nil);
NSString *uuidString = (NSString*)CFUUIDCreateString(nil,uuidObj);  
CFRelease(uuidObj);  return [uuidString autorelease];}

How do you all like it? Is it ok? It's based on some code I Googled a while 
back. In particular, is this code perfectly garbage collection safe?
_
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx___

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

Please do not post admin requests or moderator comments to the list.
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: UUID method Garbage Collection safe?

2009-07-22 Thread Julien Jalon
Correct code is:
+ (NSString *)stringWithUUID{  CFUUIDRef uuidObj = CFUUIDCreate(nil);
 NSString *uuidString =
(NSString*)NSMakeCollectable(CFUUIDCreateString(nil,uuidObj));
 CFRelease(uuidObj);  return [uuidString autorelease];}

Or you will leak in GC.

-- 
Julien

On Wed, Jul 22, 2009 at 6:45 PM, Squ Aire squ...@live.com wrote:


 I've been using this method to make UUID strings:

 + (NSString *)stringWithUUID{  CFUUIDRef uuidObj = CFUUIDCreate(nil);
  NSString *uuidString = (NSString*)CFUUIDCreateString(nil,uuidObj);
  CFRelease(uuidObj);  return [uuidString autorelease];}

 How do you all like it? Is it ok? It's based on some code I Googled a while
 back. In particular, is this code perfectly garbage collection safe?
 _
 Show them the way! Add maps and directions to your party invites.

 http://www.microsoft.com/windows/windowslive/products/events.aspx___

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

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

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

 This email sent to jja...@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: AppleScript Record and NSDictionary

2009-07-22 Thread has

Steve Cronin wrote:


From my Cooca app I want to call an AppleScript with several
parameters one of which is an AppleScript record.

I've got everything about calling and return values working smoothly.

What I can't seem to get is how to create that parameter record.


ObjC-appscript's AEMCodecs class provides two-way mappings between  
NSDictionaries and other common Foundation classes and their  
NSAppleEventDescriptor equivalents. There's also an example project in  
the svn repository showing how it can be used in conjunction with  
NSAppleScript. When specifying record keys in your NSDictionary, use  
AEMType instances to signify AppleScript-defined property names, and  
NSStrings for user-defined identifiers.


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

___

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

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

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

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


List classes in Bundle?

2009-07-22 Thread Robert Mullen
Is there a way to actually list all the classes in a given bundle? I  
know I can look one up if I know the name but I would like to actually  
be able to present a list.

___

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

Please do not post admin requests or moderator comments to the list.
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: List classes in Bundle?

2009-07-22 Thread glenn andreas


On Jul 22, 2009, at 12:00 PM, Robert Mullen wrote:

Is there a way to actually list all the classes in a given bundle? I  
know I can look one up if I know the name but I would like to  
actually be able to present a list.


If the bundle is loaded, you should be able to iterate through all the  
classes in the system  (using the various routines in the runtime),  
and check to see if bundleForClass returns the bundle you are looking  
for.


If it hasn't been loaded, you can parse the macho file format and  
examine the objective-c sections, but that's a lot of work...



Glenn Andreas  gandr...@gandreas.com
 http://www.gandreas.com/ wicked fun!
Mad, Bad, and Dangerous to Know

___

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

Please do not post admin requests or moderator comments to the list.
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: UUID method Garbage Collection safe?

2009-07-22 Thread Keith Duncan

Or just use [[NSProcessInfo processInfo] globallyUniqueString]

Keith

On 22 Jul 2009, at 17:53, Julien Jalon wrote:


Correct code is:
+ (NSString *)stringWithUUID{  CFUUIDRef uuidObj = CFUUIDCreate(nil);
NSString *uuidString =
(NSString*)NSMakeCollectable(CFUUIDCreateString(nil,uuidObj));
CFRelease(uuidObj);  return [uuidString autorelease];}

Or you will leak in GC.

--  
Julien


On Wed, Jul 22, 2009 at 6:45 PM, Squ Aire squ...@live.com wrote:



I've been using this method to make UUID strings:

+ (NSString *)stringWithUUID{  CFUUIDRef uuidObj = CFUUIDCreate(nil);
NSString *uuidString = (NSString*)CFUUIDCreateString(nil,uuidObj);
CFRelease(uuidObj);  return [uuidString autorelease];}

How do you all like it? Is it ok? It's based on some code I Googled  
a while

back. In particular, is this code perfectly garbage collection safe?
_
Show them the way! Add maps and directions to your party invites.

http://www.microsoft.com/windows/windowslive/products/events.aspx___

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

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

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

This email sent to jja...@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/keith_dev%40mac.com

This email sent to keith_...@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: List classes in Bundle?

2009-07-22 Thread Keith Duncan
I've not used it but I recalled a runtime function  
objc_copyClassNamesForImage() which you might be able to use to  
localise your search to a specific bundle (instead of enumerating all  
the Objective-C classes).


Keith

On 22 Jul 2009, at 18:05, glenn andreas wrote:



On Jul 22, 2009, at 12:00 PM, Robert Mullen wrote:

Is there a way to actually list all the classes in a given bundle?  
I know I can look one up if I know the name but I would like to  
actually be able to present a list.


If the bundle is loaded, you should be able to iterate through all  
the classes in the system  (using the various routines in the  
runtime), and check to see if bundleForClass returns the bundle you  
are looking for.


If it hasn't been loaded, you can parse the macho file format and  
examine the objective-c sections, but that's a lot of work...



Glenn Andreas  gandr...@gandreas.com
http://www.gandreas.com/ wicked fun!
Mad, Bad, and Dangerous to Know

___

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

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

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

This email sent to keith_...@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: List classes in Bundle?

2009-07-22 Thread Jean-Daniel Dupas


You can listen NSBundleDidLoadNotification notifications. it contains  
@NSLoadedClasses key in the userinfo dictionary.


This probably won't work for frameworks loaded at launch time, but may  
be helpful in some cases.



Le 22 juil. 09 à 19:29, Keith Duncan a écrit :

I've not used it but I recalled a runtime function  
objc_copyClassNamesForImage() which you might be able to use to  
localise your search to a specific bundle (instead of enumerating  
all the Objective-C classes).


Keith

On 22 Jul 2009, at 18:05, glenn andreas wrote:



On Jul 22, 2009, at 12:00 PM, Robert Mullen wrote:

Is there a way to actually list all the classes in a given bundle?  
I know I can look one up if I know the name but I would like to  
actually be able to present a list.


If the bundle is loaded, you should be able to iterate through all  
the classes in the system  (using the various routines in the  
runtime), and check to see if bundleForClass returns the bundle you  
are looking for.


If it hasn't been loaded, you can parse the macho file format and  
examine the objective-c sections, but that's a lot of work...



Glenn Andreas  gandr...@gandreas.com
http://www.gandreas.com/ wicked fun!
Mad, Bad, and Dangerous to Know

___

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

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

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

This email sent to keith_...@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/devlists%40shadowlab.org

This email sent to devli...@shadowlab.org



___

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

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

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

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


Re: GC'd app that keeps growing and growing

2009-07-22 Thread Bill Bumgarner

On Jul 22, 2009, at 10:30 AM, Tarek Khouzam wrote:
So here is my issue. I have an app that when it should have hit the  
limit of memory it needs to use, it keeps growing over time.


But after 12 hours or so its memory grows about 10x. So what I would  
like to know is where I should go from here? GC should be taking  
care of freeing unneeded memory. I can't use the old apps like leaks  
because its not valid anymore. Is there a technique or app that can  
show me what object is using all the memory

?
Basically I am at wits end. I have tried Instruments but I have a  
better chance of reading Chinese then understanding what Instruments  
is tell me.  Any help would be greatly appreciated.


(This should be on Cocoa-dev)

If you have access to Snow Leopard, use it for your analysis work.   
The tool chain on Snow Leopard is vastly improved.


Under GC, you can still create situations that lead to heap bloat (to  
the point of causing a crash).  Basically, if you have objects that  
are rooted -- are referenced by some global object somewhere, a global  
NSMutableArray* or a cache or something -- or if you call CFRetain()  
(or CF*Create*(), which returns a retained object) on an object and  
don't call CFMakeCollectable() or CFRelease().


Your analysis should focus on what is sticking around that shouldn't.   
With Instruments, the easiest approach is to use the ObjectAlloc  
instrument -- ObjectGraph will work, too, but ObjectAlloc is better  
for analyzing overall allocation populations.


Try using the filter field at the bottom and look for whatever it is  
that is sticking around that shouldn't be.  Given the consistent  
growth over time, it should be pretty obvious.


Or you can use the 'heap' command line tool.   Take a 'heap' snapshot  
shortly after lunch, then again after a few hours and compare the two.


Once you have identified something, anything, that is sticking around,  
figure out where it is being allocated and/or retained.  This is  
easily done with the ObjectAlloc instrument or you can set the  
MallocStackLoggingNoCompact environment variable and then use the  
malloc_history tool (see the malloc and malloc_history man pages).


b.bum

___

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

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

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

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


Re: Cocoa-dev Digest, Vol 6, Issue 1051

2009-07-22 Thread Karl Moskowski


On Jul 22, 2009, at 10:30 AM, Tarek Khouzam wrote:

So here is my issue. I have an app that when it should have hit the
limit of memory it needs to use, it keeps growing over time.

But after 12 hours or so its memory grows about 10x. So what I would
like to know is where I should go from here? GC should be taking
care of freeing unneeded memory. I can't use the old apps like leaks
because its not valid anymore. Is there a technique or app that can
show me what object is using all the memory
?
Basically I am at wits end. I have tried Instruments but I have a
better chance of reading Chinese then understanding what Instruments
is tell me.  Any help would be greatly appreciated.



I had a similar problem a few months ago. This thread may help:
http://www.cocoabuilder.com/archive/message/cocoa/2009/3/12/232167

On Leopard at least, it seems that when nothing happens in the UI  
thread, the collector never kicks in. The workaround was to do  
something in the UI - click a menu, resize a window, etc. When I was  
further along in development and added a progress bar that was updated  
frequently, the symptom disappeared.



Karl Moskowski kolpa...@voodooergonomics.com
Voodoo Ergonomics Inc. http://voodooergonomics.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


[window frame] reporting wrong y coordinate

2009-07-22 Thread Eric Gorr

There is a sample application at:

http://www.ericgorr.net/cocoadev/WindowPosition.zip

and inside of the zip file is a screen shot (screen shot.tiff) of what  
I see when I run the application.


It shows the lower y coordinate of the window at -24 and the window is  
entirely on screen.


I have two screens connected to my machine.

The y coordinate [window frame] returns is only wrong when the  
resolutions of the two screens are different and the window is on the  
second screen (the one without the menubar).


In this particular instance, the resolution of the main screen was  
1280x1024 and the resolution of the second screen was 1400x1050.


The code I wrote to get the coordinates of the window and put them on  
the window is:


- (void)windowDidMove:(NSNotification *)notification
{
NSRect  myLocation = [[notification object] frame]; 
NSString *myLocationString = NSStringFromRect( myLocation );
[windowCoordinates setStringValue:myLocationString];
}


The amount it is off by may be related to the height of the menu bar  
on the main screen.


Perhaps [window frame] is supposed to work this way, but I would find  
that to be quite odd and have not found any documentation supporting  
this weird behavior.


I am running 10.5.7.

A bug will soon be filed with Apple.

p.s.
This situation is going to be seen by users with laptops who connect  
to a second, larger monitor - which is what several users of our  
application are doing and how this was discovered.







___

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

Please do not post admin requests or moderator comments to the list.
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: [window frame] reporting wrong y coordinate

2009-07-22 Thread Shawn Erickson
On Wed, Jul 22, 2009 at 12:28 PM, Eric Gorrmail...@ericgorr.net wrote:
 There is a sample application at:

 http://www.ericgorr.net/cocoadev/WindowPosition.zip

 and inside of the zip file is a screen shot (screen shot.tiff) of what I see
 when I run the application.

 It shows the lower y coordinate of the window at -24 and the window is
 entirely on screen.

 I have two screens connected to my machine.

 The y coordinate [window frame] returns is only wrong when the resolutions
 of the two screens are different and the window is on the second screen (the
 one without the menubar).

What you are seeing is expected based on what you describe. The main
display (one with menu bar) defines the 0,0 origin for the virtual
desktop and the origins for secondary displays are relative to that
main display. Window frame coordinates are in terms of this virtual
desktop not in terms of given display.

-Shawn
___

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

Please do not post admin requests or moderator comments to the list.
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: UUID method Garbage Collection safe?

2009-07-22 Thread Squ Aire

Thank you very much.


 Date: Wed, 22 Jul 2009 18:53:57 +0200
 Subject: Re: UUID method Garbage Collection safe?
 From: jja...@gmail.com
 To: squ...@live.com
 CC: cocoa-dev@lists.apple.com

 Correct code is:

 + (NSString *)stringWithUUID{ CFUUIDRef uuidObj = CFUUIDCreate(nil); NSString 
 *uuidString = (NSString*)NSMakeCollectable(CFUUIDCreateString(nil,uuidObj)); 
 CFRelease(uuidObj); return [uuidString autorelease];}


 Or you will leak in GC.

 --
 Julien

 On Wed, Jul 22, 2009 at 6:45 PM, Squ Aire wrote:



 I've been using this method to make UUID strings:



 + (NSString *)stringWithUUID{ CFUUIDRef uuidObj = CFUUIDCreate(nil); NSString 
 *uuidString = (NSString*)CFUUIDCreateString(nil,uuidObj); CFRelease(uuidObj); 
 return [uuidString autorelease];}



 How do you all like it? Is it ok? It's based on some code I Googled a while 
 back. In particular, is this code perfectly garbage collection safe?

 _

 Show them the way! Add maps and directions to your party invites.

 http://www.microsoft.com/windows/windowslive/products/events.aspx___




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



 Please do not post admin requests or moderator comments to the list.

 Contact the moderators at cocoa-dev-admins(at)lists.apple.com



 Help/Unsubscribe/Update your Subscription:

 http://lists.apple.com/mailman/options/cocoa-dev/jjalon%40gmail.com



 This email sent to jja...@gmail.com



_
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx___

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

Please do not post admin requests or moderator comments to the list.
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: UUID method Garbage Collection safe?

2009-07-22 Thread Squ Aire

Yes I was aware of this method. However, according to the docs it only 
guarantees uniqueness for a given process, and doesn't guarantee it will be 
globally unique, if you know what I mean. Thanks for the suggestion though.


 Subject: Re: UUID method Garbage Collection safe?
 From: keith_...@mac.com
 Date: Wed, 22 Jul 2009 18:26:40 +0100
 CC: squ...@live.com; cocoa-dev@lists.apple.com
 To: jja...@gmail.com

 Or just use [[NSProcessInfo processInfo] globallyUniqueString]

 Keith

 On 22 Jul 2009, at 17:53, Julien Jalon wrote:

 Correct code is:
 + (NSString *)stringWithUUID{ CFUUIDRef uuidObj = CFUUIDCreate(nil);
 NSString *uuidString =
 (NSString*)NSMakeCollectable(CFUUIDCreateString(nil,uuidObj));
 CFRelease(uuidObj); return [uuidString autorelease];}

 Or you will leak in GC.

 --
 Julien

 On Wed, Jul 22, 2009 at 6:45 PM, Squ Aire  wrote:


 I've been using this method to make UUID strings:

 + (NSString *)stringWithUUID{ CFUUIDRef uuidObj = CFUUIDCreate(nil);
 NSString *uuidString = (NSString*)CFUUIDCreateString(nil,uuidObj);
 CFRelease(uuidObj); return [uuidString autorelease];}

 How do you all like it? Is it ok? It's based on some code I Googled
 a while
 back. In particular, is this code perfectly garbage collection safe?
 _
 Show them the way! Add maps and directions to your party invites.

 http://www.microsoft.com/windows/windowslive/products/events.aspx___

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

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

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

 This email sent to jja...@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/keith_dev%40mac.com

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


_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx___

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

Please do not post admin requests or moderator comments to the list.
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: [window frame] reporting wrong y coordinate

2009-07-22 Thread Eric Gorr


On Jul 22, 2009, at 3:36 PM, Shawn Erickson wrote:

On Wed, Jul 22, 2009 at 12:28 PM, Eric Gorrmail...@ericgorr.net  
wrote:

There is a sample application at:

http://www.ericgorr.net/cocoadev/WindowPosition.zip

and inside of the zip file is a screen shot (screen shot.tiff) of  
what I see

when I run the application.

It shows the lower y coordinate of the window at -24 and the window  
is

entirely on screen.

I have two screens connected to my machine.

The y coordinate [window frame] returns is only wrong when the  
resolutions
of the two screens are different and the window is on the second  
screen (the

one without the menubar).


What you are seeing is expected based on what you describe. The main
display (one with menu bar) defines the 0,0 origin for the virtual
desktop and the origins for secondary displays are relative to that
main display. Window frame coordinates are in terms of this virtual
desktop not in terms of given display.


Interesting. Thank 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


Re: UUID method Garbage Collection safe?

2009-07-22 Thread Bill Bumgarner

On Jul 22, 2009, at 12:42 PM, Squ Aire wrote:

Yes I was aware of this method. However, according to the docs it  
only guarantees uniqueness for a given process, and doesn't  
guarantee it will be globally unique, if you know what I mean.  
Thanks for the suggestion though.


As the method name implies, it'll be globally unique.  The string  
contains the mach absolute time, the pid, and some random gunk.


So unless another machine executes -globallyUniqueString at  
exactly the same time from a process with the same pid while the two  
machine's entropy pools are in the same exact state, they'll be unique.


b.bum
___

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

Please do not post admin requests or moderator comments to the list.
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: UUID method Garbage Collection safe?

2009-07-22 Thread Jim Correia

On Jul 22, 2009, at 3:42 PM, Squ Aire wrote:

Yes I was aware of this method. However, according to the docs it  
only guarantees uniqueness for a given process, and doesn't  
guarantee it will be globally unique, if you know what I mean.  
Thanks for the suggestion though.


The documentation for -[NSProcessInfo globallyUniqueString] does  
guarantee that the string will be globally unique. (The word global is  
right in the name.)


What it it doesn't guarantee, though, is that it will give you back a  
UUID string (which is generally meant to be a specific kind of  
globally unique string.)


-globallyUniqueString returns UUID strings today, but this wasn't  
always true. (And since it isn't guaranteed by the docs, may not be  
true in the future.)


If you specifically need a UUID string, you should probably use CFUUID.

- Jim
___

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

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

2009-07-22 Thread Alfonso Urdaneta

Mahaboob wrote:

If I developed this application, will apple store approve this?


Given the laws governing the recording of telephone conversations, 
probably not.



--
alfonso e. urdaneta
red82.com - are you ready?
___

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

Please do not post admin requests or moderator comments to the list.
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 make the Contextual Menu on the tableview's empty rows unable?

2009-07-22 Thread Bright
Hi everyone:

   In the Controller class, I used the code  as follows  to finished the 
contextual menu

on the table view. And I succeeded. 

videoContextualMenu= [[[NSMenualloc] initWithTitle:@Contextual Menu] 
autorelease]; 



[videoContextualMenuinsertItemWithTitle:@Deleteaction:@selector(deleteVideoFile:)
   keyEquivalent:@ atIndex:0];

[videoContextualMenuinsertItemWithTitle:@Infoaction:@selector(infoFile:)

 keyEquivalent:@  atIndex:1];

[movieTablesetMenu:videoContextualMenu]; 




  Now I hope the contextual menu disappears in the empty rows. And it is only 
valid in the

rows which hold data. But I don't know how to implement the purpose... 




Any help greatly appreciated.




Bright


___

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

Please do not post admin requests or moderator comments to the list.
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 make the Contextual Menu on the tableview's empty rows unable?

2009-07-22 Thread Graham Cox


On 23/07/2009, at 1:03 PM, Bright wrote:


Hi everyone:

  In the Controller class, I used the code  as follows  to  
finished the contextual menu


on the table view. And I succeeded.

[]


 Now I hope the contextual menu disappears in the empty rows. And it  
is only valid in the


rows which hold data. But I don't know how to implement the purpose...




Any help greatly appreciated.



The menu is attached to the table view, so will appear no matter where  
you click.


You could override -menuForEvent: and check the mouse location against  
the rows and return nil for empty rows, or invoke super for populated  
rows. But that means subclassing the table.


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


Core Animation rendering problem

2009-07-22 Thread Randall Meadows

Probably not the best subject line, but best I could come up with...

I an animating a ball across the screen, using this code:

CABasicAnimation *animation = [CABasicAnimation  
animationWithKeyPath:@position];

animation.duration = duration;
animation.delegate = self;
animation.timingFunction = [CAMediaTimingFunction  
functionWithName:kCAMediaTimingFunctionLinear];

animation.fromValue = [NSValue valueWithCGPoint:self.center];
animation.toValue = [NSValue valueWithCGPoint:intersectPt];
self.layer.position = intersectPt;
[self.layer addAnimation:animation forKey:@position];

No problem.  Works great.  Now, something happens and I want to stop  
the motion of the ball, and start a new animation that increases the  
diameter of the ball.  I do so by doing


[self.layer removeAllAnimations];
if (speed  0) {
   self.speed = 0.0;
   CGPoint here = ((CALayer *)(self.layer.presentationLayer)).position;
   self.center = here;
}

to stop the ball in place (which seems to work, as the following  
animation is done at the correct location) and then I start a new  
animation that increases the size of the ball, like so:


[UIView beginAnimations:nil context:NULL]; {
   [UIView setAnimationDuration:0.5];
   [UIView setAnimationDelegate:self];
   [UIView  
setAnimationDidStopSelector:@selector(explosion:finished:context:)];

   [UIView setAnimationCurve:UIViewAnimationCurveLinear];
   CGFloat delta = (kParticleSizeExplode - kParticleSizeNormal);
   CGRect newBounds = self.bounds;
   newBounds.origin.x -= delta/2.0;
   newBounds.size.width += delta;
   newBounds.origin.y -= delta/2.0;
   newBounds.size.height += delta;
   self.bounds = newBounds;
} [UIView commitAnimations];

The problem occurs while drawing the ball during this 2nd animation;  
instead of redrawing the ball at increasing sizes, so it's nice and  
round, instead it appears that the small ball is simply being scaled  
up, and is very jaggy.


Here's my -drawRect: for the ball:

CGContextRef context = UIGraphicsGetCurrentContext();
const CGFloat *components = CGColorGetComponents(self.color);
CGContextSetRGBFillColor(context, components[0], components[1],  
components[2], 1.0);

CGContextFillEllipseInRect(context, [self currentBounds]);

The -currentBounds method is a convenience method to get the current  
bounds of the object, whether it is part of an animation currently or  
not:


- (CGRect)currentBounds
{
  CGRect bounds = CGRectZero;
  CALayer *presLayer = self.layer.presentationLayer;
  if (presLayer == nil) {
bounds = self.bounds;
  }
  else {
bounds = ((CALayer *)presLayer).bounds;
  }
  return bounds;
}

Any idea why the drawing is screwing up for the 2nd animation?  Are  
the 2 different methods of animating messing up each other somehow  
(even though I've removed the 1st animation)?


Tips/suggestions/comments appreciated.
randy

___

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

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


NSTableView - populating from C procedure

2009-07-22 Thread Alexander Bokovikov

Hi, All,

This is my first attempt to deal with Cocoa container class, so I have  
some unclear points. I've found one of many tutorials here:


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

where it is said, among other, that NSTableView items may be filled  
out like this:


- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex {

return [[myTableViewArray objectAtIndex: rowIndex] objectForKey: 
[aTableColumn identifier]]


}

My specifics is that the data (strings)  are delivered by an external  
procedure, located out of ObjC stuff, and returning C-style strings.  
My table has only one column. My question is, as usual, about memory  
manager: May I write something like this:


exern void getString(int row, char *s, int *len);

- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex {

char buf[255];
int len;

getString(rowIndex, buf, len);
return [NSString stringWithCString:buf length:len  
encoding:NSUTF8StringEncoding];


}

I.e. is it possible to return a NSString without its preliminary  
retaining?

Or should I add [... retain]  to the returning string?

All examples operate by some values, stored in retained structures,  
like NSArray. Here my question originates from.


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: NSTableView - populating from C procedure

2009-07-22 Thread Graham Cox


On 23/07/2009, at 3:41 PM, Alexander Bokovikov wrote:

My specifics is that the data (strings)  are delivered by an  
external procedure, located out of ObjC stuff, and returning C-style  
strings. My table has only one column. My question is, as usual,  
about memory manager: May I write something like this:


exern void getString(int row, char *s, int *len);

- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex {

char buf[255];
int len;

getString(rowIndex, buf, len);
return [NSString stringWithCString:buf length:len  
encoding:NSUTF8StringEncoding];


}

I.e. is it possible to return a NSString without its preliminary  
retaining?

Or should I add [... retain]  to the returning string?



Yes, that is the correct thing to do - you don't own the string, so  
you shouldn't retain it.


BTW, watch out for a potential buffer overflow in getString(...), this  
is the sort of thing viruses readily exploit.


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