Create NSStrings from a mapped NSData object - safe?

2008-05-12 Thread Daniel Vollmer

Salutations!

I'm parsing a rather large text-file (usually >20MB) and in doing so  
I'm iterating over its lines with [String getParagraphStart]. I've  
found a rather noticeable speed-up in the parsing operation if I  
create the string in question from an NSData object (created via  
initWithContentsOfMappedFile) using [String initWithData:encoding:].


Now to the questions:
1) Is this safe if the file in question is being moved / deleted /  
edited during parsing?


2) Are substrings created from the original string (e.g.  
substringWithRange etc.) still backed properly after the original  
string and the NSData object are released?



Thanks for any pointers,
Daniel.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: list open application windows

2008-05-12 Thread Graham Cox
The renowned friendliness of the Mac community could well end up our  
downfall, tripping over ourselves to help out malware and virus  
writers, and sweatshops full of offshore programmers who are getting  
Mac projects thrown at them after our bosses took the projects off us  
to outsource them!


Lest anyone take offence, I speak with tongue firmly in cheek - but  
who knows, there's possibly a grain of truth in there somewhere ;-)



G.


On 13 May 2008, at 4:01 pm, Jens Alfke wrote:

 I can't think of a compelling usage for this, other than writing  
some kind of window-management utility (or malware...)


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: PDFView query

2008-05-12 Thread Amrit Majumdar
Thanks for the pointerCompletely over looked the PDFThumbNailView


Regards,
Amrit

On Mon, May 12, 2008 at 12:01 PM, Antonio Nunes <[EMAIL PROTECTED]>
wrote:

> On May 12, 2008, at 7:20 AM, Amrit Majumdar wrote:
>
>  I need to display all the pages of the pdf document in a couple of rows.
> >
>
>
> Use a PDFThumbnailView
>
> António
> ---
> And you would accept the seasons of your
> heart, even as you have always accepted
> the seasons that pass over your field.
>
> --Kahlil Gibran
> ---
>
>
>
>


-- 
Best Regards,
Amrit.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Anybody using Pantomime or mail-core framework?

2008-05-12 Thread Omar Qazi
Well in my case, the script only let's you send email in a specific  
format (i.e. Hey __, Your friend ___ sent you _), but  
thats a good point. It's not an unsolvable problem though, all you  
need is some way to make sure the request is really coming from your  
application, like assigning a client certificate when they activate or  
something.



Omar Qazi
Hello, Galaxy!
1.310.294.1593

On May 12, 2008, at 11:07 PM, Jens Alfke wrote:



On 12 May '08, at 10:57 PM, Omar Qazi wrote:

I have an app that sends emails, and what I did is have it post the  
message parameters to my server. Then, a PHP page processes the  
parameters and sends mail using  PHP.


Cool! What's the address of your PHP script? I have a couple million  
V**gr* ads I need to send untraceably... ;-)


No, what I meant to say was, "this seems like the sort of thing that  
could be exploited by spammers, and get you blacklisted from your  
hosting site, so watch out."


—Jens




smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: list open application windows

2008-05-12 Thread Ben Lowndes
On Tue, May 13, 2008 at 4:01 PM, Jens Alfke <[EMAIL PROTECTED]> wrote:
>
> > I'm a cocoa newbie, so I may be missing something obvious here: I'd
> > like to get a list of open windows for all currently running
> > applications.
> >
>
>  Nothing personal, but people seem to ask this question here about once a
> week ... and I just have to ask "why"? What kind of application are you
> working on? I can't think of a compelling usage for this, other than writing
> some kind of window-management utility (or malware...)

Yes, exactly: I'm working on a window management utility (or I'm trying to...).

>  And BTW, if you search the list archives you'll find easily 100 messages on
> this exact topic just in the past two or three months.

Being new to Cocoa, at first it's difficult to phrase the question
correctly when searching for the answer; so for the benefit of future
searchers the solution seems to lie in using the accessability API or
an input manager. Is that correct?

Thanks,
Ben
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Anybody using Pantomime or mail-core framework?

2008-05-12 Thread Jens Alfke


On 12 May '08, at 10:57 PM, Omar Qazi wrote:

I have an app that sends emails, and what I did is have it post the  
message parameters to my server. Then, a PHP page processes the  
parameters and sends mail using  PHP.


Cool! What's the address of your PHP script? I have a couple million  
V**gr* ads I need to send untraceably... ;-)


No, what I meant to say was, "this seems like the sort of thing that  
could be exploited by spammers, and get you blacklisted from your  
hosting site, so watch out."


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: Shipping common app frameworks.

2008-05-12 Thread Omar Qazi
Are your users necessarily going to have more than one of your  
applications installed? Remember that when you put the frameworks in a  
common directory, as opposed to inside the app bundle you lose the  
ability for an application to be used by a non-admin user, as well as  
the ease of a drag and drop install.


Omar Qazi
Hello, Galaxy!
1.310.294.1593

On May 12, 2008, at 11:53 AM, David Springer wrote:


Folks,

We need to ship some frameworks that are common to a few of our apps.
The question, of course, is where to put these, and how to bundle them
with apps so downloads, etc. are not huge and bloated.  I'd like to
hear other's experience with this.  Do you put common frameworks in a
place such as /Library/Frameworks, or do you put them in your own app
support directory?  How do you handle things like a drag-to-install
and move-to-trash to uninstall (or can you with common frameworks)?




smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: list open application windows

2008-05-12 Thread Jens Alfke


On 12 May '08, at 8:15 PM, Ben Lowndes wrote:


I'm a cocoa newbie, so I may be missing something obvious here: I'd
like to get a list of open windows for all currently running
applications.


Nothing personal, but people seem to ask this question here about once  
a week ... and I just have to ask "why"? What kind of application are  
you working on? I can't think of a compelling usage for this, other  
than writing some kind of window-management utility (or malware...)


And BTW, if you search the list archives you'll find easily 100  
messages on this exact topic just in the past two or three months.


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: Anybody using Pantomime or mail-core framework?

2008-05-12 Thread Omar Qazi


I have an app that sends emails, and what I did is have it post the  
message parameters to my server. Then, a PHP page processes the  
parameters and sends mail using  PHP. One advantage to doing it this  
way is that it will work anywhere, without the user having to do any  
configuration. In my experience most SMTP servers only work on the  
local ISP / network.


Omar Qazi
Hello, Galaxy!
1.310.294.1593

On May 12, 2008, at 4:25 AM, [EMAIL PROTECTED] wrote:


I'm used pantomime framework to send mail without using any email
client.But the connection is established,after that serviceInitialized
method doesn't run.I given correct server,name and password.Anybody  
can

help me?

When the try to use Mailcore framework,the connectToServer function
throwing unknown exception,here also i've given correct initial
values.Please help me.

I've posted the my doubt in pantomime mailing list ,but no  
responce.And in
mail-core i couldn't find much help.So if any help available please  
help

me.I already having the example codes.I used it,but same error.





smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: how to create .qtz file from custom cocoa app

2008-05-12 Thread Steve Christensen

On May 12, 2008, at 9:03 PM, Shashi Kumar wrote:

Is it not possible that from UI, I will generate XML file which  
will be kind of PList file of .qtz file containing tree list of its  
properties. And from that XML file we will create .qtz file ??


And, no, there isn't a Cocoa API that will effectively "compile" an  
XML file into a .qtz file. So as I said before, my understanding is  
that the only way you can create a .qtz file is by using the Quartz  
Composer application.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: list open application windows

2008-05-12 Thread Steve Christensen

On May 12, 2008, at 8:15 PM, Ben Lowndes wrote:


I'm a cocoa newbie, so I may be missing something obvious here: I'd
like to get a list of open windows for all currently running
applications.

I've been able to get the list of running applications from
NSworkspace, but can't see a method of getting the open windows.

Using appleScript I seem to be able to reference them all but I'm
wondering if there's a cocoa method?


This is a popular topic that has been discussed a lot here on this  
(and other) lists, so it would be a good idea to do some searching.  
In general, you can only directly reference windows in your own  
process. There are methods of getting some access to windows in other  
processes via the accessibility APIs, and someone here mentioned  
recently about a new Leopard-only method but I can't remember what it  
is off the top of my head.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: "Controller Cannot Be nil" on binding NSTextField

2008-05-12 Thread Johnny Lundy
Yeah, a stupid mistake. Thanks for noticing that. I had that as  
awakeFromNib and changed it but forgot to give it a nonvoid return  
value. Since the error was about a controller, and only happened when  
I bound an IB textField, and the app ran perfectly to the console, it  
never occurred to me that there could be a problem in the code.


I've read the docs dozens of times in the past six years, attended  
four WWDCs, had Select developer for many years, have both editions of  
Aaron's book, Beam and Davidson's book, and two O'Reilly Cocoa books,  
and watched all the WWDC session videos. Been programming since 1965.  
This is the hardest stuff I ever saw. And the Apple docs are very thin  
on details. If I could just know exactly what something actually does,  
I could grok it - but the docs are very vague and superficial.


Should this code be in awakeFromNib? Does it matter?

It works now, but I still have to do the crazy

self.hoursString = [[NSNumber numberWithInt: self.hours] stringValue];

To get a string from an int for the textField to bind to. If I bind it  
to the model deadline.hours, which is a scalar int, it displays zero  
while NSLog is merrily displaying 23 from the same variable.


Is converting the int to a NSNumber and then to a string make sense  
here? Seems roundabout.


Thanks again.

On May 12, 2008, at 11:17 PM, [EMAIL PROTECTED] wrote:


Message: 12
Date: Mon, 12 May 2008 20:28:06 -0600
From: Keary Suska <[EMAIL PROTECTED]>
Subject: Re: "Controller Cannot Be nil" on binding NSTextField
To: "Cocoa-Dev (Apple)" 
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain;   charset="US-ASCII"

on 5/12/08 7:01 PM, [EMAIL PROTECTED] purportedly said:


- (void) init
{
deadlineTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
target:self selector:@selector(updateTime:) userInfo:nil  
repeats:YES];

self.deadlineHours = 24;
self.startTime = [NSCalendarDate calendarDate]; //Current date
self.endTime = [startTime dateByAddingYears:0 months:0 days:0
hours:self.deadlineHours minutes:0 seconds:0];
}


Init does not return void, it returns id. The init method is  
entirely wrong,
and this is a very fundamental issue. You need to re-read the  
Objective-C
guide and make sure you understand how to instantiate objects before  
you go

any further.

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: list open application windows

2008-05-12 Thread Andrew Farmer

On 12 May 08, at 20:15, Ben Lowndes wrote:

I'm a cocoa newbie, so I may be missing something obvious here: I'd
like to get a list of open windows for all currently running
applications.


The Application Kit Functions Reference has what you're looking for.  
Take a look at NSCountWindows() and NSWindowList().

___

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

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

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

This email sent to [EMAIL PROTECTED]


list open application windows

2008-05-12 Thread Ben Lowndes
Hi,

I'm a cocoa newbie, so I may be missing something obvious here: I'd
like to get a list of open windows for all currently running
applications.

I've been able to get the list of running applications from
NSworkspace, but can't see a method of getting the open windows.

Using appleScript I seem to be able to reference them all but I'm
wondering if there's a cocoa method?

Thanks,
Ben
___

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

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

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

This email sent to [EMAIL PROTECTED]


[SOLVED] Re: Undefined lookup, ObjC, and 64-bit

2008-05-12 Thread Nick Zitzmann


On May 12, 2008, at 1:31 PM, Jean-Daniel Dupas wrote:

Unlike the 32 bits runtime, the 64 bits runtime respects class  
symbols visibility.
If you do not export the class symbol, you cannot use it from an  
other binary (just like with C or C++ functions and classes).



Thank you. Since more than a few symbols needed to be un-hidden, I  
found that compiling with the C flag "-fvisibility=default" did  
everything I needed.


Nick Zitzmann





___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: "Controller Cannot Be nil" on binding NSTextField

2008-05-12 Thread Keary Suska
on 5/12/08 7:01 PM, [EMAIL PROTECTED] purportedly said:

> - (void) init
> {
> deadlineTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
> target:self selector:@selector(updateTime:) userInfo:nil repeats:YES];
> self.deadlineHours = 24;
> self.startTime = [NSCalendarDate calendarDate]; //Current date
> self.endTime = [startTime dateByAddingYears:0 months:0 days:0
> hours:self.deadlineHours minutes:0 seconds:0];
> }

Init does not return void, it returns id. The init method is entirely wrong,
and this is a very fundamental issue. You need to re-read the Objective-C
guide and make sure you understand how to instantiate objects before you go
any further.

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


___

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

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

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

This email sent to [EMAIL PROTECTED]


Getting Pixel Data From CIImage

2008-05-12 Thread Bridger Maxwell
Hey,
 I am trying as hard as I can to get pixel data from a CIImage, but am
failing, pretty miserably. I am using
render:toBitmap:rowBytes:bounds:format:colorSpace: from CIContext and
it seems to work, but doesn't really. I get data in my int*
pointer, but it never changes! What am I doing wrong? I posted my
code. The part in need of assistance is near the bottom of
(void)captureOutput. I would greatly appreciate your help.


Thank You,
Bridger Maxwell



- (void)captureOutput:(QTCaptureOutput *)captureOutput
didOutputVideoFrame:(CVImageBufferRef)videoFrame
withSampleBuffer:(QTSampleBuffer *)sampleBuffer
fromConnection:(QTCaptureConnection *)connection

{

 CIImage* image = [CIImage imageWithCVImageBuffer:videoFrame];



 [monoChromeFilter setValue:image forKey:@"inputImage"];  //First we
monochrome it (only black and white

 //[smoothingFilter setValue:[monoChromeFilter
valueForKey:@"outputImage"] forKey:@"inputImage"];



 if (needsNewBackground) { //If the flag has been raised we will
capture a new background

 [backgroundFilter setValue:[monoChromeFilter
valueForKey:@"outputImage"] forKey:@"inputBackgroundImage"];

 if (videoDeviceInput) {

 needsNewBackground = NO;

 }

 }



 [backgroundFilter setValue:[monoChromeFilter
valueForKey:@"outputImage"] forKey:@"inputImage"]; //Now we subtract
the background from the monochrome image

 [colorCorrectionFilter setValue:[backgroundFilter
valueForKey:@"outputImage"] forKey:@"inputImage"];

 CIImage* finalImage = [colorCorrectionFilter valueForKey:@"outputImage"];

 size_t rowBytes = [self optimalRowBytesForWidth:[finalImage
extent].size.width bytesPerPixel:4];

 int* imageData;

 [[[NSGraphicsContext currentContext] CIContext] render:finalImage

   toBitmap:imageData rowBytes:rowBytes

 bounds:[finalImage extent]

 format:kCIFormatARGB8

 colorSpace:CGColorSpaceCreateWithName(kCGColorSpaceGenericGray)];



 blobDetector->computeBlobs(imageData);

 NSLog(@"On Frame %i there are %i blobs. Sample byte 5:
%i",frameCount++,blobDetector->getBlobNb(),imageData[19]);



 [outputView setImage:finalImage];

 [outputView setNeedsDisplay:YES];

 //CIContext* theContext = [outputView ciContext];

}




- (void) drawBlobsOnCIImage:(CIImage *)image {

 for (int n=0 ; n< blobDetector->getBlobNb() ; n++)

 {

 *blob = blobDetector->getBlob(n);

 if (blob->isOk())

 {

 NSRect rectangle = NSMakeRect(blob->xMin, blob->yMin, blob->xMax -
blob->xMin , blob->yMax - blob->yMin);

 }

 }



}




- (size_t)optimalRowBytesForWidth: (size_t)width bytesPerPixel:
(size_t)bytesPerPixel

{

size_t rowBytes = width * bytesPerPixel;



//Widen rowBytes out to a integer multiple of 16 bytes

rowBytes = (rowBytes + 15) & ~15;



//Make sure we are not an even power of 2 wide.

//Will loop a few times for rowBytes <= 16.

while( 0 == (rowBytes & (rowBytes - 1) ) )

rowBytes += 16;



return rowBytes;

}
___

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

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

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

This email sent to [EMAIL PROTECTED]


"Controller Cannot Be nil" on binding NSTextField

2008-05-12 Thread Johnny Lundy

I am stuck on this error.
2008-05-12 20:58:58.257 TimerTest[65919:10b] An uncaught exception was  
raised

2008-05-12 20:58:58.259 TimerTest[65919:10b] Controller cannot be nil
2008-05-12 20:58:58.260 TimerTest[65919:10b] *** Terminating app due  
to uncaught exception 'NSInvalidArgumentException', reason:  
'Controller cannot be nil'


My code is to make a countdown timer, displayed in 3 NSTextFields for  
the hours, minutes and seconds.


The code works fine, as you see in the log output below.

However, when I bind one of the NSTextFields to any of the properties  
hours, minutes, seconds, or their string equivalents through an  
instance of my class, I get the runtime error "controller cannot be  
nil" and the nib does not load. It loads fine if I uncheck that binding.


IB: three text fields, no controllers, one NSObject (deadline) with  
class of Deadline to instantiate the class. Text fields attempted to  
bind their value to properties of this instance, e.g., deadline.hours  
or deadline.minutes.


Code:

//  Deadline.h
#import 

@interface Deadline : NSObject
{
NSTimeInterval timeToDeadline, deadlineHours;
NSTimer *deadlineTimer;
NSCalendarDate *startTime, *endTime;
int hours, minutes, seconds;
NSString *hoursString, *minutesString, *secondsString;
}
@property (readwrite) NSTimeInterval timeToDeadline;
@property (readwrite) NSTimeInterval deadlineHours;
@property (readwrite, copy) NSCalendarDate *startTime;
@property (readwrite, copy) NSCalendarDate *endTime;
@property (readwrite) int hours;
@property (readwrite) int minutes;
@property (readwrite) int seconds;
@property (readwrite, copy) NSString *hoursString;
@property (readwrite, copy) NSString *minutesString;
@property (readwrite, copy) NSString *secondsString;
@end

//  Deadline.m
#import "Deadline.h"

@implementation Deadline
@synthesize timeToDeadline, deadlineHours, startTime, endTime, hours,  
minutes, seconds, hoursString, minutesString, secondsString;


- (void) init
{
	deadlineTimer = [NSTimer scheduledTimerWithTimeInterval:1.0  
target:self selector:@selector(updateTime:) userInfo:nil repeats:YES];

self.deadlineHours = 24;
self.startTime = [NSCalendarDate calendarDate]; //Current date
	self.endTime = [startTime dateByAddingYears:0 months:0 days:0  
hours:self.deadlineHours minutes:0 seconds:0];

}

- (void) updateTime:aTimer
{
	[self.endTime years:NULL months:NULL days:NULL hours:&hours  
minutes:&minutes seconds:&seconds sinceDate:[NSCalendarDate  
calendarDate]];
	NSLog(@"Time Left: Hours: %d Minutes:%d Seconds:%d\n", hours,  
minutes, seconds);

self.hoursString = [[NSNumber numberWithInt: self.hours] stringValue];
}
@end

[Session started at 2008-05-12 20:25:45 -0400.]
2008-05-12 20:25:46.943 TimerTest[65851:10b] Time Left: Hours: 23  
Minutes:59 Seconds:58
2008-05-12 20:25:47.943 TimerTest[65851:10b] Time Left: Hours: 23  
Minutes:59 Seconds:57
2008-05-12 20:25:48.943 TimerTest[65851:10b] Time Left: Hours: 23  
Minutes:59 Seconds:56



I Googled this error and the only thing that came up was a guy totally  
re-built his nib file and the error went away.


Has anyone seen this?
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSTask waitForDataInBackgroundAndNotify and waitUntilExit

2008-05-12 Thread Torsten Curdt


On May 12, 2008, at 23:04, Shawn Erickson wrote:


Your placement of waitUntilExit is blocking the runloop which needs to
be running to service the background notifications you requested.


Ah ...I see. That makes sense.


If
you want async behavior then you cannot wait on the task (at least not
in the way you are currently attempting).

Review the following code example...

http://developer.apple.com/samplecode/Moriarity/listing5.html


Thanks for the pointer.

Well, actually I was just using waitForDataInBackgroundAndNotify  
trying to understand the options.


Looking at http://www.cocoadev.com/index.pl?NSTaskWaitUntilExit I  
would have thought this should work


NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:path];
[task setArguments:args];

NSPipe *outPipe = [NSPipe pipe];
[task setStandardOutput:outPipe];
NSFileHandle *outFile = [outPipe fileHandleForReading];

NSPipe *errPipe = [NSPipe pipe];
[task setStandardError:errPipe];
NSFileHandle *errFile = [errPipe fileHandleForReading]; 

[task launch];

NSData *data;

while((data = [outFile availableData]) && [data length]) {
[output appendString:[NSString stringWithCString:[data bytes]  
encoding: NSUTF8StringEncoding]];

}

while((data = [errFile availableData]) && [data length]) {
[error appendString:[NSString stringWithCString:[data bytes]  
encoding: NSUTF8StringEncoding]];

}

[task waitUntilExit];

While it works just fine for executing "ps" even the most simple shell  
script:


#!/bin/sh
echo "out"
echo "err" >&2
exit 0

gets stuck. No matter whether I call it directly or via "/bin/sh -c  
pathtoscript". The first call to "availableData" just blocks.  Looking  
at the documentation ("if no data is available, the method blocks") I  
am a little surprised as there should be some data available.


Any further suggestions or comments?

cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: how to wrap an NSAlert so the caller can call one function and get the NSAlert return value (i.e. modal)

2008-05-12 Thread Rua Haszard Morris

On 12 May '08, at 5:18 PM, Rua Haszard Morris wrote:

Is there a way to wrap up an NSAlert, the beginSheetModalForWindow  
call, and the alertDidEnd implementation, such that a caller can  
just call one function which blocks until the alert is dismissed?


No, because the application continues to run and other windows are  
still able to handle user input.


So if you wrote a routine like this, it would have to run the  
runloop so events got handled; and then your code associated with  
actions in other windows could be called re-entrantly down inside  
your blocking function.


I see.. this makes sense. In my case, the alert is displayed on top of  
an application-modal dialog, which makes it more feasible I suppose,  
but still an inappropriate approach?


As I rearrange the code that generates and handles the first, custom  
sheet (which uses runModalForWindow), to accomodate the second  
(confirmation in a rare error situation), standard sheet, I'll  
probably become more comfortable with this approach.


Actually, if I was to make a new alert (in the nib) myself, and show  
it using runModalForWindow, would this work?


Thanks
Rua HM.


The worst case is if you put up a sheet on one window, then the user  
does something in another window that puts up a sheet there too. Now  
you're inside two nested wait-for-sheet-to-finish functions. ...And  
then the user dismisses the first sheet. Somehow you have to return  
from the outermost function without returning from the inner one! o_O


The only way to make a programming style like this work is to use a  
thread per window (as the BeOS did), or coroutines, or something  
else exotic.


—Jens


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: how to wrap an NSAlert so the caller can call one function and get the NSAlert return value (i.e. modal)

2008-05-12 Thread Ken Thomases

On May 12, 2008, at 7:18 PM, Rua Haszard Morris wrote:
Is there a way to wrap up an NSAlert, the beginSheetModalForWindow  
call, and the alertDidEnd implementation, such that a caller can  
just call one function which blocks until the alert is dismissed?


NSAlert has the -runModal method.  However, that makes the alert  
application-modal rather than window-modal.  It's not a sheet, and  
the application can't be used for anything else until the alert is  
dismissed.


For the vast majority of applications this is the wrong user  
experience.  However, for certain rare kinds of applications it's  
appropriate.


Cheers,
Ken

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: how to wrap an NSAlert so the caller can call one function and get the NSAlert return value (i.e. modal)

2008-05-12 Thread Jens Alfke


On 12 May '08, at 5:18 PM, Rua Haszard Morris wrote:

Is there a way to wrap up an NSAlert, the beginSheetModalForWindow  
call, and the alertDidEnd implementation, such that a caller can  
just call one function which blocks until the alert is dismissed?


No, because the application continues to run and other windows are  
still able to handle user input.


So if you wrote a routine like this, it would have to run the runloop  
so events got handled; and then your code associated with actions in  
other windows could be called re-entrantly down inside your blocking  
function.


The worst case is if you put up a sheet on one window, then the user  
does something in another window that puts up a sheet there too. Now  
you're inside two nested wait-for-sheet-to-finish functions. ...And  
then the user dismisses the first sheet. Somehow you have to return  
from the outermost function without returning from the inner one! o_O


The only way to make a programming style like this work is to use a  
thread per window (as the BeOS did), or coroutines, or something else  
exotic.


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

how to wrap an NSAlert so the caller can call one function and get the NSAlert return value (i.e. modal)

2008-05-12 Thread Rua Haszard Morris
Is there a way to wrap up an NSAlert, the beginSheetModalForWindow  
call, and the alertDidEnd implementation, such that a caller can just  
call one function which blocks until the alert is dismissed?


i.e. something like
if ([SynchronousAlert showAlertWithMessageText:@"Do you want to delete  
etc" defaultButton:@"Delete" alternateButton:@"Cancel"] ==  
NSAlertFirstButtonReturn)

// delete the thing or whatever

I'm starting to see that this is probably bad cocoa style, but at the  
same time I find it very inconvenient to have to break up logic so the  
code handling the return value is in a different place from the code  
that displays the alert - is this really necessary?


For example, let's say you've already implemented some feature, and  
later realise that there is a need for a confirmation alert part-way  
through the process - you now need to split the post-confirm logic out  
to the alertDidEnd - right? Which could be a real hassle?


I've done some web & mailing list searching but haven't found any good  
alternatives. Any tips would be greatly appreciated.


Thanks
Rua HM.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSURL urlWithString return nil

2008-05-12 Thread Andy Lee
Another possibility is that there is an invisible character in your  
URL (perhaps due to copy-paste) which Safari is kind enough to escape  
for you as %11.  I would try deleting the "showtopic449" part and  
retyping it by hand to make sure there is no hidden character between  
"topic" and "449".


--Andy

On May 12, 2008, at 6:24 PM, Wayne Packard wrote:



On May 12, 2008, at 3:16 PM, Dex Morgan wrote:


Hello,
I've tried to create an NSURL with this URL:
http://forum.scmf.it/index.php?showtopic449&st
However it returns nil.
So I've tried to open it via Safari and the URL become
http://forum.scmf.it/index.php?showtopic%11449&st

%11?
Is there any way to translate these url into the correct way?


You might want to take a look at these methods in the NSString docs:

– stringByAddingPercentEscapesUsingEncoding:

– stringByReplacingPercentEscapesUsingEncoding:

wp

___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSURL urlWithString return nil

2008-05-12 Thread Andrew Farmer

On 12 May 08, at 15:16, Dex Morgan wrote:

Hello,
I've tried to create an NSURL with this URL:
http://forum.scmf.it/index.php?showtopic449&st
However it returns nil.
So I've tried to open it via Safari and the URL become
http://forum.scmf.it/index.php?showtopic%11449&st

%11?


There is indeed a weird nonprinting character in that URL. Note that  
the link gets truncated right before the "449" in Mail, for example.  
Get rid of it and it should work properly.___


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

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

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

This email sent to [EMAIL PROTECTED]


Re: @property question

2008-05-12 Thread Quincey Morris


On May 12, 2008, at 15:19, Craig Hopson wrote:

I think I've been the victim of some side effect that I cannot track  
down. With no other changes, I tried again with each style,

[ self.fieldArray addObject:inFoo ];
[ fieldArray addObject:inFoo ];
replacing all occurrences for each test, and both work - what I  
would have expected.


Incidentally, neither version is KVO-compliant. If you happen to have  
something (e.g. a NSArrayController) bound to the array property, to  
show Foos in the user interface, the effect of addObject (and  
therefore addFoo) will be to leave what's displayed out of date. This  
could possibly lead to unpredictable behavior or a crash.


The KVO-compliant way to add something to an array property would be  
something like this:


- (void)addFoo:( Bar* )inFoo
{
[ [self mutableArrayValueForKey:@"fieldArray"] addObject:inFoo ];
}

P.S. I just noticed that the inFoo looks like it needs to be a Foo*,  
not a Bar*. I assume this was just a typo when you stripped down your  
example for posting?

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: @property question

2008-05-12 Thread Clark Cox
On Mon, May 12, 2008 at 3:42 PM, Phoenix Draco
<[EMAIL PROTECTED]> wrote:
>
>  Sorry if this is naïve but I have a quick follow up q (to verify that I am
>  understanding ObjC correctly). Is it true that:
>
>  The two styles seem to me to have slightly different execution paths. The
>  first:
>
>  [self.fieldArray addObject:inFoo]
>
>  Would actually invoke the property accessor fieldArray and then send the
>  message addObject: to the returned result, i.e. Its equivalent to:
>
>  [[self getfieldArray] addObject:inFoo]

Correct, except for the fact that the method is called "fieldArray":

"[self.fieldArray addObject:inFoo]" is equivalent to "[[self
fieldArray] addObject:inFoo]" in all respects except for syntax


>  While the second form [fieldArray addObject:inFoo] would directly use the
>  member variable.
>
>  So if you (for some reason) chose to have a more complicated accessor that
>  is not simply backed by an ivar, the former may have some potential side
>  effects, yes?
>
>  Thanks,
>  Phoenix
>
>
>  On 5/12/08 3:19 PM, "Craig Hopson" <[EMAIL PROTECTED]> hollered from the
>  keytops:
>
>
>
>  > Guys,
>  >
>  > I think I've been the victim of some side effect that I cannot track
>  > down. With no other changes, I tried again with each style,
>  > [ self.fieldArray addObject:inFoo ];
>  > [ fieldArray addObject:inFoo ];
>  > replacing all occurrences for each test, and both work - what I would
>  > have expected.
>  >
>  > Thanks for your input.
>  > -Craig
>  > ___
>  >
>  > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>  >
>  > Please do not post admin requests or moderator comments to the list.
>  > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>  >
>  > Help/Unsubscribe/Update your Subscription:
>  > 
> http://lists.apple.com/mailman/options/cocoa-dev/aurora.phoenix.draco%40gmail.
>  > com
>  >
>  > This email sent to [EMAIL PROTECTED]
>
>
>
>
>  ___
>
>  Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
>  Please do not post admin requests or moderator comments to the list.
>  Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
>  Help/Unsubscribe/Update your Subscription:
>  http://lists.apple.com/mailman/options/cocoa-dev/clarkcox3%40gmail.com
>
>  This email sent to [EMAIL PROTECTED]
>



-- 
Clark S. Cox III
[EMAIL PROTECTED]
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: @property question

2008-05-12 Thread Phoenix Draco

Sorry if this is naïve but I have a quick follow up q (to verify that I am
understanding ObjC correctly). Is it true that:

The two styles seem to me to have slightly different execution paths. The
first:

[self.fieldArray addObject:inFoo]

Would actually invoke the property accessor fieldArray and then send the
message addObject: to the returned result, i.e. Its equivalent to:

[[self getfieldArray] addObject:inFoo]

While the second form [fieldArray addObject:inFoo] would directly use the
member variable.

So if you (for some reason) chose to have a more complicated accessor that
is not simply backed by an ivar, the former may have some potential side
effects, yes?

Thanks,
Phoenix


On 5/12/08 3:19 PM, "Craig Hopson" <[EMAIL PROTECTED]> hollered from the
keytops:

> Guys,
> 
> I think I've been the victim of some side effect that I cannot track
> down. With no other changes, I tried again with each style,
> [ self.fieldArray addObject:inFoo ];
> [ fieldArray addObject:inFoo ];
> replacing all occurrences for each test, and both work - what I would
> have expected.
> 
> Thanks for your input.
> -Craig
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/aurora.phoenix.draco%40gmail.
> com
> 
> This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: adding a custom view to NSPrintPanel

2008-05-12 Thread Kyle Sluder
On Mon, May 12, 2008 at 6:22 PM, Victor Bovio <[EMAIL PROTECTED]> wrote:
>  I have no idea how a NSViewController works..

Then perhaps you should read up on them?

--Kyle Sluder
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSURL urlWithString return nil

2008-05-12 Thread Wayne Packard


On May 12, 2008, at 3:16 PM, Dex Morgan wrote:


Hello,
I've tried to create an NSURL with this URL:
http://forum.scmf.it/index.php?showtopic449&st
However it returns nil.
So I've tried to open it via Safari and the URL become
http://forum.scmf.it/index.php?showtopic%11449&st

%11?
Is there any way to translate these url into the correct way?


You might want to take a look at these methods in the NSString docs:

– stringByAddingPercentEscapesUsingEncoding:

– stringByReplacingPercentEscapesUsingEncoding:

wp

___

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

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

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

This email sent to [EMAIL PROTECTED]


adding a custom view to NSPrintPanel

2008-05-12 Thread Victor Bovio

Hi,

Does anyone knows of an example or tutorial on how to this ??

The documentation says that I have to use this method on NSPrintPanel:

- (void)addAccessoryController:(NSViewController <  
NSPrintPanelAccessorizing > *)accessoryController



I have no idea how a NSViewController works..

any tips ??


Thanks.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: @property question

2008-05-12 Thread Craig Hopson

Guys,

I think I've been the victim of some side effect that I cannot track  
down. With no other changes, I tried again with each style,

[ self.fieldArray addObject:inFoo ];
[ fieldArray addObject:inFoo ];
replacing all occurrences for each test, and both work - what I would  
have expected.


Thanks for your input.
-Craig
___

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

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

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

This email sent to [EMAIL PROTECTED]


NSURL urlWithString return nil

2008-05-12 Thread Dex Morgan

Hello,
I've tried to create an NSURL with this URL:
http://forum.scmf.it/index.php?showtopic449&st
However it returns nil.
So I've tried to open it via Safari and the URL become
http://forum.scmf.it/index.php?showtopic%11449&st

%11?
Is there any way to translate these url into the correct 
way?___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: @property question

2008-05-12 Thread mmalc crawford


On May 12, 2008, at 2:30 PM, Craig Hopson wrote:

So, the question is, what is the difference between using self.  
notation and not?





mmalc

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: @property question

2008-05-12 Thread Shawn Erickson
On Mon, May 12, 2008 at 2:30 PM, Craig Hopson <[EMAIL PROTECTED]> wrote:

>  So, the question is, what is the difference between using self. notation
> and not?  I have declared the properties to retain the objects.  The
> compiler is happy, I just die at run time when I attempt to access the
> contents of a Foo.  It looks like the contents of Foo are not retained in
> the second case.

Can you post a complete code sample that shows this issue? One that
can be compiled,etc.

How does your application "die". Have you looked at the state of
things using the debugger?

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


What's with ICAImportImage?

2008-05-12 Thread Dave Hersey
Is there a way to get ICAImportImage to work correctly? Using the code  
in the docs, the ICAImportImageSample_Cocoa or the  
ICAImportImageSample_Carbon samples all gives the same results when  
built with the 10.5 SDK:


-
"An instance 0x18fb00 of class ICScanner is being deallocated while  
key value observers are still registered with it. Observation info is  
being leaked, and may even mistakenly become attached to some other  
object."


<"notificationString" NSKeyValueObservance message>

"An instance 0x18fb00 of class ICScanHelper is being deallocated while  
key value observers are still registered with it. Observation info is  
being leaked, and may even mistakenly  become attached to some other  
object."




"An instance 0x18fb00 of class ICScannerGeometry is being deallocated  
while key value observers are still registered with it. Observation  
info is being leaked, and may even mistakenly  become attached to some  
other object."



-

Or, sometimes, it just crashes.

The doc code and sample code are very simple and don't explicitly  
declare ICScanner, ICScanHelper or ICScannerGeometry objects. Those  
allocations/deallocations are happening within the framework code.


Since the Image Capture application doesn't have this problem, is it  
using a different method to run the Image Capture Scan dialog or is  
there a trick to get this to work right?


Thanks,

Dave


___

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

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

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

This email sent to [EMAIL PROTECTED]


@property question

2008-05-12 Thread Craig Hopson

Hi,

I'm looking for a little understanding...  well, someone to help me  
understand an issue I'm having with properties.


I have a class something like...
@interface Foo : NSObject
{
NSObject*   field1;
NSObject*   field2; 
NSObject*   field3;
NSObject*   field4;
}

@property( nonatomic, retain ) NSObject* field1;
@property( nonatomic, retain ) NSObject* field2;
@property( nonatomic, retain ) NSObject* field3;
@property( nonatomic, retain ) NSObject* field4;

// other methods...

@end

@implementation Foo

@synthesize field1;
@synthesize field2;
@synthesize field3;
@synthesize field4;

// other methods...
@end

In another class I have a mutable array and a method to add things to  
it

@interface Bar : NSObject
{   
NSMutableArray* fieldArray;
}

@property( retain ) NSMutableArray* fieldArray;

- (void)addFoo:( Bar* )inFoo;
- (Foo*)fooAtIndex:( NSUInteger )index;


@implementation Bar
@synthesize fieldArray;

// in the -init method storage is set up for fieldArray

// return a Foo from the array
- (Foo*)fooAtIndex:( NSUInteger )index
{
return [ fieldArray objectAtIndex:index ];
}

If I add foos to the array like this...
- (void)addFoo:( Bar* )inFoo
{
[ fieldArray addObject:inFoo ];
}
... everything is fine.

If, however, I implement addFoo like this...
- (void)addFoo:( Bar* )inFoo
{
[ self.fieldArray addObject:inFoo ];
}
... the contents of foo are invalid when I return one using fooAtIndex:

So, the question is, what is the difference between using self.  
notation and not?  I have declared the properties to retain the  
objects.  The compiler is happy, I just die at run time when I attempt  
to access the contents of a Foo.  It looks like the contents of Foo  
are not retained in the second case.  I've concluded that it's a bad  
thing to use the self. notation in general usage, but it is not at all  
clear to me why this is true and I cannot find any warning against  
this in the Obj C docs on Apple's web site.


Thanks for any insight.
-Craig

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSTask waitForDataInBackgroundAndNotify and waitUntilExit

2008-05-12 Thread Shawn Erickson
Your placement of waitUntilExit is blocking the runloop which needs to
be running to service the background notifications you requested. If
you want async behavior then you cannot wait on the task (at least not
in the way you are currently attempting).

Review the following code example...

http://developer.apple.com/samplecode/Moriarity/listing5.html

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


NSTask waitForDataInBackgroundAndNotify and waitUntilExit

2008-05-12 Thread Torsten Curdt
I am trying to make use of "waitForDataInBackgroundAndNotify" when  
executing a script. I've setup the task like this


NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:path];
[task setArguments:args];

NSPipe *outPipe = [NSPipe pipe];
[task setStandardOutput:outPipe];
NSFileHandle *outFile = [outPipe fileHandleForReading];

NSPipe *errPipe = [NSPipe pipe];
[task setStandardError:errPipe];
NSFileHandle *errFile = [errPipe fileHandleForReading]; 

[[NSNotificationCenter defaultCenter] addObserver:self
  
selector:@selector(errData:)
  
name:NSFileHandleDataAvailableNotification

   object:errFile];

[[NSNotificationCenter defaultCenter] addObserver:self
  
selector:@selector(outData:)
  
name:NSFileHandleDataAvailableNotification

   object:outFile];

[[NSNotificationCenter defaultCenter] addObserver:self
  
selector:@selector(terminated:)
  
name:NSTaskDidTerminateNotification

   object:task];

[outFile waitForDataInBackgroundAndNotify];
[errFile waitForDataInBackgroundAndNotify];

NSLog(@"launching command");
[task launch];

NSLog(@"waiting for command to finsh");
[task waitUntilExit];

and while the I get and handle the "outData" call.

-(void) outData: (NSNotification *) notification
{
NSFileHandle *fileHandle = (NSFileHandle*) [notification  
object];


NSLog(@"received out data");

NSData *data = [fileHandle availableData];

if ([data length]) {
NSLog(@"appending out data");
[output appendString:[NSString stringWithCString:[data  
bytes] encoding: NSUTF8StringEncoding]];

}

[fileHandle waitForDataInBackgroundAndNotify];

NSLog(@"receiving out done");
}

There is seems to be no NSTaskDidTerminateNotification and the task is  
just sits there and waits


launching command
waiting for command to finsh
received out data
appending out data
receiving out done

While there is a lot to find about NSTask and waitUntilExit on the net  
I could not find anything when waitForDataInBackgroundAndNotify is used.

Pointers what I am doing wrong?

cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


Cocoaheads Lake Forest (93620) meeting Wednesday, 5/14 at 7pm

2008-05-12 Thread Scott Ellsworth
CocoaHeads Lake Forest will be meeting on the second Wednesday in May.
 We will be meeting in the community room of the El Toro branch of the
Orange County Public Library at 24672 Raymond Way, Lake Forest, CA
92630.

Please join us from 7pm to 9pm on Wednesday, 5/14.

We will be discussing common Cocoa idioms and widget set, and how they
will translate to the iPhone.  (As before, examining the SDK itself is
a bit problematic until the NDA is lifted.)

We will also be digging into how the google gdata API for ObjectiveC
does its magic.

Bring your comments, your books, and your bugs, and we will leap right
in.  Feel free to email me source code that you wish to discuss, and I
will get it on the agenda.

As always, details can be found on the cocoaheads web site at
www.cocoaheads.org.

Congrats go to Tiny Planet Software
 for shipping a second release of
their Knapsack trip planning software.  Kudos for a successful indy
software release.

Thanks go to O'Reilly Media for providing us a copy of Switching to
the Mac, to be given away at the meeting.

Organizational note: I will be at WWDC during our usual meeting time
in June.  Please email me directly if you wish to run the June meeting
- as an alternative, I may reschedule and give a WWDC post mortem.

(As always, if you are getting this reminder and wish to be removed,
email me directly.)
___

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

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

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

This email sent to [EMAIL PROTECTED]


[Meeting] Chicago CocoaHeads / CAWUG - More WO development with Eclipse

2008-05-12 Thread Bob Frank

Hi All,

The Chicago CocoaHeads / Chicago Cocoa and WebObjects User Group  
(CAWUG) is holding our next meeting Tuesday, May 13th, at 7:00 PM at  
the Apple Store on Michigan Ave.



Agenda:
- Introductions & Announcements
- Bob on WO development with Eclipse
- CocoaHeads Shirts
- adjournment to O'Toole's

When:   
Tuesday, May 13th, 7:00 PM

Where:
Apple Store Michigan Avenue
679 North Michigan Ave. (at the corner of Huron & Michigan Ave.)
Chicago, IL 60611
		http://maps.yahoo.com/maps_result? 
ed=gYbE5Op_0Tokf_p7h61dwjbWtjC2r1YehzWw&csz=60611

http://tinyurl.com/26z5nb
(in case long URL gets cut)


- Bob will be presenting on WebObjects Development with Eclipse

Last time we discussed a basic install and setup of WO & Eclipse,  
this month we will cover the basics of creating a new application and  
working with Eclipse.


- CocoaHeads Shirts

Everyone who put in a request for a shirt, come to pick them up.


- O'Tooles

	We will continue the discussion at our local watering hold Timothy  
O'Toole's at 622 Fairbanks (2 blocks east of the store).



We also wish to thank the folks who run the theater space at the  
Apple store for letting us have our meetings there, and Jonathan  
'Wolf' Rentzsch for hosting the new and revived CAWUG web site.   
Thanks all.


Also, if you are working on a project and would like to talk about  
it  briefly / promote it, I think it would be fun for people to hear  
about  other people's projects.  Please email me off line and you can  
talk at  a future meeting or would like a book to review we would  
welcome that too.



Future meetings dates:  7/8/08, 8/12/2008

NOTE: There will be no June Meeting due to WWDC.



CAWUG Resources

Mail list: http://groups.google.com/group/cawug
Google Site: http://groups.google.com/group/cawug
Web Site: http://www.cawug.org/
RSS feed: http://www.cawug.org/rss.xml
	iCal: http://ical.mac.com/chicagobob/ Chicago-CocoaHeads-CAWUG (view  
on the web)
	iCal: webcal://ical.mac.com/chicagobob/Chicago-CocoaHeads-CAWUG.ics  
(subscribe to in iCal)


Cocoa Heads web site:
http://cocoaheads.org/us/ChicagoIllinois/index.html


Hope to see you at the meeting.

-Bob

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Undefined lookup, ObjC, and 64-bit

2008-05-12 Thread Jean-Daniel Dupas


Unlike the 32 bits runtime, the 64 bits runtime respects class symbols  
visibility.
If you do not export the class symbol, you cannot use it from an other  
binary (just like with C or C++ functions and classes).
Actually, I'm conditionnaly using the folowing attribute to solve this  
issue (IIRC the compiler raises an error if you use with a class  
symbol on 32 bits arch).


__attribute__((visibility("default")))


You can use 'nm' on your bundle to make sure this is the cause of this  
error.




Le 12 mai 08 à 20:14, Ken Thomases a écrit :


On May 12, 2008, at 12:39 PM, Nick Zitzmann wrote:
2. How do I fix this without building the abstract superclass into  
each bundle (which is wasteful)?


This isn't my area of expertise, but isn't this the purpose of the - 
bundle_loader linker option?


-Ken

___

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

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



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Shipping common app frameworks.

2008-05-12 Thread I. Savant
>  We need to ship some frameworks that are common to a few of our apps.
>  The question, of course, is where to put these, and how to bundle them
>  with apps so downloads, etc. are not huge and bloated.  I'd like to
>  hear other's experience with this.  Do you put common frameworks in a
>  place such as /Library/Frameworks, or do you put them in your own app
>  support directory?  How do you handle things like a drag-to-install
>  and move-to-trash to uninstall (or can you with common frameworks)?

  Yes, common frameworks should be in /Library/Frameworks or
~/Library/Frameworks. It's best to use a proper installer (which
handles authenticating the user, installing to various target folders,
running pre- and post-flight scripts, etc. which can be important for
detecting version conflicts, quitting dependent apps if they're
running, and other such issues). The drag-to-install approach in an
application that needs write access to folders requiring admin rights
is not the best approach, IMO.

--
I.S.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Shipping common app frameworks.

2008-05-12 Thread David Springer
Folks,

We need to ship some frameworks that are common to a few of our apps.
The question, of course, is where to put these, and how to bundle them
with apps so downloads, etc. are not huge and bloated.  I'd like to
hear other's experience with this.  Do you put common frameworks in a
place such as /Library/Frameworks, or do you put them in your own app
support directory?  How do you handle things like a drag-to-install
and move-to-trash to uninstall (or can you with common frameworks)?

Thanks,
Dave.S
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: how to create .qtz file from custom cocoa app

2008-05-12 Thread Steve Christensen

On May 12, 2008, at 6:30 AM, Shashi Kumar wrote:

I am looking for an cocoa app through which I can create .qtz file.  
The cocoa app will be having UI in which i 'll implement some  
effects on image. Now, lets say I 've a button export. When I 'll  
click export button, it should get saved as .qtz file. And I should  
be able to open it using quartz composer or 'll be able to render  
it in openGL.


That Cocoa app would be Quartz Composer. I don't believe there is any  
API that will allow you to create a .qtz file programmatically.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Undefined lookup, ObjC, and 64-bit

2008-05-12 Thread Ken Thomases

On May 12, 2008, at 12:39 PM, Nick Zitzmann wrote:
2. How do I fix this without building the abstract superclass into  
each bundle (which is wasteful)?


This isn't my area of expertise, but isn't this the purpose of the - 
bundle_loader linker option?


-Ken

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Cocoa string to carbon compatible C string

2008-05-12 Thread Scott Ribe
There's also the issue of the lifetime of the string. Will initSomeSystem
hang on to the char * after the call returns? If so, your code will blow up
since when the NSString goes it will take with it that C string--instead
you'd have use one of the calls that *copies* the C string into a buffer
that you provide.

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


___

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

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

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

This email sent to [EMAIL PROTECTED]


Undefined lookup, ObjC, and 64-bit

2008-05-12 Thread Nick Zitzmann
I asked this on the xcode-users list recently, but either nobody knew  
the answer, or someone did and didn't want to tell me, so maybe I'll  
have better luck asking on a related list:


I've got an application that loads some bundles. The bundles each  
contain an ObjC class that subclasses an abstract class that exists in  
the application. The bundles are compiled with the "-undefined  
dynamic_lookup" linker flag so that the linker will link the code  
without the presence of the superclass in the bundle.


This works fine when the app is running as 32-bit, but when it's  
running in 64-bit, the app fails to load the bundles, and generates a  
warning like this:


2008-05-10 00:45:42.856 TestApp[28170:813] Error loading /Users/ 
nickzman/Build/Debug/TestApp.app/Contents/Resources/MyPlugin.bundle/ 
Contents/MacOS/MyBundle:  dlopen(/Users/nickzman/Build/Debug/ 
TestApp.app/Contents/Resources/MyPlugin.bundle/Contents/MacOS/ 
MyBundle, 265): Symbol not found: _OBJC_CLASS_$_PluginSuperclass
 Referenced from: /Users/nickzman/Build/Debug/TestApp.app/Contents/ 
Resources/MyPlugin.bundle/Contents/MacOS/MyBundle

 Expected in: dynamic lookup

Yes, both the app and the plugins are being built using the same  
architecture (x86_64). And yes, PluginSuperclass does exist in the  
app. So now I need to know:


1. Why does this happen in 64-bit but not 32-bit?
2. How do I fix this without building the abstract superclass into  
each bundle (which is wasteful)?


Nick Zitzmann





___

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

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

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

This email sent to [EMAIL PROTECTED]


CoreData and "conflictList" error during save

2008-05-12 Thread Dex Morgan

Hello,
I'm using core-data in a program of mine. It uses two context where  
one of these is used in a second thread to perform saving operation.
Sometimes at the end of all operations when I perform a save operation  
on my main context I receive a

"conflictList" error.
Is there any way to avoid it by merging changes?
I've tried with
[[self managedObjectContext] processPendingChanges];
[[self managedObjectContext] commitEditing];

before save: but nothing is changed.
TIA
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: crash when resizing window

2008-05-12 Thread Corbin Dunn

And/or read this:

http://www.corbinstreehouse.com/blog/index.php/2007/10/instruments-on-leopard-how-to-debug-those-random-crashes-in-your-cocoa-app/

corbin

On May 12, 2008, at 9:20 AM, Mike Abdullah wrote:
Looks to me like you're releasing (and then deallocating) an object  
in the outline view without first informing the view that it's gone.  
It is very important to remember that outline views do NOT retain  
their items; that is the responsibility of your data source. Running  
with NSZombieEnabled may help further.


Mike.

On 12 May 2008, at 15:18, Mitchell Livingston wrote:


Hello,

I have code where i manually reorder an outline view, and when it  
is reordered it automatically resizes to fit all the items. A crash  
consistently happens when I move a subitem from one group to  
another (in other words, when I drag a row so that it is originally  
in one expandable row and is put in another). I have spent a day  
trying to track this down with no luck, and it works fine when I  
rearrange rows in their own subgroup (as in they stay under the  
same expandable row).


Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0020
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib 0x95e806e8 objc_msgSend + 24
1   com.apple.AppKit  	0x9020d58b -[NSOutlineView  
_dataSourceIsItemExpandable:] + 125
2   com.apple.AppKit  	0x901b605f -[NSOutlineView  
_drawDropHighlight] + 138
3   com.apple.AppKit  	0x901b4f9b -[NSTableView  
drawRect:] + 4552
4   com.apple.AppKit  	0x90244bbe -[NSView  
_drawRect:clip:] + 3765
5   com.apple.AppKit  	0x90243751 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1050
6   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
7   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
8   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
9   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
10  com.apple.AppKit  	0x902420b4 -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] + 759
11  com.apple.AppKit  	0x902419f7 -[NSThemeFrame  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] + 306
12  com.apple.AppKit  	0x9023e52d -[NSView  
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView 
:] + 3090
13  com.apple.AppKit  	0x9017ef09 -[NSView  
displayIfNeeded] + 933
14  com.apple.AppKit  	0x9023162f -[NSWindow  
_setFrameCommon:display:stashSize:] + 2031
15  com.apple.AppKit  	0x90230e3a -[NSWindow  
setFrame:display:] + 78
16  com.apple.AppKit  	0x902834a5  
_NSMoveHelperTimerCallBack + 1330
17  com.apple.CoreFoundation  	0x91e24b5e CFRunLoopRunSpecific  
+ 4494

18  com.apple.CoreFoundation0x91e24d18 CFRunLoopRunInMode + 88
19  com.apple.AppKit  	0x903dfcdf -[NSMoveHelper  
_doAnimation] + 889
20  com.apple.AppKit  	0x9045ec93 -[NSMoveHelper  
_resizeWindow:toFrame:display:] + 407
21  com.apple.AppKit  	0x9026bf6c -[NSWindow  
setFrame:display:animate:] + 1038
22  org.m0k.transmission  	0x00016ef6 -[Controller  
setWindowSizeToFit] + 293 (Controller.m:3874)
23  org.m0k.transmission  	0xcd95 -[Controller  
applyFilter:] + 3082 (Controller.m:2041)
24  org.m0k.transmission  	0x00010448 -[Controller  
outlineView:acceptDrop:item:childIndex:] + 1253 (Controller.m:2696)
25  com.apple.AppKit  	0x90682d90 -[NSOutlineView  
performDragOperation:] + 242
26  com.apple.AppKit  	0x9044ff15 NSCoreDragReceiveProc  
+ 1411

27  com.apple.HIServices0x909c155c DoDropMessage + 97
28  com.apple.HIServices0x909c14d2 SendDropMessage + 41
29  com.apple.HIServices0x909be83a DragInApplication + 492
30  com.apple.HIServices  	0x909bd2de CoreDragStartDragging  
+ 539
31  com.apple.AppKit  	0x9044dd9d -[NSCoreDragManager  
_dragUntilMouseUp:accepted:] + 597
32  com.apple.AppKit  	0x9044ccc2 -[NSCoreDragManager  
dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:]  
+ 1452
33  com.apple.AppKit  	0x9044c70c -[NSWindow(NSDrag)  
dragImage:at:offset:event:pasteboard:source:slideBack:] + 127
34  com.apple.AppKit  	0x90682822 -[NSOutlineView  
dragImage:at:offset:event:pasteboard:source:slideBack:] + 195
35  com.apple.AppKit  	0x9044c354 -[NSTableView  
_doImageDragUsingRowsWithIndexes:event:pasteboard:source:slideBack 
:] + 762
36  com.apple.AppKit  	0x90294390 -[NSTableView  
_performDragFromMouseDown:] + 718
37

Re: Yann Disser Resizing NSTableView columns

2008-05-12 Thread Corbin Dunn

An easier algorithm to do this on Leopard:

- (CGFloat)mySizeToFitWidthOfColumn:(NSInteger)column row: 
(NSInteger)row {

NSCell *cell = [self preparedCellAtColumn:column row:row];
return [cell cellSize].width + 1;
}

..

// for each table column:
for (NSInteger i = 0; i < [self numberOfRows]; i++) {
NSInteger cellWidth = [self  
mySizeToFitWidthOfColumn:column row:i];
// Optional: constrain it to the column min/max of the  
column, or the table itself, if there is no column (which...is strange  
for autoresize, but oh well)

sizeToFitWidth = MAX(sizeToFitWidth, cellWidth);
   }
...set the width on the table column

-corbin


On May 10, 2008, at 6:44 PM, Peter Hudson wrote:
sizeToFit   simply sets the width of a column to the width of the  
header cell - and I suspect that you
want to set the width of each column to suit the widest  cell  of  
data in that column.


Here is the heuristic to achieve that:

( Assuming that you have not changed the font for any of the  
cells ... )



[A]
get a table column  -   get the dataCell  for the column   -   send  
it the  font  message.

Assume we assign it to a variable  tableFont

[B]
Create an attributes dictionary with tableFont  like this ...

NSMutableDictionary *attributes = [NSMutableDictionary  dictionary];
[attributes  setObject:tableFont  forKey:NSFontAttributeName];


[C]
Then, by using the table data source, you use this attributes  
dictionary to check

the written size of all the data - column by column.
i.e. take each column and iterating over the data for each row in  
that column,

hence deducing the max width of the column

NSSize  writtenSize = [dataString  sizeWithAttributes:attributes];

[D]
Having collected the widths of all the columns, iterate over the  
columns
and set their widths - then you may need to send the table view a  
tile message

to sort itself out.

Don't forget to set your max width on your columns to something  
sensible.



( P G J H )
___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: crash when resizing window

2008-05-12 Thread Mike Abdullah
Looks to me like you're releasing (and then deallocating) an object in  
the outline view without first informing the view that it's gone. It  
is very important to remember that outline views do NOT retain their  
items; that is the responsibility of your data source. Running with  
NSZombieEnabled may help further.


Mike.

On 12 May 2008, at 15:18, Mitchell Livingston wrote:


Hello,

I have code where i manually reorder an outline view, and when it is  
reordered it automatically resizes to fit all the items. A crash  
consistently happens when I move a subitem from one group to another  
(in other words, when I drag a row so that it is originally in one  
expandable row and is put in another). I have spent a day trying to  
track this down with no luck, and it works fine when I rearrange  
rows in their own subgroup (as in they stay under the same  
expandable row).


Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0020
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib 0x95e806e8 objc_msgSend + 24
1   com.apple.AppKit  	0x9020d58b -[NSOutlineView  
_dataSourceIsItemExpandable:] + 125
2   com.apple.AppKit  	0x901b605f -[NSOutlineView  
_drawDropHighlight] + 138
3   com.apple.AppKit  	0x901b4f9b -[NSTableView  
drawRect:] + 4552
4   com.apple.AppKit  	0x90244bbe -[NSView  
_drawRect:clip:] + 3765
5   com.apple.AppKit  	0x90243751 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1050
6   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
7   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
8   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
9   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
10  com.apple.AppKit  	0x902420b4 -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] + 759
11  com.apple.AppKit  	0x902419f7 -[NSThemeFrame  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] + 306
12  com.apple.AppKit  	0x9023e52d -[NSView  
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]  
+ 3090
13  com.apple.AppKit  	0x9017ef09 -[NSView  
displayIfNeeded] + 933
14  com.apple.AppKit  	0x9023162f -[NSWindow  
_setFrameCommon:display:stashSize:] + 2031
15  com.apple.AppKit  	0x90230e3a -[NSWindow  
setFrame:display:] + 78
16  com.apple.AppKit  	0x902834a5  
_NSMoveHelperTimerCallBack + 1330
17  com.apple.CoreFoundation  	0x91e24b5e CFRunLoopRunSpecific +  
4494

18  com.apple.CoreFoundation0x91e24d18 CFRunLoopRunInMode + 88
19  com.apple.AppKit  	0x903dfcdf -[NSMoveHelper  
_doAnimation] + 889
20  com.apple.AppKit  	0x9045ec93 -[NSMoveHelper  
_resizeWindow:toFrame:display:] + 407
21  com.apple.AppKit  	0x9026bf6c -[NSWindow  
setFrame:display:animate:] + 1038
22  org.m0k.transmission  	0x00016ef6 -[Controller  
setWindowSizeToFit] + 293 (Controller.m:3874)
23  org.m0k.transmission  	0xcd95 -[Controller  
applyFilter:] + 3082 (Controller.m:2041)
24  org.m0k.transmission  	0x00010448 -[Controller  
outlineView:acceptDrop:item:childIndex:] + 1253 (Controller.m:2696)
25  com.apple.AppKit  	0x90682d90 -[NSOutlineView  
performDragOperation:] + 242
26  com.apple.AppKit  	0x9044ff15 NSCoreDragReceiveProc  
+ 1411

27  com.apple.HIServices0x909c155c DoDropMessage + 97
28  com.apple.HIServices0x909c14d2 SendDropMessage + 41
29  com.apple.HIServices0x909be83a DragInApplication + 492
30  com.apple.HIServices  	0x909bd2de CoreDragStartDragging  
+ 539
31  com.apple.AppKit  	0x9044dd9d -[NSCoreDragManager  
_dragUntilMouseUp:accepted:] + 597
32  com.apple.AppKit  	0x9044ccc2 -[NSCoreDragManager  
dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:] +  
1452
33  com.apple.AppKit  	0x9044c70c -[NSWindow(NSDrag)  
dragImage:at:offset:event:pasteboard:source:slideBack:] + 127
34  com.apple.AppKit  	0x90682822 -[NSOutlineView  
dragImage:at:offset:event:pasteboard:source:slideBack:] + 195
35  com.apple.AppKit  	0x9044c354 -[NSTableView  
_doImageDragUsingRowsWithIndexes:event:pasteboard:source:slideBack:]  
+ 762
36  com.apple.AppKit  	0x90294390 -[NSTableView  
_performDragFromMouseDown:] + 718
37  com.apple.AppKit  	0x902922ea -[NSTableView  
mouseDown:] + 741
38  com.apple.AppKit  	0x902a3edf -[NSOutlineView  
mouseDown:] + 611
39  org.m0k.transmission  	0x0001e278 -[To

Re: NSNumberFormatter Changes Reflected In NSTextField

2008-05-12 Thread Simon Wolf

On 9 May 2008, at 16:59, Simon Wolf wrote:

I have an NSTextField with an associated NSNumberFormatter which I  
am using to format the values shown to a specific number of decimal  
places. I have a second NSTextField which I am using to display and  
edit the number of decimal places that I want shown and I have used  
the controlTextDidEndEditing delegate method to detect a change.  
Upon a change I am using the setMinimumFractionDigits and  
setMaximumFractionDigits methods of the NSNumberFormatter to change  
the number of decimal places to be shown but I am having trouble  
getting the NSTextField to refresh without giving the control the  
focus.


If I change the value of the field then the value is displayed  
correctly:


float temp;
temp = [netAmountField floatValue];
temp++;
[netAmountField setIntValue:(int)temp];

If I don't actually change the value then the NSTextField is not  
refreshed:


[netAmountField setFloatValue:[netAmountField floatValue]];

I'm fairly sure that this is simply due to the NSTextField being  
clever enough to realise that the value has not changed and  
therefore it doesn't re-display the value and trigger the new format  
and I am equally sure that I'm missing a simple way to achieve the  
refresh but after an hour of messing around I though I'd ask wiser  
folk.



I realise that it may be bad form to reply to my own message but I  
wanted a solution to be stored in the archives for anyone else who is  
in the early stages of Cocoa and hits the same sort of problem.


As an aside, I removed the Number formatters from my NIB file and  
replaced them with NSNumberFormatters. This was so that I could use  
the OS X v10.4 version rather than the buggy 10.0 one. I'm sure it  
would make no difference in this instance but I think it's better to  
adopt best practices early.


However, the actual solution is to re-set the string value of the  
NSTextFields:


[netAmountField setStringValue:[NSString stringWithFormat:@"%f", 
[netAmountField floatValue]]];


I'm still not 100% sure why this works when setting the value of the  
NSTextField to a float doesn't but, hey, at least it works.


Simon




smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: Flash'In'App – Free Cocoa Framework

2008-05-12 Thread John Stiles
There are a couple of gotchas... trying to disable the right-click menu 
is one issue (maybe you can subclass the view for this, I haven't 
tried), and having the Flash app send messages back to the main app is 
another problem.



Julia Rixon wrote:

Ferhat Ayaz wrote:

Why don't load flash via WebKit ?

Ferhat


You can use WebKit for some purposes, but sometimes it doesn’t allow 
to implement all necessary features. For example there is no option to 
disable "Flash Local Security". Many features are hard to implement 
using WebKit.



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Core data model, bindings advice.

2008-05-12 Thread Steven Huey

Steven,

In my app I have a similar setup, although without the detail view.

I have the Table Column of my NSOutlineView bound to a  
NSTreeController using the Controller Key "arrangedObjects" and the  
Model Key Path set to the name of a method in the custom  
NSManagedObject subclass that my NSTreeController is managing.


The table columns of my NSTableView are bound to an NSArrayController  
whose content set is bound to my NSTreeController's selection. Each  
column is then bound to a property of the entity returned by the array  
controller's content.


I think you could bind your detail view similarly, to the current  
selection of your array controller.


Take a look at: http://homepage.mac.com/mmalc/CocoaExamples/controllers.html 
 for lots of great examples of how to use bindings.


Best regards,
Steven Huey

--
Steven Huey Software - http://www.stevenhuey.com

On May 12, 2008, at 8:03 AM, Steven Hamilton wrote:


Hi folks,
Continuing my learning into Cocoa I'm developing a personal finance  
application. An admirable project I believe since none available  
suit my purposes and it always pays to have a project that one would  
use to learn from.


I have a simple core data model consisting of AccountGroup, Account,  
Transaction and I've jammied these all into a window with outline  
view, transaction tableview and detail at the bottom. The model  
looks like this;


AccountGroup (Asset, expense, income etc)name (string)
accounts (relationship to Account)Account (Bank, Savings etc)name  
(string)

transactions (fetched properties explained below)
credit (relationship to transaction)
debit (relationship to transaction)Transaction
memo (string)
date (date)
amount (NSNumber)
fromAccount (reverse of debit)
toAccount (reverse of credit)
I believe this to be the true model as a transaction is an object  
and is of an amount that goes from somewhere to somewhere. This is  
double entry accounting. My problem is in presenting this to the user.


Problem 1

Most finance apps, and mine included you select an account from a  
list (my outlineview) and it then displays all the transactions  
involved. So I created a fetched property with a predicate that  
included any transactions that had the selected account name in  
either fromAccount or toAccount. This works to a point. My tableview  
displays all the transactions of the selected account but since its  
a fetched properties (contentArray) the list isn't the true  
transaction array (contentSet), therefore I cannot add to it using  
the bound detail table below it.


I must admit the bindings for this are really playing with my head.  
I struggled quite immensely getting the selection from the  
treecontroller and in the end it started working without me fully  
understanding why. I have further complications to come as I have  
the decide whether the transaction amount is a debit or credit  
(based on the from/to account relationships) and then display the  
amount in the correct column and then also work out a way to add  
transactions back in like this.


It seems even though I'm set on what I believe to be the correct  
data model for this, the method of which a user expects to see this  
information is a little too different. Does anyone have any advice?  
Have I talked too much?

___

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

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

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

This email sent to [EMAIL PROTECTED]






___

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

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

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

This email sent to [EMAIL PROTECTED]


crash when resizing window

2008-05-12 Thread Mitchell Livingston

Hello,

I have code where i manually reorder an outline view, and when it is  
reordered it automatically resizes to fit all the items. A crash  
consistently happens when I move a subitem from one group to another  
(in other words, when I drag a row so that it is originally in one  
expandable row and is put in another). I have spent a day trying to  
track this down with no luck, and it works fine when I rearrange rows  
in their own subgroup (as in they stay under the same expandable row).


Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0020
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib 0x95e806e8 objc_msgSend + 24
1   com.apple.AppKit  	0x9020d58b -[NSOutlineView  
_dataSourceIsItemExpandable:] + 125
2   com.apple.AppKit  	0x901b605f -[NSOutlineView  
_drawDropHighlight] + 138
3   com.apple.AppKit  	0x901b4f9b -[NSTableView drawRect:]  
+ 4552
4   com.apple.AppKit  	0x90244bbe -[NSView  
_drawRect:clip:] + 3765
5   com.apple.AppKit  	0x90243751 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1050
6   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
7   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
8   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
9   com.apple.AppKit  	0x90243aa5 -[NSView  
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1902
10  com.apple.AppKit  	0x902420b4 -[NSView  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] + 759
11  com.apple.AppKit  	0x902419f7 -[NSThemeFrame  
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView 
:] + 306
12  com.apple.AppKit  	0x9023e52d -[NSView  
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] +  
3090
13  com.apple.AppKit  	0x9017ef09 -[NSView  
displayIfNeeded] + 933
14  com.apple.AppKit  	0x9023162f -[NSWindow  
_setFrameCommon:display:stashSize:] + 2031
15  com.apple.AppKit  	0x90230e3a -[NSWindow  
setFrame:display:] + 78
16  com.apple.AppKit  	0x902834a5  
_NSMoveHelperTimerCallBack + 1330
17  com.apple.CoreFoundation  	0x91e24b5e CFRunLoopRunSpecific +  
4494

18  com.apple.CoreFoundation0x91e24d18 CFRunLoopRunInMode + 88
19  com.apple.AppKit  	0x903dfcdf -[NSMoveHelper  
_doAnimation] + 889
20  com.apple.AppKit  	0x9045ec93 -[NSMoveHelper  
_resizeWindow:toFrame:display:] + 407
21  com.apple.AppKit  	0x9026bf6c -[NSWindow  
setFrame:display:animate:] + 1038
22  org.m0k.transmission  	0x00016ef6 -[Controller  
setWindowSizeToFit] + 293 (Controller.m:3874)
23  org.m0k.transmission  	0xcd95 -[Controller  
applyFilter:] + 3082 (Controller.m:2041)
24  org.m0k.transmission  	0x00010448 -[Controller  
outlineView:acceptDrop:item:childIndex:] + 1253 (Controller.m:2696)
25  com.apple.AppKit  	0x90682d90 -[NSOutlineView  
performDragOperation:] + 242
26  com.apple.AppKit  	0x9044ff15 NSCoreDragReceiveProc +  
1411

27  com.apple.HIServices0x909c155c DoDropMessage + 97
28  com.apple.HIServices0x909c14d2 SendDropMessage + 41
29  com.apple.HIServices0x909be83a DragInApplication + 492
30  com.apple.HIServices  	0x909bd2de CoreDragStartDragging +  
539
31  com.apple.AppKit  	0x9044dd9d -[NSCoreDragManager  
_dragUntilMouseUp:accepted:] + 597
32  com.apple.AppKit  	0x9044ccc2 -[NSCoreDragManager  
dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:] +  
1452
33  com.apple.AppKit  	0x9044c70c -[NSWindow(NSDrag)  
dragImage:at:offset:event:pasteboard:source:slideBack:] + 127
34  com.apple.AppKit  	0x90682822 -[NSOutlineView  
dragImage:at:offset:event:pasteboard:source:slideBack:] + 195
35  com.apple.AppKit  	0x9044c354 -[NSTableView  
_doImageDragUsingRowsWithIndexes:event:pasteboard:source:slideBack:] +  
762
36  com.apple.AppKit  	0x90294390 -[NSTableView  
_performDragFromMouseDown:] + 718
37  com.apple.AppKit  	0x902922ea -[NSTableView  
mouseDown:] + 741
38  com.apple.AppKit  	0x902a3edf -[NSOutlineView  
mouseDown:] + 611
39  org.m0k.transmission  	0x0001e278 -[TorrentTableView  
mouseDown:] + 515 (TorrentTableView.m:399)
40  com.apple.AppKit  	0x9024aac3 -[NSWindow sendEvent:] +  
5381
41  com.apple.AppKit  	0x90217714 -[NSApplication  
sendEvent:] + 2780

42  com.apple.AppKit0x901750f9 -[NSApplication run] + 847
43  com.apple.AppKit0x9014230a NSApplicationMain + 574
44  org.m

how to create .qtz file from custom cocoa app

2008-05-12 Thread Shashi Kumar
Hi All,
 I am a newb. I am looking for an cocoa app through which I can create 
.qtz file. The cocoa app will be having UI in which i 'll implement some 
effects on image. Now, lets say I 've a button export. When I 'll click export 
button, it should get saved as .qtz file. And I should be able to open it using 
quartz composer or 'll be able to render it in openGL.

 Can any one please tell, how this can be done ? It 'ld b kind if 
explain the approach step wise, if possible with some code.

with regards,
shashi.


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

___

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

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

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

This email sent to [EMAIL PROTECTED]


Core data model, bindings advice.

2008-05-12 Thread Steven Hamilton

Hi folks,
Continuing my learning into Cocoa I'm developing a personal finance  
application. An admirable project I believe since none available suit  
my purposes and it always pays to have a project that one would use to  
learn from.


I have a simple core data model consisting of AccountGroup, Account,  
Transaction and I've jammied these all into a window with outline  
view, transaction tableview and detail at the bottom. The model looks  
like this;


AccountGroup (Asset, expense, income etc)name (string)
accounts (relationship to Account)Account (Bank, Savings etc)name  
(string)

transactions (fetched properties explained below)
credit (relationship to transaction)
debit (relationship to transaction)Transaction
memo (string)
date (date)
amount (NSNumber)
fromAccount (reverse of debit)
toAccount (reverse of credit)
I believe this to be the true model as a transaction is an object and  
is of an amount that goes from somewhere to somewhere. This is double  
entry accounting. My problem is in presenting this to the user.


Problem 1

Most finance apps, and mine included you select an account from a list  
(my outlineview) and it then displays all the transactions involved.  
So I created a fetched property with a predicate that included any  
transactions that had the selected account name in either fromAccount  
or toAccount. This works to a point. My tableview displays all the  
transactions of the selected account but since its a fetched  
properties (contentArray) the list isn't the true transaction array  
(contentSet), therefore I cannot add to it using the bound detail  
table below it.


I must admit the bindings for this are really playing with my head. I  
struggled quite immensely getting the selection from the  
treecontroller and in the end it started working without me fully  
understanding why. I have further complications to come as I have the  
decide whether the transaction amount is a debit or credit (based on  
the from/to account relationships) and then display the amount in the  
correct column and then also work out a way to add transactions back  
in like this.


It seems even though I'm set on what I believe to be the correct data  
model for this, the method of which a user expects to see this  
information is a little too different. Does anyone have any advice?  
Have I talked too much?

___

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

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

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

This email sent to [EMAIL PROTECTED]


Anybody using Pantomime or mail-core framework?

2008-05-12 Thread vinitha
I'm used pantomime framework to send mail without using any email
client.But the connection is established,after that serviceInitialized
method doesn't run.I given correct server,name and password.Anybody can
help me?

When the try to use Mailcore framework,the connectToServer function
throwing unknown exception,here also i've given correct initial
values.Please help me.

I've posted the my doubt in pantomime mailing list ,but no responce.And in
mail-core i couldn't find much help.So if any help available please help
me.I already having the example codes.I used it,but same error.


thanks

___

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

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

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

This email sent to [EMAIL PROTECTED]


ImageLoaderMachO::resolveUndefined

2008-05-12 Thread Michael Vannorsdel
I'm getting this crash when running on PPC Tiger only.  Leopard and  
all Intel work fine:


Thread 0 Crashed:
0   com.apple.CoreFoundation0x92009780 CFDictionaryAddValue + 76
1   dyld  	0x8fe13ed4  
ImageLoaderMachO::resolveUndefined(ImageLoader::LinkContext const&,  
macho_nlist const*, bool, ImageLoader const**) + 1224

2   com.apple.CoreFoundation0x91fd7950 __CFAllocatorCreate + 220
3   com.mv.mvworldviewer0x00018908 start + 91320
4   com.mv.mvworldviewer0x2dbc start + 2412
5   com.apple.CoreFoundation  	0x920b0b00 -[NSSet  
makeObjectsPerformSelector:] + 200
6   com.apple.AppKit  	0x90688b6c -[NSIBObjectData  
nibInstantiateWithOwner:topLevelObjects:] + 1264

7   com.apple.AppKit0x90680170 loadNib + 224
8   com.apple.AppKit  	0x9067fb14 +[NSBundle(NSNibLoading)  
_loadNibFile:nameTable:withZone:ownerBundle:] + 840
9   com.apple.AppKit  	0x9067f6f0 +[NSBundle(NSNibLoading)  
loadNibNamed:owner:] + 336

10  com.apple.AppKit0x9067f3d8 NSApplicationMain + 332
11  com.mv.mvworldviewer0x2778 start + 808
12  com.mv.mvworldviewer0x247c start + 44

I'm just allocating a custom allocator and there's no code difference  
between archs.  All the context functions are properly set and  
available.  I'm not familiar with the ImageLoaderMachO class so I  
don't know the purpose of the resolveUndefined method.  If I did it  
might help track the problem.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: images in NSTableView

2008-05-12 Thread Graham Cox


On 12 May 2008, at 8:58 pm, Graham Cox wrote:

it's maybe more than you need and it also takes an NSColor object  
value



Oops, that came out not the way I intended it - I meant that you'll  
need to do more than this code does for your case - i.e. displaying  
two (or more?) colours in a cell, but this might point the way. When  
your table asks for the object value for the table row/column, you  
could supply an array of NSColors, and the cell would be programmed to  
understand that and display it appropriately.


G.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: images in NSTableView

2008-05-12 Thread Graham Cox
While it's probably slightly more work, you'd be better off writing a  
custom NSCell subclass than trying to turn colours into images and  
displaying them in a NSImageCell, IMO.


Here's part of one I did recently for colours - it's maybe more than  
you need and it also takes an NSColor object value, rather than a  
string, so you need to deal with that too (a dictionary could help you  
map colour name -> colour object) but you'd have the exact same  
problem using an image.


To use the custom cell class, at some sensible point in the  
initialisation or set up (I use NSWindowController's windowDidLoad:  
method, as the controller has an outlet to the table view that  
contains it) do something like:


GCColourCell* cc = [[[GCColourCell alloc] init] autorelease];
	[[mLayersTable tableColumnWithIdentifier:@"selectionColour"]  
setDataCell:cc];






@implementation GCColourCell


#pragma mark As a GCColourCell


- (void)setColorValue:(NSColor*) colour
{
[colour retain];
[mColour release];
mColour = colour;   // mColour is an ivar
}


- (NSColor*)colorValue
{
return mColour;
}


- (void)setState:(BOOL) state
{
mHighlighted = state;   // mHighlighted is an ivar
}


#pragma mark -
#pragma mark As a NSCell

-(void)			drawInteriorWithFrame:(NSRect) theFrame inView:(NSView*)  
theView

{
#pragma unused(theView)

if([self colorValue] != nil )
{
NSRect r;

		// could use NSColor's -drawSwatchInRect: here, but I don't want the  
opacity cue


if ( mHighlighted )
[[NSColor darkGrayColor] set];
else
[[NSColor whiteColor] set];
r = NSInsetRect( theFrame, 6, 5 );
NSRectFill( r );

r = NSInsetRect( theFrame, 8, 7 );

[[self colorValue] set];
NSRectFill( r );

r = NSInsetRect( theFrame, 6, 5 );
[[NSColor darkGrayColor] set];
NSFrameRectWithWidth( r, 1 );
}
}


- (void)setObjectValue:(id) obj
{
if([obj isKindOfClass:[NSColor class]])
[self setColorValue:obj];
else
[self setColorValue:nil];
}


- (id)  objectValue
{
return [self colorValue];
}


@end


On 12 May 2008, at 7:27 pm, Yann Disser wrote:

I need to display images in one column of a NSTable view. Right now,  
the column contains values like "green", "red", "red green", "blue"  
etc. I want to replace those strings with images of the  
corresponding color(s) - in the case of "red green" by two images, a  
red and a green one. I do not really understand, what I have to do  
to accomplish this.


Thanks for your help,
Yann
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/graham.cox%40bigpond.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


images in NSTableView

2008-05-12 Thread Yann Disser
I need to display images in one column of a NSTable view. Right now,  
the column contains values like "green", "red", "red green", "blue"  
etc. I want to replace those strings with images of the corresponding  
color(s) - in the case of "red green" by two images, a red and a green  
one. I do not really understand, what I have to do to accomplish this.


Thanks for your help,
Yann
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Flash'In'App – Free Cocoa Framework

2008-05-12 Thread Julia Rixon

Ferhat Ayaz wrote:

Why don't load flash via WebKit ?

Ferhat


You can use WebKit for some purposes, but sometimes it doesn’t allow to 
implement all necessary features. For example there is no option to 
disable "Flash Local Security". Many features are hard to implement 
using WebKit.


--
Sincerely yours,

Julia Rixon




On May 5, 2008, at 12:55 PM, Julia Rixon wrote:


http://www.eltima.com/products/cocoa-framework/

Flash'In'App is a free Cocoa framework that lets you load and fully 
manage Adobe® Flash movies directly from your own applications for Mac 
OS X. Flash'In'App is a set of several specific classes to manage and 
fully control all the aspects of Flash manipulations in your application.


Flash'In'App will help you:
- Playback any Flash movie inside of your application (a banner, a 
tutorial, anything)


- Completely re-design your application using the latest possibilities 
of Flash, make it stand out and match your exquisite design and 
user-interactivity requirements without the need to develop custom 
controls, etc.


- Develop and deploy eye-catching high quality interactive interfaces 
with minimum effort in Flash


- Distribute Flash-enabled desktop widgets, Flash games as compiled 
applications


- Create custom-shaped applications (Intel-based Macs only)

- Run your Windows Flash-enabled applications' GUI on Mac

Flash'In'App is a great alternative for all developers who don't want 
to waste their time and write all the code manually. With our 
framework your applications will be times more functional and advanced.


-

Julia Rixon

___

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

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

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

This email sent to [EMAIL PROTECTED]


Ferhat

http://www.thinkcocoa.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/julia.rixon%40eltima.com

This email sent to [EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Flash'In'App ? Free Cocoa Framework

2008-05-12 Thread Julia Rixon

Gordon Apple wrote:

Some of us want to incorporate Flash directly in our applications
without WebKit.  I've been in discussions with Eltima for awhile on this.
The framework is free for personal use, but $399 (IMHO, not a bad price) for
a commercial license.  Unfortunately, you have to buy the commercial version
to get the documentation.  We are planning on using it.  As far as I can
tell, they're the only game in town for this.

G. Apple
Ed4U


Our help documentation contains two parts: "API Reference" and 
"Programming Guide". "API Reference" is available in free version of 
Flash'in'App and "Programming Guide" is provided in commercial version only.


--
Sincerely yours,

Julia Rixon
___

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

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

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

This email sent to [EMAIL PROTECTED]