NSAttributedString fill with gradient

2009-12-17 Thread Chris Purcell
I've tried setting the gradient as NSForegroundColorAttributeName in the 
attributes dictionary when creating the string but as I expected that didn't 
work. How would I go about filling the string with a gradient?

Thanks!

--Chris
___

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

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

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

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


NSOperationQueue for NSXMLParser object

2009-11-05 Thread Chris Purcell
Let me start with what I'm trying to accomplish.  I have an app that  
is constantly running an animation, which's attributes are determined  
after downloading and parsing some XML.  The XML is parsed at a given  
interval using an NSTimer.  As expected, sometimes when the XML is  
being parsed the animation stalls.  I've determined that I'll need to  
do the parsing on a separate thread from the main thread (Unless there  
is a better solution?).


I'm running into some problems using NSOperation with a NSTimer.  Here  
are some portions of the code:

//From the App delegate

//create a timer to parse the XML
self.timer = [NSTimer scheduledTimerWithTimeInterval: 2

  target: self

selector: @selector(parseXML:)

userInfo: nil

 repeats: YES]; 

//Parse the XML
- (void) parseXML:(NSTimer *)timer {
		XMLParser *parser = [[XMLParser alloc] initWithURL:@Location of the  
XML delegate:self];

[queue addOperation:parser];
[parser release]; //this is where my problem is
}


XMLParser is a subclass of NSOperation, here is some of that class.

- (void)main {
[self startParsing]; //this method starts the parsing   
 }

 When the parsing is complete, I use this code to send the result  
back to the delegate object:

//sends the result back to the delegate
if ( [delegate respondsToSelector:@selector(status:)] ) {
[delegate status:self.result];  
}

This code works, as long as I don't release the parser object after  
this:


[queue addOperation:parser];
[parser release];

However, if I don't release the Parser object, the app leaks like  
crazy, since it's creating new Parser objects on each fire of the  
timer.  When I release the parser, the second fire the app terminates:  
Program received signal:  “EXC_BAD_ACCESS”..


Thank you for any advice!









___

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

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

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

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


iCal Notifications

2009-08-06 Thread Chris Purcell
I asked this question a while back, didn't get an answer.  Figured I'd  
give it another shot.  Is there any access to these notifications  
through the calendar API?  Or is there another way to get access to it?


Here is an example of what the notifications are: 
http://images.apple.com/hk/en/server/macosx/features/images/ical_notifications20090608.jpg

Thanks!

--Chris


___

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

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

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

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


NSURLRequest- setHTTPMethod to REPORT

2009-05-29 Thread Chris Purcell

Hello,

I'm trying to issue a REPORT request to a server, the HTTP Method  
header needs to look like this:


REPORT /bernard/work/ HTTP/1.1

So I use setHTTPMethod to set the HTTP Method: [theRequest  
setHTTPMethod:@REPORT /bernard/work/];


But when I issue the request, the server returns an error, because  
there is an extra / in the request line:


Bad request line: REPORT bernard/work/ / HTTP/1.1



Am I doing this the wrong way or is this not possible?

Thanks,

--Chris
___

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

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

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

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


Move a NSTableView

2009-04-22 Thread Chris Purcell

Hello,

I'm trying to shift a NSTableView down when the user is searching  
(using a NSSearchField) to display a custom view with some filtering  
options (like when you do a Finder search).  Then hiding the custom  
view when the user is not searching.


My problem is how exactly to move the table view down.  I tried  
getting the frame of the table view's enclosed NSScrollView and then I  
was quite sure what method to use (probably something in Core Graphics  
right?) to move it down.


Thanks!

--Chris
___

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

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

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

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


Create folder in protected directory

2009-04-16 Thread Chris Purcell

Hello everyone,

My App has to create a folder in a directory owned by the system.  How  
would I go about doing this, do I need to use the security framework  
and get the user to authenticate themselves as an admin?


Thanks!

--Chris


___

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

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

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

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


Re: Create folder in protected directory

2009-04-16 Thread Chris Purcell
Thanks for reply Kyle.  The app restores a user's user folder and  
needs to recreate that folder within the /Users directory.  Is there  
an easier way to accomplish this then having to use the Authorization  
services C library?




On Apr 16, 2009, at 3:53 PM, Kyle Sluder kyle.slu...@gmail.com wrote:

On Thu, Apr 16, 2009 at 5:59 PM, Chris Purcell haroldthehun...@mac.com 
 wrote:
My App has to create a folder in a directory owned by the system.   
How would
I go about doing this, do I need to use the security framework and  
get the

user to authenticate themselves as an admin?


Yes, the Security framework is necessary here, but the more important
question is why you need to do this.

--Kyle Sluder

___

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

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

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

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


NSScrollView like iTunes

2009-03-20 Thread Chris Purcell
I'm trying to create a view similar to the left iTunes bar (http://i39.tinypic.com/2hwp7w5.png 
) and many other apps (Mail, iCal, etc.).  Is this a NSScrollView or  
NSOutlineView?  Or am I going about this the wrong way.


Thanks,

--Chris


___

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

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

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

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


Re: NSStatusItem when clicked shows custom view

2009-03-06 Thread Chris Purcell

Thanks Clint and Ben,

MAAttachedWindow is exactly what I needed!

--Chris

On Mar 6, 2009, at 6:21 AM, Clint Shryock wrote:

Matt Gemmell has MAAttachedWindow, a sub class of NSWindow listed  
here:

http://mattgemmell.com/source

it comes with a sample project that shows it working with an  
NSStatusItem.  See if that will suit your needs


+Clint


On Thu, Mar 5, 2009 at 1:03 PM, Chris Purcell  
haroldthehun...@mac.com wrote:
I'm looking to do something similar to this app: http://transmissionapps.com/ 
 (Logbook).  I've seen that done in a handful of apps, a custom  
window/view invoked when the NSStatusItem is clicked.  My two  
quesitons:


1)  How is that window created.  Is it a custom NSWindow or a  
regular NSWindow with a custom view?


2)  How can I position the window so that it is directly below the  
NSStatusItem?


Or am I going about this the wrong way.

Thanks!

--Chris
___

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

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

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

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



___

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

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

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

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


NSStatusItem when clicked shows custom view

2009-03-05 Thread Chris Purcell
I'm looking to do something similar to this app: http://transmissionapps.com/ 
 (Logbook).  I've seen that done in a handful of apps, a custom  
window/view invoked when the NSStatusItem is clicked.  My two quesitons:


1)  How is that window created.  Is it a custom NSWindow or a regular  
NSWindow with a custom view?


2)  How can I position the window so that it is directly below the  
NSStatusItem?


Or am I going about this the wrong way.

Thanks!

--Chris
___

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

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

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

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


Re: Output of NSHTTPCookieStorage to NSTableView

2008-07-01 Thread Chris Purcell
Again thank you for the reply.  Thanks to the column identifier, I am  
able to see data in the table view!  However, when I attempt to click  
on a row or scroll down I receive an error in the console.


-[NSURL objectAtIndex:]: unrecognized selector sent to instance  
0x10edd0


I've tried with different column identifiers (name, value, created,  
etc.) and no luck.  Am I not returning the cookie correctly, should I  
returning them as specific types of data, like you noted in your first  
reply?


How would I return domain for example?

Thank you!



On Jun 29, 2008, at 11:31 PM, Jens Alfke wrote:



On 29 Jun '08, at 9:47 PM, Chris Purcell wrote:

Thank you for the reply.  I am a bit of a Cocoa newbie and I'm  
having trouble using the objectValueForTableColumn:.  My  
NSTableView is only one column, but I would like to display all  
attributes of each key.


You should have one column per attribute. If you look at any typical  
table display (in Mail, or the Finder, or iTunes...) you'll see that  
each column shows one attribute of the message/file/song.


This is an example of what is outputting when I display a entry of  
the NSArray:
NSHTTPCookie version:0 name:@SC value:@RV=661339  
expiresDate:@2038-01-17 11:14:07 -0800  
created:@236061243.432815 sessionOnly:FALSE domain:@.google.com  
path:@/finance secure:FALSE comment:@(null)  
commentURL:@(null) portList:(null)

Is this a dictionary?


No, that's just the string that an NSHTTPCookie object returns from  
its -description method.


What would be the easiest way to display each one of the attributes  
of the dictionary (version, name, value, etc.) in a separate  
column?  How could I return just one of the attributes?


If you just want to display the domain, then return [cookie domain].  
If you want to return the path, return [cookie path]. Et cetera.


A common trick is to set the identifier property of each table  
column (in IB) to be a property name. Then your - 
objectValueForTableColumn method can get the object for the row and  
call -valueForKey: on it, using the column identifier, like:


NSHTTPCookie *cookie = [_cookies objectAtIndex: row];
NSString *identifier = [column identifier];
return [cookie valueForKey: identifier];

—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: Output of NSHTTPCookieStorage to NSTableView

2008-06-29 Thread Chris Purcell
Thank you for the reply.  I think right now the simplest would be to  
convert the cookies array to an array of NSStrings.  What would be the  
easiest way to do this?


Thank you!


On Jun 28, 2008, at 9:56 PM, Shawn Erickson wrote:

On Sat, Jun 28, 2008 at 9:46 PM, Chris Purcell [EMAIL PROTECTED] 
 wrote:

Hello,
Not sure where my problem is I've tried a few things and no  
success.  I am

trying to output NSHTTPCookieStorage *cookies array to a table view.
Whenever I call the objectValueForTableColumn:row method the app  
errors
out, but if I leave it out the app launches displaying the correct  
number of
rows with nothing in it (as expected since I left out the other  
method).


Here is the code to get the cookies array:

  NSHTTPCookieStorage* sharedCookieStorage = [NSHTTPCookieStorage
sharedHTTPCookieStorage];
  cookies = [sharedCookieStorage cookies] ;

Here is the code to output the data to the table view:

- (int)numberOfRowsInTableView:(NSTableView *)tableView
{
  return [cookies count];
}


- (id)tableView:(NSTableView *)tableView
objectValueForTableColumn:(NSTableColumn *)tableColumn
  row:(int)row
{
  return [cookies objectAtIndex:row];
}


What type of NSCell do you have set for the column (looks like you
only have a single column)? It is a specialized NSCell subclass that
knows how to display an instance NSHTTPCookie? If not this isn't going
to work as coded.

NSHTTPCookie isn't a string, number, image, etc. so one of the
standard cell subclasses wont know what to do with it. You either need
a custom cell subclass that can display it the way you want it
displayed or you will have to convert the NSHTTPCookie instance into a
form that a standard cell can handle (maybe an NSString).

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


Re: Output of NSHTTPCookieStorage to NSTableView

2008-06-29 Thread Chris Purcell
Thank you for the reply.  I am a bit of a Cocoa newbie and I'm having  
trouble using the objectValueForTableColumn:.  My NSTableView is only  
one column, but I would like to display all attributes of each key.


This is an example of what is outputting when I display a entry of the  
NSArray:


NSHTTPCookie version:0 name:@SC value:@RV=661339  
expiresDate:@2038-01-17 11:14:07 -0800 created:@236061243.432815  
sessionOnly:FALSE domain:@.google.com path:@/finance secure:FALSE  
comment:@(null) commentURL:@(null) portList:(null)


Is this a dictionary?  What would be the easiest way to display each  
one of the attributes of the dictionary (version, name, value, etc.)  
in a separate column?  How could I return just one of the attributes?


Thank you!



On Jun 29, 2008, at 12:56 PM, Jens Alfke wrote:



On 29 Jun '08, at 9:39 AM, Chris Purcell wrote:

Thank you for the reply.  I think right now the simplest would be  
to convert the cookies array to an array of NSStrings.  What would  
be the easiest way to do this?


Keep the array as an array of NSHTTPCookies. But your - 
objectValueForTableColumn: should look up the cookie object for the  
row, and then get the right attribute of the cookie based on the  
column identifier. For instance, if the column shows URLs, then you  
should get the URL of the cookie and return its absoluteString. If  
it shows dates, return an NSDate.


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

Output of NSHTTPCookieStorage to NSTableView

2008-06-28 Thread Chris Purcell

Hello,
Not sure where my problem is I've tried a few things and no success.   
I am trying to output NSHTTPCookieStorage *cookies array to a table  
view.  Whenever I call the objectValueForTableColumn:row method the  
app errors out, but if I leave it out the app launches displaying the  
correct number of rows with nothing in it (as expected since I left  
out the other method).


Here is the code to get the cookies array:

	NSHTTPCookieStorage* sharedCookieStorage = [NSHTTPCookieStorage  
sharedHTTPCookieStorage];

cookies = [sharedCookieStorage cookies] ;

Here is the code to output the data to the table view:

- (int)numberOfRowsInTableView:(NSTableView *)tableView
{
return [cookies count];
}


- (id)tableView:(NSTableView *)tableView
objectValueForTableColumn:(NSTableColumn *)tableColumn
row:(int)row
{
return [cookies objectAtIndex:row];
}


Here is the output in the console:

2008-06-28 21:45:01.997 Cookie Monster[25168:10b] You have   362  
cookies.
2008-06-28 21:45:02.020 Cookie Monster[25168:10b] *** -[NSHTTPCookie  
copyWithZone:]: unrecognized selector sent to instance 0x14b0c0
2008-06-28 21:45:02.021 Cookie Monster[25168:10b] An uncaught  
exception was raised
2008-06-28 21:45:02.021 Cookie Monster[25168:10b] *** -[NSHTTPCookie  
copyWithZone:]: unrecognized selector sent to instance 0x14b0c0
2008-06-28 21:45:02.021 Cookie Monster[25168:10b] *** Terminating app  
due to uncaught exception 'NSInvalidArgumentException', reason: '*** - 
[NSHTTPCookie copyWithZone:]: unrecognized selector sent to instance  
0x14b0c0'

2008-06-28 21:45:02.022 Cookie Monster[25168:10b] Stack: (
2523074891,
2460709115,
2523104074,
2523097420,
2523097618,
2461744868,
2461827850,
2461827587,
2462515572,
2462515044,
2462512282,
2462140684,
2462135280,
2462726532,
2462721147,
2462722066,
2462722066,
2462722066,
2462722066,
2462715345,
2462713619,
2462700087,
2461916303,
2461915197,
2462684049,
2462682600,
2462887525,
2461711615,
2461670930,
2461669236,
2461668279,
2461668085,
2461667236
)

Thanks!  Any help would be appreciated!


___

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

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

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

This email sent to [EMAIL PROTECTED]


Filter Multidimensional Array?

2008-05-16 Thread Chris Purcell
I have created a multidimensional array by creating 3 NSArray's (call  
them childArray1, childArray2, childArray3) and them adding them to  
one NSArray (call it parentArray).  I am using predicate to search out  
the array which finds the item I'm searching for.  However, how I  
return the name of the original array that the found item came from  
(either childArray1, childArray2 or childArray3)? 
 

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]