Adding and editing a multi column row in NSTableView

2011-07-07 Thread lorenzo7620
I have an NSTableView whose columns are bound to an NSArrayController. The  
data displays correctly in the table and I can edit the individual cells;  
all good there. But, when I programmatically add a new item to the  
controller, a new row is added at the bottom of the table. This is not what  
I want, so instead of using NSArrayController's addObject: method, I use  
-insertObject:AtArrangedObjectIndex:. This causes the new row to be  
inserted at the top of the table view, which is what I want, but when I  
edit the first column and tab to the second column (three columns in all,  
only 1  2 are editable), the selection jumps to the last row in the table  
and the second column is made editable. I've looked at a couple of the  
NSTableViewDelegate methods to try to figure out why this happens, but am  
at a loss. I even tried inserting into index 0 of the proxy object returned  
via mutableArrayValueForKey, but the behavior is the same. So how do I  
accomplish what I want?

Thx
___

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: Re: Binding multiple NSTableView and NSPopupButton to an NSArrayControler

2011-05-02 Thread lorenzo7620

On May 2, 2011 12:03pm, Quincey Morris quinceymor...@earthlink.net wrote:

On May 2, 2011, at 08:02, Lorenzo Thurman wrote:




 I have an NSPopupButton whose content is bound to an  
NSArrayController's (controller A) arrangeObjects controller Key. This  
NSArrayController is bound to an NSMutableArray which holds the items for  
display. The contents of the NSPopuButton display as expected.






 In another XIB (NSWindowController subclass), I have an NSTableView  
whose only column's value is bound to an NSArrayController's (controller  
B) arrangedObjects. This NSArrayController resides in the same XIB as the  
NSTableView and is bound via an NSObject proxy in that same XIB to the  
same NSMutableArray as controller A. These items display as expected in  
the NSTableView. I can remove an item from the NSTableView, and in the  
debugger, I can see that the item is indeed removed from the  
NSMutableArray. But when I save the array on quitting the application, I  
see the removed item has somehow made it back into the array.





This is a little bit clearer, but still to vague to be of much use.




The short answer is that it sounds like you have 2 mutable arrays  
underlying all of this. After you've checked the item removal in the  
debugger, you should check in the debugger again at save time that it's  
the *same* array you're saving, rather than a duplicate that hasn't had  
the item removed.




I have no idea what bound via an NSObject proxy in that same XIB to the  
same NSMutableArray as controller A means. I'm also not sure, when you  
say bound, you are always referring to an actual binding, or sometimes  
to an outlet connection.




To solve this, we need to to know all of the bindings, including (for  
each one): the object that's bound from; its location (in nib or created  
programmatically); the binding name; the object that it's bound to; *its*  
location; the property key that its bound to.







There's only one array. If I set a breakpoint after the item has been  
removed and then in gdb: po (NSArray*)[mycontroller arrangedObjects] . The  
removed item is not in the array. If during archiving, I do the same, the  
removed item is back. The same occurs if I inspect the array directly in  
gdb.


All bindings are setup in IB. Here's the rundown:
NSPopupButton
Content
Bind To: itemController
Controller Key: arrangedObjects

itemController
Content Array
Bind To: MyAppsClass
Controller Key: myMutableArray


In a seperate XIB:
NSTableViewColumn
Value
Bind To: anotherItemController
Controller Key: arrangedObjects

anotherItemController
Content Array
Bind to: MyAppsClass (added an NSObject from palette and set its class to  
MyAppsClass)

Controller Key: myMutableArray
___

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


NSSearchfield help

2011-02-09 Thread lorenzo7620
I have a NSTableView populated by an NSArrayController. Above the table, I  
have an NSToolbar, to which I would like add the ability to search. I have  
found a couple of examples of implementing search using an NSSearchField,  
but the two that I have found both display the results in a dropdown  
attached to the NSSearchField. I would like the table to display the  
results live as the user types characters. And when the search field is  
cleared, the table should repopulate with the original entries. First, is  
this even possible? I can't think of an application that even does this. If  
so, is there any sample code that demonstrates this?

Thanks
___

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

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

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

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


NSDateFormatter misbehaving

2011-02-02 Thread lorenzo7620

Here is the code I'm using to format a date string:


NSDate *date = [NSDate date];

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateStyle:NSDateFormatterBehavior10_4];
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
// check placed here
[dateFormatter setDateFormat:@EEE_MMM_dd_];

NSString * filenameDate = [dateFormatter stringFromDate:date];

What I'm expecting is something like this:
Tue_Feb_02_2011

What I'm getting is this:
02/02/2011

I even inserted this line just after the setDateFormat to see just what the  
formatter would return as its format

NSString * df = [dateFormatter dateFormat];

I get this back
02/02/2001

What gives? I've used NSDateFormatter before with no problems. I assume  
I've missed something silly, but I just don't see it.

Thanks
___

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

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

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

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


Re: Re: NSDateFormatter misbehaving

2011-02-02 Thread lorenzo7620

On Feb 2, 2011 3:18pm, Ken Thomases k...@codeweavers.com wrote:

On Feb 2, 2011, at 3:14 PM, lorenzo7...@gmail.com wrote:





 Here is the code I'm using to format a date string:











 NSDate *date = [NSDate date];







 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];



 [dateFormatter setDateStyle:NSDateFormatterBehavior10_4];





The above should use -setFormatterBehavior:, not -setDateStyle:.





 [dateFormatter setDateStyle:NSDateFormatterShortStyle];



 // check placed here



 [dateFormatter setDateFormat:@EEE_MMM_dd_];







 NSString * filenameDate = [dateFormatter stringFromDate:date];







 What I'm expecting is something like this:



 Tue_Feb_02_2011







 What I'm getting is this:



 02/02/2011






 I even inserted this line just after the setDateFormat to see just what  
the formatter would return as its format



 NSString * df = [dateFormatter dateFormat];







 I get this back



 02/02/2001






 What gives? I've used NSDateFormatter before with no problems. I assume  
I've missed something silly, but I just don't see it.





Regards,



Ken





Sorry, that was a typo:
This

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateStyle:NSDateFormatterBehavior10_4];
[dateFormatter setDateFormat:@EEE_MMM_dd_];

NSString * filenameDate = [dateFormatter stringFromDate:date];

still produces
02/02/2011
___

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


Sending email with attachments

2011-02-01 Thread lorenzo7620
How can one go about doing this and support 10.4-10.6? There are links all  
over the place pointing to deprecated API's (NSMailDelivery) or frameworks  
that are 10.5+ (EDMessage, Scripting Bridge), but nothing I can use. All I  
want to do is open the default mail application, create a new message,  
attach a file and then allow the user to address it and send. That should  
not be too difficult, I should think. Is an Automator action the way to go?  
Can someone help me out?

Thanks
___

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

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

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

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


NSKeyedArchiver on iOS and Cocoa

2010-12-20 Thread lorenzo7620
Are these two compatible? Can something archived one platform be unarchived  
on the other? I can't find anything in docs that addresses this, but I'm  
havig trouble doing precisely this (archived on iPhone, unarchived on  
MacOSX). I get the NSInvalidUnarchiveOperationException.

___

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: Re: NSKeyedArchiver on iOS and Cocoa

2010-12-20 Thread lorenzo7620

On Dec 20, 2010 9:43pm, Ricky Sharp rsh...@mac.com wrote:



On Dec 20, 2010, at 8:22 PM, lorenzo7...@gmail.com wrote:




 Are these two compatible? Can something archived one platform be  
unarchived on the other? I can't find anything in docs that addresses  
this, but I'm havig trouble doing precisely this (archived on iPhone,  
unarchived on MacOSX). I get the NSInvalidUnarchiveOperationException.





There was a thread similar to this back in August:





http://www.cocoabuilder.com/archive/cocoa/291877-nskeyedarchiver-on-osx-to-nskeyedunarchiver-ios.html





___



Ricky A. Sharp mailto:rsh...@instantinteractive.com



Instant Interactive(tm) http://www.instantinteractive.com









Thanks for the reply. That thread is enlightening, but the problem I have  
is that I can't control how the iPhone data is persisted. I need to  
unarchive it on MacOSX and then re-encode it for use on iPhone. The data is  
all basic containers of type NSMutableDictionary. I was hoping that  
wouldn't be a 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 arch...@mail-archive.com


NSToolbar help

2010-12-19 Thread lorenzo7620
I'm trying to add an NSToolbar to an existing application. I need  
compatibility with 10.4, so I'm creating the toolbar programmatically,  
initializing and configuring the toolbar in my -init. On launch, the  
toolbar does not appear and none of its delegate methods are called even  
though I setDelegate:self in -init. If I remove any of the delegate  
methods, I get an error in the console:


2010-12-19 13:13:21.415 ToolbarTest[16973:903] ERROR: invalid delegate  
ToolbarTest: 0x422f30 (does not implement all required methods), and so  
can not be used!


This output actually came from a bare bones test application I created in  
an attempt to isolate the problem. Here is my code:

mainWindow is an NSWindow instance setup as an IBOutlet

@implementation ToolbarTest

-(id)init{

if(self = [super init]){

toolBar = [[[NSToolbar alloc] initWithIdentifier:@MainToolbar]  
autorelease];

[toolBar setAllowsUserCustomization:YES];
[toolBar setAutosavesConfiguration:YES];
[toolBar setDisplayMode: NSToolbarDisplayModeIconAndLabel];
[toolBar setDelegate:self];

[mainWindow setToolbar:toolBar];

NSLog(@Init called);
}
return self;


}
- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar{

return [NSArray arrayWithObjects:NSToolbarPrintItemIdentifier,
NSToolbarShowColorsItemIdentifier,
NSToolbarShowFontsItemIdentifier,
NSToolbarCustomizeToolbarItemIdentifier,
NSToolbarFlexibleSpaceItemIdentifier,
NSToolbarSpaceItemIdentifier,
NSToolbarSeparatorItemIdentifier, nil];

}

//- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar  
itemForItemIdentifier:(NSString *)itemIdentifier  
willBeInsertedIntoToolbar:(BOOL)flag{

//
// return nil;
//}


- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar{

return nil;
}


- (void)toolbarDidRemoveItem:(NSNotification *)notification{
return;
}

- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar{
return nil;
}

- (void)toolbarWillAddItem:(NSNotification *)notification{
return;
}

@end

The application into which I'd like to add the toolbar has an NSTableView  
as well. Since the toolbar delegates aren't being called but the  
tableview's are, I added this to one of the tableview delegate methods just  
see what was going on with the toolbar:



- (int)numberOfRowsInTableView:(NSTableView *)aTableView{

[toolBar setVisible:YES];
BOOL cansee;
cansee = [toolBar isVisible]; // Returns NO

return 5;
}
Anyone have any ideas what's going on? Oh and I'm using Xcode 3.1.4 on  
Intel under 10.6

___

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: NSToolbar help

2010-12-19 Thread lorenzo7620

On Dec 19, 2010 1:48pm, k...@highrolls.net wrote:
toolbarAllowedItemIdentifiers should return the array of allowed  
items ... returning nil says there are not items, ergo no toolbar!

On Dec 19, 2010, at 12:20 PM, lorenzo7...@gmail.com wrote:



toolbarAllowedItemIdentifiers






Thanks for the reply. I'll keep this in mind, but what I've found is that  
if I initialize the toolbar in awakeFromNib, it appears. Its empty, but its  
there and the hide/customize menu options are enabled. I can customize the  
toolbar and add items to the to toolbar.

Alright, now I'm cookin' with gas!
___

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: Re: Keeping data in sync across Mac and iPhone

2010-11-24 Thread lorenzo7620

On Nov 24, 2010 11:48am, Nick Zitzmann n...@chronosnet.com wrote:



On Nov 24, 2010, at 9:28 AM, Lorenzo Thurman wrote:




 I have a customer request to sync application preferences between Macs  
and


 iPhone. The user may not have a MobileMe account, so Sync Services is  
not an



 option (or is it?).





Sadly, it isn't. There is no SyncServices framework on iOS.





 The user data would be stored in a plist on both


 platforms and I'm trying to find the best way to keep those in sync.  
Any and



 all pointers would be appreciated.




You have to write your own sync engine. We had to do the same thing with  
SOHO Notes and NoteLife. Good luck.





Nick Zitzmann



http://www.chronosnet.com/





This is just what I'm finding out searching the 'net. Oh well, I guess I'll  
just dive right in.

Thanks all
___

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: Re: NSTimer firedate randomly changes

2010-11-18 Thread lorenzo7620
Thanks everyone for all the replies. I've read through the docs again (its  
been years since I first set this up) and think I have a better  
understanding of how timers should work. I see now that the timer will fire  
once the computer is awakened from sleep, but it does take some time, maybe  
twenty minutes or so from what I've seen so far. I've also noticed that the  
timer does not fire during sleep though. Should it? From the replies and  
the docs, it seems that it should, but I see no evidence of it either in  
the console or the data.




On Nov 17, 2010 4:17pm, Greg Parker gpar...@apple.com wrote:

On Nov 17, 2010, at 2:12 PM, Kyle Sluder wrote:
On Wed, Nov 17, 2010 at 2:07 PM, Dave DeLong davedel...@me.com wrote:



Here's what I got from that documentation:





- An NSTimer is a run loop source.



Ah, I think this is where my brain went all funny, because the NSRunLoop  
documentation mentions multiple times that A timer is not considered an  
input source.  
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSRunLoop_Class/Reference/Reference.html




I suspect what is meant is that it's not considered an input source for  
the purpose of deciding when to stop looping and return from the -run…  
methods.




A timer is a source but not an input source. The Run Loop Sequence  
of Events says that both timers and port-based input sources are able to  
wake a sleeping run loop.






--
Greg Parker gpar...@apple.com Runtime Wrangler







___

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

Tracking multiple NSURLConnections

2010-06-29 Thread lorenzo7620
I have and app that needs to send out multiple connection attempts.  
NSURLConnection doesn't appear to allow one to distinguish between  
connections. I found a couple of posts at cocoabuilder that provide some  
guidance, but I wanted to ask about my approach. I'm writing for 10.6, so  
I'm using a category on NSURLConnection combined with associative  
references. The methods in the category are below, but basically I  
associate an integer with a given connection and track the connections  
using that. So, short of subclassing or following what I've found in the  
archives, does this make sense? Am I missing any details that might cause  
this to fail?

Thanks


-(void)setTagValue:(NSNumber*)val{

objc_setAssociatedObject(self, @selector(tagValue), val,  
OBJC_ASSOCIATION_RETAIN);

}

-(NSNumber *) tagValue {

return objc_getAssociatedObject(self, @selector(tagValue));
}
___

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: Re: Tracking multiple NSURLConnections

2010-06-29 Thread lorenzo7620
And maybe store the connection objects in a container? An NSArray or maybe  
an NSDictionary?


On Jun 29, 2010 11:23am, Alexander Spohr a...@freeport.de wrote:
Not sure if I understood the problem. But why not just use the  
NSURLConnection objects themselves?



The delegate methods give you the corresponding NSURLConnection.





atze







Am 29.06.2010 um 18:00 schrieb lorenzo7...@gmail.com:




 I have and app that needs to send out multiple connection attempts.  
NSURLConnection doesn't appear to allow one to distinguish between  
connections. I found a couple of posts at cocoabuilder that provide some  
guidance, but I wanted to ask about my approach. I'm writing for 10.6, so  
I'm using a category on NSURLConnection combined with associative  
references. The methods in the category are below, but basically I  
associate an integer with a given connection and track the connections  
using that. So, short of subclassing or following what I've found in the  
archives, does this make sense? Am I missing any details that might cause  
this to fail?



 Thanks











 -(void)setTagValue:(NSNumber*)val{






 objc_setAssociatedObject(self, @selector(tagValue), val,  
OBJC_ASSOCIATION_RETAIN);



 }







 -(NSNumber *) tagValue {







 return objc_getAssociatedObject(self, @selector(tagValue));



 }



 ___







 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/atze%40freeport.de







 This email sent to a...@freeport.de




___

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: Re: Tracking multiple NSURLConnections

2010-06-29 Thread lorenzo7620

So then if I do this:

NSURLConnection * conn_1 = [[NSURLConnection alloc]  
initWithRequest:request_1 delegate:delegate  
startImmediately:startImmediately];
NSURLConnection * conn_2 = [[NSURLConnection alloc]  
initWithRequest:request_2 delegate:delegate  
startImmediately:startImmediately];


Given that my controller is set as the connection's delegate, when data  
returns this will be called:

connection:didReceiveData:

connection is an NSURLConnection, but how do I determine which connection  
returned data? Is there something in the NSURLConnection object that tells  
me if it was conn_1 or conn_2? What I do with my data depends on knowing  
this.

Sorry, if I'm not getting something here.

On Jun 29, 2010 1:21pm, ecrich...@cox.net wrote:
Maybe I'm misunderstanding you, but when your delegate methods (for the  
connection finishing or failing, receiving data, etc...) get called, you  
get a reference to the NSURLConnection object that the event refers to. I  
keep track of multiple connections this way with no problem.





Eric C.



Blog: http://www.onelazyprogrammer.com



Company: http://www.infusionsofgrandeur.com







On Tue, 29 Jun 2010 16:00:34 lorenzo7...@gmail.com wrote:





 I have and app that needs to send out multiple connection attempts.



 NSURLConnection doesn't appear to allow one to distinguish between



 connections. I found a couple of posts at cocoabuilder that provide some


 guidance, but I wanted to ask about my approach. I'm writing for 10.6,  
so



 I'm using a category on NSURLConnection combined with associative



 references. The methods in the category are below, but basically I



 associate an integer with a given connection and track the connections



 using that. So, short of subclassing or following what I've found in the


 archives, does this make sense? Am I missing any details that might  
cause



 this to fail?




___

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: Re: Tracking multiple NSURLConnections

2010-06-29 Thread lorenzo7620

Now, a devil's advocate question:
If I have lots of connections, say two dozen, or say I'm spawning  
connections continuously, would this be the most efficient way of doing  
this? I'd likely store them in an NSArray and iterate/compare until I find  
the right one. There could be lots of comparisons.


On Jun 29, 2010 1:59pm, Scott Anguish sc...@cocoadoc.com wrote:
store the conn_1/conn_2 variables someplace. Then you compare them to the  
one returned by the delegate method.







On Jun 29, 2010, at 2:53 PM, lorenzo7...@gmail.com wrote:





 So then if I do this:






 NSURLConnection * conn_1 = [[NSURLConnection alloc]  
initWithRequest:request_1 delegate:delegate  
startImmediately:startImmediately];


 NSURLConnection * conn_2 = [[NSURLConnection alloc]  
initWithRequest:request_2 delegate:delegate  
startImmediately:startImmediately];






 Given that my controller is set as the connection's delegate, when data  
returns this will be called:



 connection:didReceiveData:






 connection is an NSURLConnection, but how do I determine which  
connection returned data? Is there something in the NSURLConnection  
object that tells me if it was conn_1 or conn_2? What I do with my data  
depends on knowing this.



 Sorry, if I'm not getting something here.







 On Jun 29, 2010 1:21pm, ecrich...@cox.net wrote:


 Maybe I'm misunderstanding you, but when your delegate methods (for  
the connection finishing or failing, receiving data, etc...) get called,  
you get a reference to the NSURLConnection object that the event refers  
to. I keep track of multiple connections this way with no problem.















 Eric C.







 Blog: http://www.onelazyprogrammer.com







 Company: http://www.infusionsofgrandeur.com























 On Tue, 29 Jun 2010 16:00:34 lorenzo7...@gmail.com wrote:















  I have and app that needs to send out multiple connection attempts.







  NSURLConnection doesn't appear to allow one to distinguish between






  connections. I found a couple of posts at cocoabuilder that provide  
some






  guidance, but I wanted to ask about my approach. I'm writing for  
10.6, so







  I'm using a category on NSURLConnection combined with associative







  references. The methods in the category are below, but basically I






  associate an integer with a given connection and track the  
connections






  using that. So, short of subclassing or following what I've found in  
the






  archives, does this make sense? Am I missing any details that might  
cause







  this to fail?















 ___







 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/scott%40cocoadoc.com







 This email sent to sc...@cocoadoc.com




___

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

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

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

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


Re: Re: Tracking multiple NSURLConnections

2010-06-29 Thread lorenzo7620
OK, makes sense. But is what I've done so wrong or is it just that there  
are better ways?



On Jun 29, 2010 2:11pm, Dave DeLong davedel...@me.com wrote:
If you're spawning dozens of connections, you may want to consider giving  
each one a separate delegate object and encapsulating that connection's  
specific logic in that delegate. The url connection delegate might then  
have a weak pointer back to the original controller to notify when the  
connection is finished, at which point the controller could extract any  
data it needs from the connection delegate.





Dave





On Jun 29, 2010, at 1:08 PM, lorenzo7...@gmail.com wrote:





 Now, a devil's advocate question:


 If I have lots of connections, say two dozen, or say I'm spawning  
connections continuously, would this be the most efficient way of doing  
this? I'd likely store them in an NSArray and iterate/compare until I  
find the right one. There could be lots of comparisons.


___

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


Creating Photoshop plugins

2010-06-07 Thread lorenzo7620
Can someone point me to documentation on how to create a Photoshop plugin  
in XCode? I've found bits and pieces about the internet, but nothing that  
gives a clear understanding of how to go about it. The Photoshop SDK and  
samples seem to come from the days when Gil Amelio was in charge at Apple!  
There's got to be something more up to date.

Thx
___

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


Displaying dialog at shutdown

2010-06-02 Thread lorenzo7620
I have a very simple application that runs as an  
LSUIElement/BackgroundOnly. Its only purpose is to display a message and  
play a short sound (3 seconds) to the user whenever it quits, which, since  
its a background only app, is only at shutdown/restart. I can use an  
AppleScript to force the app to quit and when doing that, I see the dialog  
every time, but if I actually restart the computer, I only see the dialog,  
maybe 1 out of 5 times. I use a timer to dismiss the dialog after 5 seconds  
and it seems that it is more likely to appear if the timer has a longer  
duration, say 15 seconds. My code is below. The window is an NSWindow  
instance that's been wired in IB.


//
// TurnOffMouseAppDelegate.m
// TurnOffMouse
//

#import TurnOffMouseAppDelegate.h

@implementation TurnOffMouseAppDelegate

@synthesize window;
@synthesize windowController;
@synthesize timer;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application

self.windowController = [[NSWindowController alloc]  
initWithWindow:self.window];

}


- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication  
*)sender{


[self playShutdownMessage:nil];

[self.windowController showWindow:nil];

self.timer = [NSTimer timerWithTimeInterval:5.0 target:self  
selector:@selector(closeWindow:) userInfo:nil

repeats:NO];
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSModalPanelRunLoopMode];

return NSTerminateLater;
}

-(void)sound:(NSSound *)sound didFinishPlaying:(BOOL)finishedPlaying{

NSLog(@Sound finished);
}

-(void)closeWindow:(id)sender{

[self.windowController close];
[NSApp replyToApplicationShouldTerminate:YES];
}

-(IBAction)playShutdownMessage:(id)sender{

BOOL playing;

NSLog(@Playing sound);

NSSound * shutdown = [NSSound soundNamed:@Shutdown Voice];
[shutdown setDelegate:self];

if(![shutdown isPlaying])
playing = [shutdown play];
}
@end
___

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: Re: Displaying dialog at shutdown

2010-06-02 Thread lorenzo7620

On Jun 2, 2010 11:22am, Jens Alfke j...@mooseyard.com wrote:


On Jun 2, 2010, at 9:13 AM, lorenzo7...@gmail.com wrote:


I can use an AppleScript to force the app to quit and when doing that, I  
see the dialog every time, but if I actually restart the computer, I only  
see the dialog, maybe 1 out of 5 times.


This is on 10.6? Read the system docs about “Sudden Termination”. This is  
an OS optimization that quits apps by simply killing the process unless  
the app registers that it has specific things it needs to do upon quit.  
Now, I think that registering a custom -applicationShouldTerminate:  
handler would disable sudden termination, but I haven't actually worked  
with this feature so I don't know for sure; and this seems like the most  
likely thing to me.




—Jens




Yes, its for 10.6. I'm looking at the “Sudden Termination” as I write this.
Thx
___

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

Simulating app termination

2010-06-01 Thread lorenzo7620
I have an application that needs to display a message when it quits. Its  
not a LSUIElement or LSBackgroundOnly, just a faceless app that displays a  
message and plays a sound at computer restart/shutdown. The sound plays  
every time, but I don't always see the dialog, maybe 1 in 5 times. My  
question at this point is not about the dialog not displaying, not yet  
anyway, but how to tell my app to quit without actually restarting or  
shutting down the computer. Years ago under Classic, I would write an  
Applescript to do this, but it seems that you don't get even basic  
Applescript support for free anymore, so I have to add it. More trouble  
than its worth. So my question to the list is:
How do I tell my faceless app to quit or how can I mimic a  
restart/shutdown? I can send various quit signals using Activity Monitor,  
but those don't seem to allow for a proper shutdown sequence.


In the meantime, I'll probably just give my app a face just for testing,  
and go from there, but I'd like to find out if there's a better way of  
doing this.

Thx
___

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: Re: Simulating app termination

2010-06-01 Thread lorenzo7620

On Jun 1, 2010 2:16pm, John Joyce jjo...@apple.com wrote:



On Jun 1, 2010, at 2:09 PM, has wrote:





 lorenzo7620 wrote:






 My question at this point is not about the dialog not displaying, not  
yet



 anyway, but how to tell my app to quit without actually restarting or



 shutting down the computer. Years ago under Classic, I would write an



 Applescript to do this, but it seems that you don't get even basic



 Applescript support for free anymore, so I have to add it.






 If your application runs off a Cocoa event loop, it ought to respond to  
a standard 'quit' event; all GUI processes should. If not, maybe there's  
something not quite right in your design?







 HTH








You could also terminate the application's process via Terminal by  
sending it various signals.



You could easily wrap that in a script.




Can you elaborate on 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 arch...@mail-archive.com


Re: Re: Re: Simulating app termination

2010-06-01 Thread lorenzo7620

On Jun 1, 2010 2:26pm, Kyle Sluder kyle.slu...@gmail.com wrote:

On Tue, Jun 1, 2010 at 12:22 PM, lorenzo7...@gmail.com wrote:



 Can you elaborate on this?





man kill





Can you elaborate on why the standard Quit Apple Event isn't working



in your app? AppKit understands it and turns it into a regular



termination.





--Kyle Sluder



Nevermind, my Applescript syntax was not correct. I had this and it did not  
work:

tell application
TurnOffMouse
quit
end tell
I got a -1708 error.

What I should have had was this:
tell application TurnOffMouse
quit
end tell

Its been a while since I've used AS, and I forgot that the syntax can be a  
little funky.

Thanks for the help everyone and sorry for the noise.
___

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


Localization help

2010-01-27 Thread lorenzo7620
I'm not sure if this is an XCode or Cocoa issue, so I'm going to post this  
question on both lists:
I'm adding localization strings to my application. So far, I've added  
Spanish, French, Italian and English Localizable.strings. When I change  
languages, everyone one of them works except, Italian. Here's what I did:

1) Add new strings to my project.
2) Get Info-Make file localizable
3) Get Info-Add Localization (English, French, Spanish, Italian)
4) Select each localization file, Get Info-Change encoding to UTF-8 and  
convert when prompted

5) Add localized strings ie English string = Localized string;

Once I've done this, I go into System Preferences-Language and Text and  
move one of the languages to the top of the list and run the app. Every  
language is localized correctly, except for Italian. I've removed my  
localizations, cleaned my project a couple of times and the results are the  
same. Googling didn't find any helpful answers, but one post about iPhone  
localization said that I should be using ISO codes (it, fr, en, etc) as the  
usage of French, Italian and Spanish is deprecated, but removing my  
localizations and using the ISO codes gave the same results. So I'm at a  
loss, if anyone has any pointers, I'd greatly appreciate it.

Thanks
___

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

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

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

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


Re: Re: Localization help

2010-01-27 Thread lorenzo7620

On Jan 27, 2010 7:51am, Steve Bird sb...@culverson.com wrote:



On Jan 27, 2010, at 8:42 AM, lorenzo7...@gmail.com wrote:





I'm not sure if this is an XCode or Cocoa issue, so I'm going to post  
this question on both lists:


I'm adding localization strings to my application. So far, I've added  
Spanish, French, Italian and English Localizable.strings. When I change  
languages, everyone one of them works except, Italian. Here's what I did:



1) Add new strings to my project.



2) Get Info-Make file localizable



3) Get Info-Add Localization (English, French, Spanish, Italian)


4) Select each localization file, Get Info-Change encoding to UTF-8 and  
convert when prompted



5) Add localized strings ie English string = Localized string;




Once I've done this, I go into System Preferences-Language and Text and  
move one of the languages to the top of the list and run the app. Every  
language is localized correctly, except for Italian. I've removed my  
localizations, cleaned my project a couple of times and the results are  
the same. Googling didn't find any helpful answers, but one post about  
iPhone localization said that I should be using ISO codes (it, fr, en,  
etc) as the usage of French, Italian and Spanish is deprecated, but  
removing my localizations and using the ISO codes gave the same results.  
So I'm at a loss, if anyone has any pointers, I'd greatly appreciate it.



Thanks







--- Just a thought - you might want to state exactly HOW it doesn't  
work.











Steve Bird



Culverson Software - Elegant software that is a pleasure to use.



www.Culverson.com (toll free) 1-877-676-8175






Of course, sorry. Instead of the localization value, I get the localization  
key instead, which is an English string.

___

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


Problem creating Core Data mapping file

2010-01-07 Thread lorenzo7620
This is my first foray into Core Data, so forgive me if I've missed  
something basic. I'm adding a new model version to my project and so far  
I've done this:

Added a new model version
Set the current version to my new version
Now I want to add a new mapping model to the project. I select New FIle  
from the File menu and from the MacOS X section, I select Mapping Model.  
I name the file and click Next. In the window which appears, I'm asked to  
select a source and destination xcdatamodel files. I'm willing to do this  
but, there are no model files within the table area. My model files are  
part of the project and reside within a bundle at the top level of my  
project's folder. The .mom files are within my application's bundle in a  
folder inside its Resources folder along with the versioninfo.plist file.  
Can someone point me in the right direction; what am I missing?

Thanks
___

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

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

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

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


Re: Re: NSSearchField and bindings question

2010-01-04 Thread lorenzo7620

On Jan 4, 2010 5:15pm, Saurabh Sharan saurabh.sha...@isharan.com wrote:
You're not alone -- happened to me too. Though, when I downloaded the  
code from pragprog.com, it worked.



- Saurabh



On Sun, Jan 3, 2010 at 10:11 PM, lorenzo7...@gmail.com wrote:


I'm going the Zarra book, Core Data and I;ve reached the section where  
an NSSearchfield is bound to one of the arrays used in the sample  
application (page 43). As instructed in the book, I configured the  
NSSearchfield's predicate binding as follows:




Controller Key: filterPredicate



Model Key Path: name



Display Name: predicate



Predicate Format: keyPath contains $value




This did not work and the NSTableView (column) which should update itself  
from the NSArrayController does nothing.



I found an example of this sort of thing here:



http://homepage.mac.com/mmalc/CocoaExamples/controllers.html




and found that the binding in the second predicate used for the  
NSSearchfield is configured like this:



Controller Key: filterPredicate



Model Key Path :



Display Name: Last Name



Predicate Format: lastName contains[cd] $value





I configured my predicate binding fashion and it works. So my question is:



Did I miss something in the book, or is the book wrong?



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/saurabh.sharan%40isharan.com





This email sent to saurabh.sha...@isharan.com







Thanks for the reply. The downloadable code differs from the book as well:
Controller Key: filterPredicate
Model Key Path:
Display Name: Recipe Name --- Here is one difference, book uses 'predicate'
Predicate Format: name contains[c] $value --- Here is another, book  
uses 'keyPath contains $value'


This works. So, if not anything else, I know of two ways to do this now.
Thanks again.
___

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


NSSearchField and bindings question

2010-01-03 Thread lorenzo7620
I'm going the Zarra book, Core Data and I;ve reached the section where an  
NSSearchfield is bound to one of the arrays used in the sample application  
(page 43). As instructed in the book, I configured the NSSearchfield's  
predicate binding as follows:

Controller Key: filterPredicate
Model Key Path: name
Display Name: predicate
Predicate Format: keyPath contains $value

This did not work and the NSTableView (column) which should update itself  
from the NSArrayController does nothing.

I found an example of this sort of thing here:
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html

and found that the binding in the second predicate used for the  
NSSearchfield is configured like this:

Controller Key: filterPredicate
Model Key Path :
Display Name: Last Name
Predicate Format: lastName contains[cd] $value

I configured my predicate binding fashion and it works. So my question is:
Did I miss something in the book, or is the book wrong?
Thanks
___

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

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

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

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


Re: Re: URLWithString fails to fails with bad string

2009-11-25 Thread lorenzo7620

On Nov 25, 2009 2:06am, Kyle Sluder kyle.slu...@gmail.com wrote:

On Tue, Nov 24, 2009 at 10:14 PM, lorenzo7...@gmail.com wrote:



 This returns a non-nil value:



 NSURL * url = [NSURL URLWithString:@sdsds];






 The docs say this should fail. RFC 1758 looks for the string to begin  
with a



 scheme, eg http:





While sdsds is indeed a valid relative URL according to RFC 2396,



don't let NSURL's declaration of RFC-conformance fool you. I have a



pretty severe bug (rdar://problem/7096953) logged against NSURL's



incorrect handling of IDNs. Despite pointing to the spec, copying it



into the bug report, and walking step by step through NSURL's



violation thereof, I was told that it behaves according to the spec



and as designed. I no longer trust NSURL's assertions of conformance.





--Kyle Sluder



So is there a way to validate a string before passing it to URLWithString?
___

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: Re: URLWithString fails to fails with bad string

2009-11-25 Thread lorenzo7620

On Nov 25, 2009 10:36am, Jens Alfke j...@mooseyard.com wrote:



On Nov 25, 2009, at 8:31 AM, lorenzo7...@gmail.com wrote:




 So is there a way to validate a string before passing it to  
URLWithString?




Depends on what you want to do. If you want URLs of a specific scheme,  
check the -scheme property of the resulting NSURL. That will weed out  
degenerate cases like foo.





—Jens
Thanks for the reply. I'm looking through the Cocoa API now. I think I  
might be able to use NSNetService's -resolveWithTimeout along with NSURL's  
-scheme to validate a string. Seems like more work than should be  
necessary, but oh well.

Thanks all.
___

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: Re: URLWithString fails to fails with bad string

2009-11-25 Thread lorenzo7620

On Nov 25, 2009 11:05am, Jens Alfke j...@mooseyard.com wrote:



On Nov 25, 2009, at 8:59 AM, lorenzo7...@gmail.com wrote:




 Thanks for the reply. I'm looking through the Cocoa API now. I think I  
might be able to use NSNetService's -resolveWithTimeout along with  
NSURL's -scheme to validate a string. Seems like more work than should be  
necessary, but oh well.




Wait, what? That NSNetService method is for getting the IP address of a  
Bonjour service. That doesn't sound like what you're doing. It has  
nothing to do with validating the syntax of a URL.




Maybe you could describe what it is that you're trying to do with these  
URLs?





—Jens


I was just looking through the API to see what methods might help me with  
this and NSNetService looked like it might work, until I read the class  
description. What I'm doing exactly, is downloading batches of web pages  
via http. I don't want to make the attempt if the url is not valid.
___

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: Re: URLWithString fails to fails with bad string

2009-11-25 Thread lorenzo7620

On Nov 25, 2009 11:34am, Dave Carrigan d...@rudedog.org wrote:



On Nov 25, 2009, at 9:28 AM, lorenzo7...@gmail.com wrote:




 I was just looking through the API to see what methods might help me  
with this and NSNetService looked like it might work, until I read the  
class description. What I'm doing exactly, is downloading batches of web  
pages via http. I don't want to make the attempt if the url is not valid.




The only way to determine the validity of a well-formed url is to attempt  
to retrieve it.





--



Dave Carrigan



d...@rudedog.org



Seattle, WA, USA





Ah, that's a bummer. But I guess that means I can move on to something else  
now.

Thanks
___

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

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

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

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


URLWithString fails to fails with bad string

2009-11-24 Thread lorenzo7620

This returns a non-nil value:
NSURL * url = [NSURL URLWithString:@sdsds];

The docs say this should fail. RFC 1758 looks for the string to begin with  
a scheme, eg http:
I would expect a malforrned string, ie, htt: to work, since URLWithString  
doesn't distinguish between htt: and http:, but if there is no colon,  
it should return nil. Are the docs wrong, or am I missing something?

Thanks
___

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

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

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

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


UIView animation docs question

2009-11-03 Thread lorenzo7620
The documentation for setAnimationDidStopSelector in the XCode 3.2.1: says  
this:


...The message sent to the animation delegate after animations end. The  
default value is NULL. The selector should be of the form: -  
(void)animationDidStop:(NSString *)animationID finished:(NSNumber  
*)finished context:(void *)context. Your method must take the following  
arguments:...


I created a method using this signature, but it was never called. I looked  
through some sample code from Apple and found at least one example that  
actually uses its own user defined selector that takes no arguments.  
Mimicking that, I created my own selector and that actually gets called. So  
my question is two fold:


1) Is this a bug in the documentation?
2) If I want the data that should be passed to the selector, how do I go  
about it?


Thanks
___

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

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

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

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


Re: Re: UIView animation docs question

2009-11-03 Thread lorenzo7620

On Nov 3, 2009 5:08pm, Klaus Backert klaus.back...@t-online.de wrote:



On 3 Nov 2009, at 23:23, lorenzo7...@gmail.com wrote:






Here's the code:





[UIView beginAnimations:@display context:NULL];



[UIView setAnimationDuration:0.30];



[UIView setAnimationDelegate:self];


[UIView  
setAnimationDidStopSelector:@selector(animationDidStop:finshed:context:)];





Really finshed -- the i missing -- above and finished below in your  
code?





-(void)animationDidStop:(NSString *)animationID finished:(NSNumber  
*)finished context:(void *)context{...}






Klaus




Silly mistake, sorry for the noise.
___

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: Re: UIView animation docs question

2009-11-03 Thread lorenzo7620

On Nov 3, 2009 3:44pm, Fritz Anderson fri...@manoverboard.org wrote:

On 3 Nov 2009, at 3:29 PM, lorenzo7...@gmail.com wrote:





The documentation for setAnimationDidStopSelector in the XCode 3.2.1:  
says this:




...The message sent to the animation delegate after animations end. The  
default value is NULL. The selector should be of the form: -  
(void)animationDidStop:(NSString *)animationID finished:(NSNumber  
*)finished context:(void *)context. Your method must take the following  
arguments:...




I created a method using this signature, but it was never called. I  
looked through some sample code from Apple and found at least one example  
that actually uses its own user defined selector that takes no arguments.  
Mimicking that, I created my own selector and that actually gets called.  
So my question is two fold:





1) Is this a bug in the documentation?


2) If I want the data that should be passed to the selector, how do I go  
about it?





Paste your code in which you set the delegate and the longer selector you  
want; also the callback you wanted Core Animation to use (you can omit  
the body of the method).





— F





Here's the code:

[UIView beginAnimations:@display context:NULL];
[UIView setAnimationDuration:0.30];
[UIView setAnimationDelegate:self];
[UIView  
setAnimationDidStopSelector:@selector(animationDidStop:finshed:context:)];



-(void)animationDidStop:(NSString *)animationID finished:(NSNumber  
*)finished context:(void *)context{...}


Thanks
___

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

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

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

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

Using multiple fonts in a UITextView

2009-08-28 Thread lorenzo7620
I'd like to use two different fonts in a UITextView, in much the same way a  
UITableviewCell has its detailTextLabel. My ultimate goal is to create a  
table cell that can handle multiple lines of text and an  
additional 'detailtextLabel' in a different font, while still maintaining  
the datadetector feature. If anyone has an example of this or has a better  
way of achieving this, I'd really appreciate it.

___

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


Unit testing question

2009-07-24 Thread lorenzo7620
I'd like to add unit testing to my app, but I'ma little bit unclear on the  
concept. I've looked at Apple's docs on the Sentest framework and had no  
trouble getting the sample project working, but I lose it when translating  
the concepts to my particular application. I've seen some sample projects  
around the net that use the Sentest framework, but the the unit tests are  
trivially simple, asserting that 1+1 = 2, for example. What I really need  
is a sample project of some complexity that uses real unit tests against  
the project. Can anyone help me out here? My app is an NSStatusItem that  
retrieves data from the internet, and displays it in the NSStatusItem's  
menu. The only real user interface besides that is the preferences window.  
Should my unit test manually invoke the IBAction that displays the window  
and then fill its fields with values I need to test?

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 arch...@mail-archive.com


Instruments and over released objects

2009-06-09 Thread lorenzo7620
Can Instruments be used to track over released objects in a thread other  
than the main thread? The reason I ask is that I was trying to find an over  
released object in my project, but could not find it using Instruments. I  
eventually found it the hard way, but I've used Instruments before to find  
such objects with no problem, so I'm wondering if there is another  
technique that should be applied in such cases, or if Instruments can even  
work. Here is a link to what I've used before to find over released objects:

http://tinyurl.com/5u5v4l

Thanks
___

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

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

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

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


NSMailDelivery API

2009-02-17 Thread lorenzo7620
I know it's deprecated and not a public API, but my usage of this it is  
very limited. Now, I've written an app which uses it to send an email. This  
works just fine on my computer, but on my father's computer, it fails. (I  
need to get his IP address so I can remotely manage it).
The API does not provide for an error code, so I have no idea why it fails.  
My question is this:
Is there anyway to find out why it failed to send the message? Unix error  
code maybe? I think I asked for an alternative to NSMailDelivery here  
before and someone recommended EDMessage. I looked into it, but for reasons  
I can't remember, it proved unsuitable.


Thanks
___

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

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

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

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


Messaging framework

2008-12-24 Thread lorenzo7620
Anyone have any recommendations on a messaging framework for sending email?  
I had been using NSMailDelivery, but that's now deprecated, so I have to  
look elsewhere. I looked a EDMessage, but that does not support GC just  
yet, so I'm stuck.

Thanks
___

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

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

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

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