Re: Updating tracking areas Rect

2009-12-29 Thread Gustavo Pizano
Yes, the view is the only one adding the TA,  when I resize the view by 
dragging, as far as I understand, the updateTrackingAreas method its called, so 
I overwrote that method deleting the old ones and calculating the new ones. 
Maybe what graham says must be done, copy the collection and iterate that but 
delete the right one

Im gonna give it a try , 'ill let you know.


On Dec 29, 2009, at 4:36 AM, Joar Wingfors wrote:

 
 On 28 dec 2009, at 09.22, Gustavo Pizano wrote:
 
 I cant use the last option because it may happen that I will have not just 2 
 TA but N..
 
 
 Perhaps you should still maintain your own array of tracking areas? I'm not 
 sure if anyone else should ever add tracking areas to your view, but it might 
 still be better to make sure that you're only removing the tracking areas 
 that you're sure that you added.
 
 j o a r
 
 

___

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

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

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

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


Re: Is there a warning for this?

2009-12-29 Thread Izidor Jerebic


Well, the documentation says http://gemma.apple.com/mac/library/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingBasics.html 
:


Avoid the use of the underscore character as a prefix meaning  
private, especially in methods. Apple reserves the use of this  
convention


Note the especially, and also note the existence of many underscored  
instance variables in appkit and foundation.


I understand it as direction to avoid underscore in *any* name, not  
just method name.


It is true that instance variables are not as critical as methods. If  
you subclass appkit class and use underscored instance variable which  
clashes with superclass, compiler will warn you and your code won't  
compile, so no real damage will occur, as opposed to clashing private  
method where your program will happily compile and then sometimes  
crash at runtime. The only problem can be if future framework class  
adds instance variable which clashes with yours, thus making your  
existing code un-compilable. So using underscored instance variables  
is not dangerous, but it is asking for trouble, and why would you want  
that?


izidor



On 29.12.2009, at 6:36, Sean McBride wrote:


Kyle Sluder (kyle.slu...@gmail.com) on 2009-12-24 9:20 AM said:


Otherwise, give your ivars a prefix (underscore is
verboten according to Apple, since they use it in the frameworks).


This is a common misconception.  The underscore is reserved by Apple  
for
method names, not ivars.  That's how they can safely add new methods  
to

public classes without conflicting with our subclasses.

I'd suggest you _do_ use underscore as your ivar prefix.

See also:
http://gemma.apple.com/mac/library/documentation/Cocoa/Conceptual/
CodingGuidelines/Articles/NamingIvarsAndTypes.html

http://lists.apple.com/archives/Cocoa-dev/2009/Jan/msg00608.html

Sean

--
Terrorism is the war of the poor, and war is terrorism of the rich -
Sir Peter Ustinov

___

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

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

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

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


launching my application at startup(whenever pc starts)

2009-12-29 Thread kirankumar

hi everyone,

i develop an application that i want to launch at startup ie, every
time when i start my system my application has to launch ,can any one
help me plz.

Is there any script to keep at PackageMarker.


Regards,
kiran.

The information contained in this email and any attachments is confidential and 
may be subject to copyright or other intellectual property protection. If you 
are not the intended recipient, you are not authorized to use or disclose this 
information, and we request that you notify us by reply mail or telephone and 
delete the original message from your mail system.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Creating CoreData classes

2009-12-29 Thread Brian Bruinewoud
Ah, that seems perfect (haven't tried it yet), but it claims to do what I want.
Thanks.

On 28/12/2009, at 17:51 , Rob Keniger wrote:

 On 28/12/2009, at 2:52 PM, Brian Bruinewoud wrote:
 But I'm looking for something more like this:
 
   CDClass *cdObject = [ CDClass insertNewObjectInManagedObjectContext: 
 context ];
 
 Is there any such method or do I need to add them to the generated class 
 files myself?
 
 
 If you use mogenerator to create your custom NSManagedObject subclasses, you 
 get methods like this created for you automatically:
 
 http://github.com/rentzsch/mogenerator
 
 --
 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/brian%40darknova.com
 
 This email sent to br...@darknova.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: Updating tracking areas Rect

2009-12-29 Thread Graham Cox

On 29/12/2009, at 7:37 PM, Gustavo Pizano wrote:

 Yes, the view is the only one adding the TA,  when I resize the view by 
 dragging, as far as I understand, the updateTrackingAreas method its called, 
 so I overwrote that method deleting the old ones and calculating the new 
 ones. Maybe what graham says must be done, copy the collection and iterate 
 that but delete the right one
 
 Im gonna give it a try , 'ill let you know.


You do realise that the problem is what Joar pointed out, that the loop that 
deletes your old tracking areas is not working, because its terminating 
condition is == 0, so it never runs at all?

NSInteger i = 0;
while ([[self trackingAreas] count]==0) // if there are 
any tracking areas, this loop will never run.
// If there are 
not, it will throw an out-of-bounds 

// bounds exception because there is no element '0'.

{
[self removeTrackingArea:[[self trackingAreas] 
objectAtIndex:i]];
i++;
}

The rest of the discussion was off on a bit of a tangent - how best to write 
that loop. But however you do it, the fundamental bug here is the while( 
count == 0 ), which explains the symptoms you described.

By the way, setting a breakpoint just here and stepping through in the debugger 
would have made it immediately obvious what the problem was.

--Graham


___

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

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

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

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


Re: Updating tracking areas Rect

2009-12-29 Thread Gustavo Pizano
I did change the loop yesterday.   and now its working ok... 
 The rest of the discussion was off on a bit of a tangent - how best to write 
 that loop.
the same was with me in todays post. . ;-)

Still Im having problems when dragging I need to be very precise when clicking 
the first time.. must check that also.

Thanks a lot 

G.


On Dec 29, 2009, at 10:50 AM, Graham Cox wrote:

 
 On 29/12/2009, at 7:37 PM, Gustavo Pizano wrote:
 
 Yes, the view is the only one adding the TA,  when I resize the view by 
 dragging, as far as I understand, the updateTrackingAreas method its called, 
 so I overwrote that method deleting the old ones and calculating the new 
 ones. Maybe what graham says must be done, copy the collection and iterate 
 that but delete the right one
 
 Im gonna give it a try , 'ill let you know.
 
 
 You do realise that the problem is what Joar pointed out, that the loop that 
 deletes your old tracking areas is not working, because its terminating 
 condition is == 0, so it never runs at all?
 
   NSInteger i = 0;
   while ([[self trackingAreas] count]==0) // if there are 
 any tracking areas, this loop will never run.
   // If there are 
 not, it will throw an out-of-bounds   
   
 // bounds exception because there is no element '0'.
 
   {
   [self removeTrackingArea:[[self trackingAreas] 
 objectAtIndex:i]];
   i++;
   }
 
 The rest of the discussion was off on a bit of a tangent - how best to write 
 that loop. But however you do it, the fundamental bug here is the while( 
 count == 0 ), which explains the symptoms you described.
 
 By the way, setting a breakpoint just here and stepping through in the 
 debugger would have made it immediately obvious what the problem was.
 
 --Graham
 
 

___

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

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

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

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


Re: Trying to do something that *should* be simple...

2009-12-29 Thread Mike Abdullah
Since this is the Cocoa list, you'll probably have better luck asking on 
something more appropriate like the Core Audio list.

On 29 Dec 2009, at 00:58, Jeff Heard wrote:

 Okay, I've created two audio queues, one output and one input.  And no, I 
 don't have them both on at once, because I know well that wont' work.  All I 
 want to do is sample sound from the input and then replay the frequency of 
 that sound as the output.  Can anyone help me?  It seems to work if I try to 
 get it to play a constant 440hZ, but when it starts after finding the new 
 frequency, it plays 1/2 second of audio and then I get silence.  My code, 
 which seems sane looks like this:
 
 // MainViewController.m:
 
 - (void) onPressed {  // should pause the output and listen for new sound
   AudioQueuePause(aqc-outQueue);  // stop the input so the mic can listen
   AudioQueueEnqueueBuffer(aqc-inQueue, aqc-mBuffers[0], 0, NULL);  // 
 enqueue an input buffer to the mic queue
   AudioQueueStart(aqc-inQueue, NULL); // start the input queue
 }
 
 - (void) onReleased { // should stop recording and start replaying the 
 frequency
   AudioQueueStop(aqc-inQueue,TRUE);  // stop the input queue
AudioQueueStart(aqc-outQueue, NULL);
 }
 
 // Audio.c
 
 AQCallbackStruct *SetupAudioQueues() { 
   AQCallbackStruct *aqc = malloc(sizeof(AQCallbackStruct));
   int i;
   int aqniStatus;
 
   aqc-mDataFormat.mSampleRate = 44100.0;
   aqc-mDataFormat.mFormatID = kAudioFormatLinearPCM;
   aqc-mDataFormat.mFormatFlags =
   kLinearPCMFormatFlagIsSignedInteger |
   kLinearPCMFormatFlagIsPacked;
   aqc-mDataFormat.mBytesPerPacket = 4;
   aqc-mDataFormat.mFramesPerPacket = 1;
   aqc-mDataFormat.mBytesPerFrame = 4;
   aqc-mDataFormat.mChannelsPerFrame = 2;
   aqc-mDataFormat.mBitsPerChannel = 16;
   aqc-frameCount = 4410;
   aqc-frameSize = aqc-frameCount * aqc-mDataFormat.mBytesPerFrame;
   aqc-frequency = 0;
   aqc-amplitude = 4096;
   aqc-check = FALSE;
   
   
   aqniStatus = AudioQueueNewInput(
(aqc-mDataFormat)
  , AQInputCallback
  , aqc
  , NULL
  , kCFRunLoopCommonModes
  , 0
  , (aqc-inQueue));
   
   
   aqniStatus = AudioQueueNewOutput(
(aqc-mDataFormat)
  , AQOutputCallback
  , aqc
  , NULL
  , kCFRunLoopCommonModes
  , 0
  , (aqc-outQueue));
 
   
   for(i=0; i AUDIO_BUFFERS / 2; i++) {
   AudioQueueAllocateBuffer(aqc-inQueue, aqc-frameSize, 
 (aqc-mBuffers[i]));
   }
   for(i=AUDIO_BUFFERS/2; i  AUDIO_BUFFERS; i++) {
   aqniStatus = AudioQueueAllocateBuffer(aqc-outQueue, 
 aqc-frameSize, (aqc-mBuffers[i]));
   AQOutputCallback(aqc, aqc-outQueue, aqc-mBuffers[i]); 
   }
   
   aqniStatus = AudioQueueStart(aqc-outQueue, NULL);
   return aqc;
 } 
 
 static void AQInputCallback
 (void *aqr,
 AudioQueueRef inQ,
 AudioQueueBufferRef inQB,
 const AudioTimeStamp *timestamp,
 UInt32 frameSize,
 const AudioStreamPacketDescription *mDataFormat)
 {
   AQCallbackStruct *aqc = (AQCallbackStruct*)aqr;
   
// should find the frequency of the input sound and store it in 
 frequency
   aqc-frequency = autoCorrelationSInt16*)inQB-mAudioData)[0]), 
 aqc-frameCount*2); 
 }
 
 // this I've confirmed works by subsituting 440 in for the frequency...
 
 static void AQOutputCallback
 (void *aqr,
 AudioQueueRef inQ,
 AudioQueueBufferRef outQB)
 {
   AQCallbackStruct *aqc = (AQCallbackStruct*)aqr;
 
   SInt16 *CoreAudioBuffer = outQB-mAudioData;
   outQB-mAudioDataByteSize = 4*aqc-frameCount;
 
   for (int i=0; iaqc-frameCount*2; i+=2) {
   CoreAudioBuffer[i] = waveform(i, 
 aqc-mDataFormat.mSampleRate/2, aqc-frequency, aqc-amplitude, 0, 0);
   CoreAudioBuffer[i+1] = waveform(i, 
 aqc-mDataFormat.mSampleRate/2, aqc-frequency, aqc-amplitude, 0, 0); 
   }
   AudioQueueEnqueueBuffer(inQ, outQB, 0, NULL);
 }
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net
 
 This email sent to cocoa...@mikeabdullah.net

___

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

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

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

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


CocoaBuilder is back

2009-12-29 Thread Andy Lee
I haven't seen an announcement on the list, so I thought I'd mention that 
CocoaBuilder is back up, with some very nice improvements.

Congratulations and a million thanks to Bertrand Mansion!

--Andy

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CocoaBuilder is back

2009-12-29 Thread lbland
hi-

On Dec 29, 2009, at 8:25 AM, Andy Lee wrote:

 I haven't seen an announcement on the list, so I thought I'd mention that 
 CocoaBuilder is back up, with some very nice improvements.
 
 Congratulations and a million thanks to Bertrand Mansion!

I have to second that! I always liked CocoaBuilder.

thanks!-

-lance

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CocoaBuilder is back

2009-12-29 Thread Andy Lee
On Dec 29, 2009, at 11:13 AM, lbland wrote:
 On Dec 29, 2009, at 8:25 AM, Andy Lee wrote:
 
 I haven't seen an announcement on the list, so I thought I'd mention that 
 CocoaBuilder is back up, with some very nice improvements.
 
 Congratulations and a million thanks to Bertrand Mansion!
 
 I have to second that! I always liked CocoaBuilder.

In my excitement I didn't notice that it isn't live yet with recent posts, and 
there's still a few months of recent archives that haven't been brought back 
online yet.  But there's still lots of searchable material, and if nothing else 
you can try out the new UI and send feedback if you have suggestions.

--Andy


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


SQLite mime type?

2009-12-29 Thread Paul Archibald
I am using SQLite in my iPhone app. and i want to be able to email the  
database file. I see that attaching it to a message is pretty  
straightforward, but the addAttachmentData method requires a mime  
type, and I  don't know what that should be. Any ideas out there?

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Notification when displays are detected?

2009-12-29 Thread Jacob Schwartz
Hey all,

After some searching through the API, which apparently I am not good at, I 
figured asking was easier. Does anyone know of a notification that gets posted 
when another screen is added/detected. I figured it would be in NSWorkspace but 
I didn't see anything. Thanks.

-Jake Schwartz___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Notification when displays are detected?

2009-12-29 Thread Dave DeLong
I just popped up a notification watcher and unplugged my external monitor, and 
saw lots of CMDevice(Un)RegisteredNotification distributed notifications go 
past.  There were also a bunch of CMDisplayDeviceProfilesNotification 
distnotes with the same userInfo dictionaries as the Device(Un)Registered 
notifications.

A quick search through the docs doesn't reveal those strings, though.

HTH,

Dave

On Dec 29, 2009, at 11:15 AM, Jacob Schwartz wrote:

 Hey all,
 
 After some searching through the API, which apparently I am not good at, I 
 figured asking was easier. Does anyone know of a notification that gets 
 posted when another screen is added/detected. I figured it would be in 
 NSWorkspace but I didn't see anything. Thanks.


smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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

Re: Notification when displays are detected?

2009-12-29 Thread Dave Keck
Maybe NSApplicationDidChangeScreenParametersNotification?
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Notification when displays are detected?

2009-12-29 Thread Sean McBride
Jacob Schwartz (jakehschwa...@gmail.com) on 2009-12-29 1:15 PM said:

After some searching through the API, which apparently I am not good at,
I figured asking was easier. Does anyone know of a notification that
gets posted when another screen is added/detected. I figured it would be
in NSWorkspace but I didn't see anything. Thanks.

CGDisplayRegisterReconfigurationCallback ?

Sean

--
When the winds of change are blowing, some people are building shelters
and others are building windmills - Chinese proverb

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Notification when displays are detected?

2009-12-29 Thread Jacob Schwartz
I tried this one but it doesn't seem to be doing anything, so odds are I am 
adding the observer wrong. I am a little new at this, if that wasn't obvious 
haha.

// Second notification, when the screens change
[nc addObserver:self
selector:@selector(handleBackgroundChange:)
name:NSApplicationDidChangeScreenParametersNotification 
object:nil];

The handleBackgroundChange is just supposed to print a message with NSLog.

-Jake Schwartz

On Dec 29, 2009, at 1:26 PM, Paul Sanders wrote:

 NSApplicationDidChangeScreenParametersNotification
 
 Returns a stale value for [NSScreen visibleFrame] after the dock 
 moves from one screen to another (on Snow Leopard at least). 
 Solution: wait a second or so, then ask again.
 
 This notification is also sent when the screen arrangement or 
 dock is reconfigured.  I find this useful.
 
 Paul Sanders.
 
 - Original Message - 
 From: Jacob Schwartz jakehschwa...@gmail.com
 To: cocoa-dev@lists.apple.com
 Sent: Tuesday, December 29, 2009 6:15 PM
 Subject: Notification when displays are detected?
 
 
 Hey all,
 
 After some searching through the API, which apparently I am not 
 good at, I figured asking was easier. Does anyone know of a 
 notification that gets posted when another screen is 
 added/detected. I figured it would be in NSWorkspace but I 
 didn't see anything. Thanks.
 
 -Jake Schwartz
 
 
 

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Notification when displays are detected?

2009-12-29 Thread Dave Keck
Does nc == [NSNotificationCenter defaultCenter]?
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: SQLite mime type?

2009-12-29 Thread davelist

On Dec 29, 2009, at 11:56 AM, Paul Archibald wrote:

 I am using SQLite in my iPhone app. and i want to be able to email the 
 database file. I see that attaching it to a message is pretty 
 straightforward, but the addAttachmentData method requires a mime type, and I 
  don't know what that should be. Any ideas out there?


I don't know if this is the correct one, but application/octet-stream seems 
to work fine for me in my Attendance app.

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: Notification when displays are detected?

2009-12-29 Thread Jacob Schwartz
No:
 NSNotificationCenter *nc = [[NSWorkspace sharedWorkspace] notificationCenter];

And Paul, it does exist because the other notification I have set up get 
recognized works and I cped the code.

Thanks for all the help guys.

-Jake

On Dec 29, 2009, at 2:05 PM, Dave Keck wrote:

 Does nc == [NSNotificationCenter defaultCenter]?

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Possible bug with NSBackgroundStyleRaised

2009-12-29 Thread PCWiz
I'm using this in my NSTextField subclass to get a recessed text style:

[[self cell] setBackgroundStyle:NSBackgroundStyleRaised];

It works fine other than the fact that if the text field's NSAttributedString 
contains any text with an alternate text color set (using 
NSForegroudColorAttributeName) the recessed style does not appear for the 
entire text contents of the text field, not just the colored text. Is this a 
bug or is there a good reason for this to happen?

Independent Cocoa Developer, Macatomy Software
http://macatomy.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: Notification when displays are detected?

2009-12-29 Thread Jacob Schwartz
Dave, victory is yours. What is the difference between that center and my 
center?

-Jake Schwartz

On Dec 29, 2009, at 2:05 PM, Dave Keck wrote:

 Does nc == [NSNotificationCenter defaultCenter]?

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Notification when displays are detected?

2009-12-29 Thread Dave Keck
 What is the difference between that center and my center?

The NSWorkspace notification center is usually reserved for
system-wide events (WillPowerOffNotification, WillSleepNotification,
DidPerformFileOperationNotification), while the +defaultCenter is
reserved for events occurring within the current application's context
(NSWindowWillMoveNotification, NSApplicationWillUnhideNotification).
The NSWorkspaceDidChangeScreenParametersNotification notification is
probably a better fit for NSWorkspace's notification center, but I
guess the implementors didn't think so.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Reference NSSearchFieldCell within NSSearchField?

2009-12-29 Thread Mike Chambers
The NSSearchField docs mention that it wraps an NSSearchFieldCell,
which contains such APIs as setSendsWholeSearchString (which i need to
dynamically set).

Is there any programatic way to get a reference to the
NSSearchFieldCell wrapped in a particular NSSearchField? I know I can
link an IBOutlet to it directly in IB, but I would prefer just to use
my existing outlet to the search field.

mike
___

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

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

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

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


Re: CocoaBuilder is back

2009-12-29 Thread Karl Moskowski

On Dec 29, 2009, at 8:25 AM, Andy Lee wrote:

 I haven't seen an announcement on the list, so I thought I'd mention that 
 CocoaBuilder is back up, with some very nice improvements.
 
 Congratulations and a million thanks to Bertrand Mansion!

During CB's hiatus, I've been using a Google Groups-hosted archive of cocoa-dev.
http://groups.google.com/group/cocoa-dev


Karl Moskowski kolpa...@voodooergonomics.com
Voodoo Ergonomics Inc. http://voodooergonomics.com/





smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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

Re: Reference NSSearchFieldCell within NSSearchField?

2009-12-29 Thread Jim Correia
On Dec 29, 2009, at 3:02 PM, Mike Chambers wrote:

 The NSSearchField docs mention that it wraps an NSSearchFieldCell,
 which contains such APIs as setSendsWholeSearchString (which i need to
 dynamically set).
 
 Is there any programatic way to get a reference to the
 NSSearchFieldCell wrapped in a particular NSSearchField? I know I can
 link an IBOutlet to it directly in IB, but I would prefer just to use
 my existing outlet to the search field.

NSSearchField inherits from NSControl.

NSControl has a -cell method.

- 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: SQLite mime type?

2009-12-29 Thread Paul Archibald

Cool, thanks, I'll try that.
On Dec 29, 2009, at 11:10 AM, davel...@mac.com wrote:



On Dec 29, 2009, at 11:56 AM, Paul Archibald wrote:

I am using SQLite in my iPhone app. and i want to be able to email  
the database file. I see that attaching it to a message is pretty  
straightforward, but the addAttachmentData method requires a mime  
type, and I  don't know what that should be. Any ideas out there?



I don't know if this is the correct one, but application/octet- 
stream seems to work fine for me in my Attendance app.


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


testing email code in the simulator (MFMailComposeViewControllerDelegate)

2009-12-29 Thread Paul Archibald
Is there a way to test the emailing code in my app from within the  
simulator? I don't have an iPhone. It looks like my code is working,  
but I would really like to see whether the message is actually being  
constructed and sent correctly. I realize that on an iPhone it would  
be handed over to the Mail app for sending at a future time, but the  
sim does not have Mail on it either (is it possible to install Mail  
onto the simulator?)

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


StoreKit problem

2009-12-29 Thread Development
I am trying to use the store kit. Everything works until i send the data to my 
php script to verify the transaction below is the code that sends to the script 
and then i get this error:
response {status:21002, exception:java.lang.IllegalArgumentException: 
propertyListFromString parsed an object, but there's still more text in the 
string. A plist should contain only one top-level object. Line number: 6, 
column: 2.}

NSUserDefaults * settings = [NSUserDefaults 
standardUserDefaults];
UIDevice *thisDevice = [UIDevice currentDevice];
NSString * udid =thisDevice.uniqueIdentifier;

NSURL * url = [NSURL 
URLWithString:@http://fornextsoft.com/script.php;];

NSString *myRequestString = [NSString 
stringWithFormat:@UDID=%@transaction=%@,udid,

 [NSString encode:(const uint8_t*)[[item transactionReceipt] bytes]

   length:[[item transactionReceipt] length]]];

NSData *myRequestData = [myRequestString 
dataUsingEncoding:NSUTF8StringEncoding];

NSLog(@Request string: %@,myRequestString);

NSMutableURLRequest *request = [ [ 
NSMutableURLRequest alloc ] initWithURL:url];
[ request setHTTPMethod: @POST ];
[ request setHTTPBody: myRequestData ];
[request 
setValue:@application/x-www-form-urlencoded 
forHTTPHeaderField:@content-type];
NSURLResponse* urlResponse;
NSError* error;
NSData* result = [NSURLConnection 
sendSynchronousRequest:request returningResponse:urlResponse error:error];

NSString * response = [[NSString 
alloc]initWithData:result encoding:NSUTF8StringEncoding];
NSLog(@response %@,response);
[[SKPaymentQueue defaultQueue]finishTransaction:item];




___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


MyDocument.xib v MainMenu.xib

2009-12-29 Thread David Blanton
In a document based app I want to have some 'inspectors that reflect  
what i sgoing on in the document.  These inspectors should float.


If I make NSPanel's for the inspector in MyDocument.xib then each  
instance of a document gets its own set of inspectors.


I would like to have just one set of inspectors whose contents change  
as different documents are activated.


Putting the inspectors in MainMenu.xib will let me make just 'one set'  
for all documents but I am unsure as to how to get a reference from  
the inspector to the document given different xib's.


Suggestion please.

db

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: MyDocument.xib v MainMenu.xib

2009-12-29 Thread Nathan Day
If you have an application delegate you can add a IB instance variable to that.
Though what I usually do in your situation is to create a separate NIB and 
window controller for the inspector panel, I then have a showInspector method 
in my application delegate which will create the window controller if 
necessary, and then use notifications and notification observing to keep the 
inspector up to date with changes to the main window/document and changes in 
content.

On 30/12/2009, at 4:23 PM, David Blanton wrote:

 In a document based app I want to have some 'inspectors that reflect what i 
 sgoing on in the document.  These inspectors should float.
 
 If I make NSPanel's for the inspector in MyDocument.xib then each instance of 
 a document gets its own set of inspectors.
 
 I would like to have just one set of inspectors whose contents change as 
 different documents are activated.
 
 Putting the inspectors in MainMenu.xib will let me make just 'one set' for 
 all documents but I am unsure as to how to get a reference from the inspector 
 to the document given different xib's.
 
 Suggestion please.
 
 db
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/nathan_day%40mac.com
 
 This email sent to nathan_...@mac.com

Nathan Day
home page:  http://homepage.mac.com/nathan_day/







___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Resizing Issues with NSCollectionView

2009-12-29 Thread Carter Allen
I have a couple NSCollectionViews in a window. They are each in a side of a
split view, and I'm having resize issues. It starts out fine, like this:
http://c.zcr.me/84B7X , but then when I resize it, this happens:
http://c.zcr.me/84D3C . All views and pieces are set up to stretch
horizontally, including the scroll view, collection view, collection view
item, and the split view that contains it all.

Thanks for any help you can provide!

Sincerely,
Carter Allen
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Notification when displays are detected?

2009-12-29 Thread Paul Sanders
NSApplicationDidChangeScreenParametersNotification

Returns a stale value for [NSScreen visibleFrame] after the dock 
moves from one screen to another (on Snow Leopard at least). 
Solution: wait a second or so, then ask again.

This notification is also sent when the screen arrangement or 
dock is reconfigured.  I find this useful.

Paul Sanders.

- Original Message - 
From: Jacob Schwartz jakehschwa...@gmail.com
To: cocoa-dev@lists.apple.com
Sent: Tuesday, December 29, 2009 6:15 PM
Subject: Notification when displays are detected?


Hey all,

After some searching through the API, which apparently I am not 
good at, I figured asking was easier. Does anyone know of a 
notification that gets posted when another screen is 
added/detected. I figured it would be in NSWorkspace but I 
didn't see anything. Thanks.

-Jake Schwartz



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Document-based application issue

2009-12-29 Thread Mac Lancer
Hello, Gentlemen,

I’m working on a Cocoa application that is intended to open documents in
custom format. It is a document-based application and it should open files
with aeep/aeew extensions. The problem is that on some Mac computers after
installation aeep/aeew files do not open when the user double-clicks them.
My thought was that the aeep/aeew file extensions are not registered for
some reason during the installation. I even tried adding 'lsregister' call
to the postflight script but with no luck – the files still do not open.
Unfortunately, I do not have much information about configurations of these
macs as this behavior is reported by end users. Does anyone know what can be
the reason for such behavior? Am I missing something? Some additional
information below:

1. The application is installed to the folder /Library/Application
Support/AnimalsandEarth/AE Photo.app
2. Info.plist file contains the following dictionary:
keyCFBundleDocumentTypes/key
array
dict
keyCFBundleTypeExtensions/key
array
stringaeep/string
stringaeew/string
stringjpg/string
stringjpeg/string
stringpng/string
stringgif/string
stringbmp/string
/array
keyCFBundleTypeIconFile/key
string/string
keyCFBundleTypeName/key
stringAnimalsAndEarthPhoto/string
keyCFBundleTypeOSTypes/key
array
string/string
/array
keyCFBundleTypeRole/key
stringViewer/string
keyNSDocumentClass/key
stringMyDocument/string
/dict
/array
3. The URL to the installer:
http://www.animalsandearth.com/macapp/animalsandearth.dmg
4. Some aeep files can be found in the ~/Pictures/AnimalsandEarth Photos/
folder

Any help would be appreciated.

Thanks,
AE
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Notification when displays are detected?

2009-12-29 Thread Paul Sanders
That looks OK to me.  I do:

NSNotificationCenter *dnc = [NSNotificationCenter defaultCenter];
[dnc addObserver: self selector: @selector (didChangeScreenParameters:)
name: NSApplicationDidChangeScreenParametersNotification object: nil];

...

- (void) didChangeScreenParameters: (NSNotification *) notification
{
...
}

What object is 'self' in your scenario?  It needs to exist for the life of the 
app, obviously.

Paul Sanders.

- Original Message - 
From: Jacob Schwartz 
To: Paul Sanders 
Cc: cocoa-dev@lists.apple.com 
Sent: Tuesday, December 29, 2009 6:47 PM
Subject: Re: Notification when displays are detected?


I tried this one but it doesn't seem to be doing anything, so odds are I am 
adding the observer wrong. I am a little new at this, if that wasn't obvious 
haha.


// Second notification, when the screens change
[nc addObserver:self
selector:@selector(handleBackgroundChange:)
name:NSApplicationDidChangeScreenParametersNotification 
object:nil];


The handleBackgroundChange is just supposed to print a message with NSLog.


-Jake Schwartz


On Dec 29, 2009, at 1:26 PM, Paul Sanders wrote:


  NSApplicationDidChangeScreenParametersNotification

  Returns a stale value for [NSScreen visibleFrame] after the dock 
  moves from one screen to another (on Snow Leopard at least). 
  Solution: wait a second or so, then ask again.

  This notification is also sent when the screen arrangement or 
  dock is reconfigured.  I find this useful.

  Paul Sanders.

  - Original Message - 
  From: Jacob Schwartz jakehschwa...@gmail.com
  To: cocoa-dev@lists.apple.com
  Sent: Tuesday, December 29, 2009 6:15 PM
  Subject: Notification when displays are detected?


  Hey all,

  After some searching through the API, which apparently I am not 
  good at, I figured asking was easier. Does anyone know of a 
  notification that gets posted when another screen is 
  added/detected. I figured it would be in NSWorkspace but I 
  didn't see anything. Thanks.

  -Jake Schwartz
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Why does Core Data re-enter -beginUndoGrouping at Checkpoint?

2009-12-29 Thread Jerry Krinock
Sometimes, when Core Data receives a NSUndoManagerCheckpointNotification from 
-beginUndoGrouping, it invokes -beginUndoGrouping again, so that 
-beginUndoGrouping is re-entered before it finishes.

Can anyone guess why Core Data might be doing this?

It causes things to get rather hairy when you're trying to get control of your 
undo groupings.

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: MyDocument.xib v MainMenu.xib

2009-12-29 Thread Graham Cox

On 30/12/2009, at 4:23 PM, David Blanton wrote:

 In a document based app I want to have some 'inspectors that reflect what i 
 sgoing on in the document.  These inspectors should float.
 
 If I make NSPanel's for the inspector in MyDocument.xib then each instance of 
 a document gets its own set of inspectors.
 
 I would like to have just one set of inspectors whose contents change as 
 different documents are activated.
 
 Putting the inspectors in MainMenu.xib will let me make just 'one set' for 
 all documents but I am unsure as to how to get a reference from the inspector 
 to the document given different xib's.
 
 Suggestion please.


Each document your application opens will be a new instance built from the same 
nib. So even if there were a way to 'connect' objects in one nib to objects in 
another, it wouldn't help you - different documents will be made active at 
different times and your inspectors need to be aware of those activations.

A simple approach is to make your inspectors respond to all window did become 
main/resign main notifications, and then ask the document controller singleton 
for -currentDocument at those times. It can then figure out if the document 
itself has changed as a result of the active window change and do whatever it 
needs to do to inspect the document contents.

Setting up the notifications is best done in the inspector controller's 
-awakeFromNib method.

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