[MODERATOR] Re: WWDC ticket needed

2008-05-16 Thread Scott Anguish

It is one thing to sell your ticket (when your ticket allows it)

HOWEVER, posting ebay ads here for your tickets is not acceptable.


On May 15, 2008, at 4:45 PM, Hal Mueller wrote:

eBay item 220234875066 is at $1525 already, and not closing for  
another 5 days!




scott
moderator
___

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: NSDictionaryController with NSTableView and sorting of numeric data

2008-05-16 Thread Shawn Erickson
On Thu, May 15, 2008 at 10:43 PM, Kyle Sluder
[EMAIL PROTECTED] wrote:
 On Thu, May 15, 2008 at 5:30 PM,  [EMAIL PROTECTED] wrote:
 It would seem that NSDictionaryController keys have to be strings.

 Yes.  It is very common that, despite NSDictionary accepting any
 object as a key, you must use NSString keys.

 So the sorting of numeric string keys is always going to be alphabetic.

 Not true.  See -[NSString compare:options:] with the NSNumericSearch option.

 My solution was to discard NSDictionaryController and create a proxy object
 containing two properties:

 I would instead suggest subclassing NSDictionaryController and
 overriding -arrangedObjects.  The naive implementation would call
 super's implementation and return a sorted version of the result.  The
 published interface says that -arrangedObjects returns id, but the
 documentation says that it returns an array, so I would feel
 reasonably safe treating the return value as an NSArray.

Consider using the built in sort facility...

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSArrayController_Class/Reference/Reference.html#//apple_ref/occ/instm/NSArrayController/setSortDescriptors:

http://developer.apple.com/documentation/Cocoa/Conceptual/SortDescriptors/Concepts/Creating.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]


Re: [MODERATOR] Re: WWDC ticket needed

2008-05-16 Thread Hal Mueller
Just for the record--not mine, no idea who the seller is.  Mine ain't  
for sale!


Hal


___

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]


Storing PDF selection

2008-05-16 Thread Laurent Cerveau

Hi

Is there a way to store serialize and store PDFselection ?

If I have a PDF View , select part of it and get the currentSelection,  
showing it tells something like

Page index = 2, Range = (0, 21]

However I do not see where I could get the range of the PDFSelection  
and later recreate a selection with this value


Thanks for helping

laurent
___

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: Guidance for Cocoa's steep learning curve

2008-05-16 Thread Ilan Volow
The NSTableView is based on the MVC paradigm which has existed for  
quite some time. A method you implement gets called to return the  
value for each cell (more or less). So if you have a table with forty  
cells, then at least 40 times the method will get called. After I  
started looking at it this way, the whole NSTableView thing clicked.


The NSTableView docs aren't too bad. Trust me, you haven't hit the  
depths of Apple documentation suckage until you hit current  
documentation that refers you to documentation written a zillion years  
ago where all the example code is in Pascal.


-- Ilan

On May 15, 2008, at 9:33 PM, Joseph Ayers wrote:

I think what is missing here is some history. I'm working on an APP  
to make a series of arbitrary measurements
(i.e. positions, distances angles, shapes) on each of the frames of  
a movie. On some movies I might want to make
three position measurements, on others I want to make 4 angle  
measurements, etc. Dealing with the movie and
indeed Firewire controlled acquistion and mouse controlled  
measurement has been rather cool. What is absolutely
baffling is dealing with NSTableView. The documentation absolutely  
sucks. How does one map table rows and columns
on NSMutableArrays and NSMutableDictionaries. How does one map the  
Rows and Columns of a dataSource
on a NSTable view?  What about records and fields.  Imagine growing  
up on Excel and then dealing with NSTableView.
How did this Cocoa NSTableView architecture evolve. Where is the  
history?


ja

mmalc crawford wrote:


On May 15, 2008, at 3:39 PM, Bruno Sanz Marino wrote:

The really first step with a language is allways to write code and  
forget the GUI and the buttons and windows .Then when you  
know what are you doing and you can do what you want to do (like a  
painter), you can think in the GUIS and all these stuff



I think this is a crucial point.

My guidance for Cocoa's alleged steep learning curve is, Why are  
you making it steep?
It reminds me of the clichéd joke: Doctor, it hurts when I do  
this.  Well, don't do that.


There are plenty of ways to ease yourself it Cocoa development,  
notably just as Bruno suggests here by ignoring the GUI and  
learning about the Objective-C language an the basics of the  
Foundation Frameworks.


Yet week in, week out, we see people who ignore the advice given in  
the documentation and try to learn Objective-C, Foundation,  
Interface Builder, *and* Cocoa bindings and Core Data all in one  
go.  It's no wonder it's daunting.


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/lobster%40neu.edu

This email sent to [EMAIL PROTECTED]



--
Joseph Ayers, Professor
Department of Biology and
Marine Science Center
Northeastern University
East Point, Nahant, MA 01908
Phone (781) 581-7370 x309(office), x335(lab)
Cellular (617) 755-7523, FAX: (781) 581-6076 Boston Office 444RI,  
(617) 373-4044

eMail: [EMAIL PROTECTED]
http://www.neurotechnology.neu.edu/


___

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/listboy%40clarux.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: Query with PDF Page display in PDFview

2008-05-16 Thread Antonio Nunes

On May 16, 2008, at 7:39 AM, Amrit Majumdar wrote:


Consider a multipage Page PDF document.
When the user launches the application
All the pages of the document will be displayed in two rows.
The pages will be resized and row one will display 5 pages,row two  
will

display 5 pages.

The user can select any of the displayed pages and perform  
operations such

as zoom,edit,delete,select .. and so on.



You can set the thumbnail view to show a maximum of x pages in a row,  
but it looks like you want more fine grained control than the  
thumbnail view offers. Also the thumbnail view is not for editing  
pages. I think for that you will have to roll your own.


António


A merry heart does good like medicine



___

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: Storing PDF selection

2008-05-16 Thread Antonio Nunes

On May 16, 2008, at 7:43 AM, Laurent Cerveau wrote:

If I have a PDF View , select part of it and get the  
currentSelection, showing it tells something like

Page index = 2, Range = (0, 21]

However I do not see where I could get the range of the PDFSelection  
and later recreate a selection with this value


You ask the page for a selection for the range you provide, and assign  
that to PDFView's current selection:
			[somePDFView setCurrentSelection:[yourRememberedPage  
selectionForRange:yourRememberedRange]];


Selections can span multiple pages of course, so covering that  
requires a bit more work, but it's not difficult.


António


---
Touch is a language without words
---




___

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]


Workaround for _NSCFURLProtocolBridge bug in AppKit?

2008-05-16 Thread Dex Morgan

Hello guys,
My app uses a custom NSURLProtocol class. However I've found it's  
bugged when used with Garbage Collector activated. It seems to be a  
know issues (look herE: http://www.cocoabuilder.com/archive/message/cocoa/2007/12/17/195056) 
 since december 2007 but no one at apple has fixed it during these  
months (I've reported it again some weeks ago but no news).
Anyone have a workaround for it? (and no, I cannot disable GC, the app  
was build with it in mind)

___

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]


string to html.

2008-05-16 Thread vinitha
hi,

I've to convert text or image to its corresponding html code.
i've done

setContentType: @text/html;
setContentTransferEncoding:None;
setCharset: @us-ascii


 NSDictionary*attr = [NSDictionary
dictionaryWithObject:NSHTMLTextDocumentType
forKey:NSDocumentTypeDocumentAttribute];


 NSAttributedString*textValue = [[NSAttributedString alloc]
 initWithString: [self messageField]];//where messageField returns string.
 NSData*tData = [textValue dataFromRange: NSMakeRange(0, [[self
messageField] length])
 documentAttributes: attr error: nil];


tData still giving the text value not it scoresponding html code.So is it
right way?or Am i mis anything here?Anybody can help me?

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: NSDictionaryController with NSTableView and sorting of numeric data

2008-05-16 Thread [EMAIL PROTECTED]

Thanks For the reply Kyle

On 16 May 2008, at 06:43, Kyle Sluder wrote:


On Thu, May 15, 2008 at 5:30 PM,  [EMAIL PROTECTED] wrote:

It would seem that NSDictionaryController keys have to be strings.


Yes.  It is very common that, despite NSDictionary accepting any
object as a key, you must use NSString keys.

So the sorting of numeric string keys is always going to be  
alphabetic.


Not true.  See -[NSString compare:options:] with the NSNumericSearch  
option.


Good to be directed towards this method. I had missed the  
NSNumericSearch option.





My solution was to discard NSDictionaryController and create a  
proxy object

containing two properties:


I would instead suggest subclassing NSDictionaryController and
overriding -arrangedObjects.  The naive implementation would call
super's implementation and return a sorted version of the result.  The
published interface says that -arrangedObjects returns id, but the
documentation says that it returns an array, so I would feel
reasonably safe treating the return value as an NSArray.


That's a much more classy solution than my proxy object array kludge.


--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: NSDictionaryController with NSTableView and sorting of numeric data

2008-05-16 Thread [EMAIL PROTECTED]

Thanks for the reply Shawn

One of the big attractions of the bindings technology is that the  
sorting behaviour is automatic and normally pretty satisfactory.
But I agree that in this case manually manipulating the sort  
descriptors could be a good solution.


Jonathan

On 16 May 2008, at 07:05, Shawn Erickson wrote:




Consider using the built in sort facility...

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSArrayController_Class/Reference/Reference.html#//apple_ref/occ/instm/NSArrayController/setSortDescriptors: 



http://developer.apple.com/documentation/Cocoa/Conceptual/SortDescriptors/Concepts/Creating.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]


Re: Problem with NSFileManger directoryContentsAtPath

2008-05-16 Thread Jean-Daniel Dupas

Yes, they all display it in a different way, and why is it a problem ?

What does it prevent you to do?



Le 16 mai 08 à 07:02, JanakiRam a écrit :

When i perform ls command it shows file name as Icon?. When i  
perform cp command  tab it shows the file name as Icon^M.


Why Terminal does show different  names for the same file. When i  
see it in Finder it does show as Icon.


Please advise. Thanks in Advance.

JanakiRam

On Thu, May 15, 2008 at 4:34 PM, Jean-Daniel Dupas [EMAIL PROTECTED] 
 wrote:

Icon\r is an invisible file that contains a custom directory icon.

What make you think this file is handle in different way ?
The terminal displays '\r' as ^M but it's not a problem. Isn't it?


Le 15 mai 08 à 12:17, JanakiRam a écrit :

Hi All,
I'm facing an issue with NSFileManger directoryContentsAtPath API.  
This
seems to be an wried issue. But its very important for me to fix.  
Please

help me.

My application is trying to enumerate  the folders in inside a Mac
using NSFileManager  API. But for some files its failing.

It looks like the file name ( inside bundle ) is interpreted by  
Finder and
Terminal in a different ways. Can any one please suggest me a way to  
resolve

this issue.

Thanks in Advance

*Cocoa Code for your reference.*

NSFileManager *defaultManager = [NSFileManager defaultManager];
NSArray *filePath = [defaultManager directoryContentsAtPath:
@/Users/janakiram/Downloads/Folder.tiff];
int i , count = [filePath count];

for ( i = 0 ; i  count ; i++ ) {
NSLog(@ filepath  is (%@),[filePath objectAtIndex:i]);

}

*Output:*

[Session started at 2008-05-15 15:34:38 +0530.]
2008-05-15 15:34:38.951 FileEnumerator[4094:10b]  filepath  is (Icon
)

FileEnumerator has exited with status 0.

*Terminal View of Folder :*

Janakirams-iMac-G5:~ janakiram$ cd /Users/janakiram/Downloads/ 
Folder.tiff


Janakirams-iMac-G5:Folder.tiff janakiram$ ls -la
total 112
drwxr-xr-x@  3 janakiram  staff   102 May 15 15:36 .
drwx--+ 92 janakiram  staff  3128 May 15 15:17 ..
-rwxr-xr-x@  1 janakiram  staff 0 Aug  8  2006 Icon?

Janakirams-iMac-G5:Folder.tiff janakiram$ cp -R Icon^M




JanakiRam.
___

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: Guidance for Cocoa's steep learning curve

2008-05-16 Thread john darnell
I don't mean to be mean, but I agree with Joseph; most Apple
documentation is really, really poor.

*No, that's not correct.*  The documentation is extensive, and
comprehensive, but unless you already know what you are reading about,
it might as well have been written in Farsi (no offense meant to any who
speak Farsi--and if Farsi is your first language, then substitute
English for Farsi).

I have found this to be true on most every product's documentation; not
just X Code.  It is easily understood after five years of experience.
The beginner struggles with the concepts, the locutions, the native
phrases that the experienced programmer understands. 

For example, I was reading up on NSString yesterday and it began
discussing delegates.  What the blazes is a delegate? (Please, no
responses needed.)  Open up any Developer page on the Apple site, and
you run into the same thing.  Concepts appear that are inadequately
described, or described with so much jargon that even the experienced
programmer (such as myself) has trouble making his way through it. 

Some of this might be better dealt with if the document were more
extensively hyperlinked.

Microsoft documentation is the same way--difficult to understand unless
you have learned the lingo.   Borland documentation, I have found, is
not, but alas it has such a small market share that it is virtually
ignored.

At least Apple is going through the motions of attempting to get
feedback from its users with the questions added at the bottom of their
documentation.  I hope that some day it does some good.

R,
John

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Jens Alfke
Sent: Thursday, May 15, 2008 9:07 PM
To: Joseph Ayers
Cc: Cocoa-dev@lists.apple.com; mmalc crawford
Subject: Re: Guidance for Cocoa's steep learning curve


On 15 May '08, at 6:33 PM, Joseph Ayers wrote:

 What is absolutely
 baffling is dealing with NSTableView. The documentation absolutely  
 sucks. How does one map table rows and columns
 on NSMutableArrays and NSMutableDictionaries. How does one map the  
 Rows and Columns of a dataSource
 on a NSTable view?

I take it you read the table view programming guide and it didn't help?
file:///Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.
CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Co
nceptual/TableView/Tasks/UsingTableDataSource.html

___

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: NSURLRequest : Unable to Quit App after Syn call to Server.

2008-05-16 Thread fclee
On 05/15/2008 17:56 Jens Alfke wrote ..

...You should call [NSApp terminate: self] instead. 

I did that; and repeated it.

I'm running in debug mode.  The program works till I QUIT via [NSApp 
terminate:self].

Now I'm getting (via gdb console {Running as a Cocoa App on my MacBookPro):

Running…
2008-05-16 09:18:52.868 iPhoneSOAP (Cocoa version)[553:817]
{AppDelegate} startSOAP start
2008-05-16 09:18:53.079 iPhoneSOAP (Cocoa version)[553:817]
{startSoap} end.
Program received signal:  “EXC_BAD_ACCESS”.
(gdb)

Here's a piece of the Error Report:
..
Date/Time:   2008-05-16 09:33:54.449 -0400
OS Version:  Mac OS X 10.5.2 (9C7010)
Report Version:  6

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

I don't know why this is happening; of course I'm suspecting the SYNCHRONOUS 
connection
to the server is the source...

Does NSURLRequest need to be CLOSED before exit?
I don't remember seeing NSURLRequest closer in the doc.

Any ideas/remedies for the EXC_BAD_ACCESS (SIGBUS)?

Ric.



On 05/15/2008 17:56 Jens Alfke wrote ..

 On 15 May '08, at 2:21 PM, [EMAIL PROTECTED] wrote:

 The Cocoa code below works.  I get data back from the server.
  However, I'm unable to QUIT this application after this particular
  routine passes through.  I checked the Activity Monitor and can see
  a bunch of threads still in session:

 That's expected, and not a problem. CFNetwork uses a background thread
 to perform its I/O.

 [NSApp stop:self];//  Does not work when above
  routine was performed.

 That's your problem. You should call [NSApp terminate: self] instead.
 Although you shouldn't even need that — the standard Quit menu command
 is already bound to that action.

 —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: Guidance for Cocoa's steep learning curve

2008-05-16 Thread I. Savant
 I have found this to be true on most every product's documentation; not
 just X Code.  It is easily understood after five years of experience.
 The beginner struggles with the concepts, the locutions, the native
 phrases that the experienced programmer understands.

  I feel the need to chime in on this. I come from a very different
background than one would expect (if one read my posts to this list
regularly). I am entirely unschooled in this field and in some aspects
it shows very plainly. Yet I was writing production applications
within a few months. Some of which are still in use today with very
little changes. That would simply not have been possible without a)
the extensive and comparatively excellent documentation, b) a good API
reference browser (used to be CocoaBrowser, now I use AppKiDo - thanks
Andy Lee), and c) a few of the really good Cocoa books.

  That said, the documentation is the reference manual. Let's
consider, though, why everything that comes with a huge manual also
spawns third-party books on the subject? Because anything that
complicated always needs a structured, lesson-based approach. That
is *NOT* the documentation's job. Not even the conceptual
documentation.

  Your frustration is understandable (really, I felt a little lost in
the beginning too), but it most certainly does *NOT* take five years
to be able to effectively leverage the reference material available.

  I apologize if this comes across as an attack (it's not meant as
such), but I find that assertion absurd. Had you said it takes five
years or so to become 'good at' Cocoa/Objective-C/XCode, I'd be less
inclined to object.

  As an example, I know nothing of biology. Yet my current day job
consists of building and maintaining a Cocoa application used for
scientific research in the field of biology. I had no idea what a
'cytokine' was yet the specifications for the application I was to
design and build threw words like that around a lot. Wikipedia was my
friend, then Bioinformatic for Dummies (yes, I'm chuckling at myself
too, just having written that*). I'm still not a biologist nor will I
ever be, but it was up to me to do the research necessary.

  * You think that's funny, you should've seen me presenting the beta
to biologists using an actual analysis. Though the application works
as advertised and has received nothing but glowing feedback, they had
a lot of questions I still couldn't answer.

 For example, I was reading up on NSString yesterday and it began
 discussing delegates.  What the blazes is a delegate? (Please, no
 responses needed.)

  Like anything else that's highly technical, it's up to you to search
for definitions. Perhaps a universal glossary in the documentation
would help (file an enhancement request) but the very top of the main
Cocoa reference page lists the Fundamentals guide, which you are
meant to have read thoroughly. It contains this:

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/chapter_5_section_3.html#//apple_ref/doc/uid/TP40002974-CH6-SW19

  ... an in-depth explanation of this mechanism. You CANNOT blame the
documentation for using jargon if you don't bother to read the very
basic introductory material.

 Some of this might be better dealt with if the document were more
 extensively hyperlinked.

  Agreed. See below.

 At least Apple is going through the motions of attempting to get
 feedback from its users with the questions added at the bottom of their
 documentation.  I hope that some day it does some good.

  That's simply not fair. Going through the motions? The
documentation is regularly (every few months) refined and expanded
upon. They're not simply 'going through the motions'. As a Cocoa
developer of more than five years, I can speak from experience when I
say they're doing far, far more than 'going through the motions'. Even
simple spelling mistakes or incorrect punctuation are fixed pretty
quickly by using that 'feedback' box at the bottom of the page. I
believe in credit where it is due - especially when floundering in a
room full of very bright scientists.

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


Set view in bottom right corner of NSTableView

2008-05-16 Thread [EMAIL PROTECTED]

Hello List

I have been using NSTableView -setCornerView: to provide additional  
drag thumb image views for tables embedded in splitviews.


Has anyone found it possible to do the same thing in the bottom right  
hand corner of a table as opposed to the top?
Obviously there is no NSTableView -setBottomCornerView: method but I  
thought it might be possible by manually adding a subview to the  
enclosing NSScrollView.


Any help would be appreciated.

Jonathan

___

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: Guidance for Cocoa's steep learning curve

2008-05-16 Thread Michael Ash
On Fri, May 16, 2008 at 9:30 PM, john darnell
[EMAIL PROTECTED] wrote:
 I don't mean to be mean, but I agree with Joseph; most Apple
 documentation is really, really poor.

 *No, that's not correct.*  The documentation is extensive, and
 comprehensive, but unless you already know what you are reading about,
 it might as well have been written in Farsi (no offense meant to any who
 speak Farsi--and if Farsi is your first language, then substitute
 English for Farsi).

 I have found this to be true on most every product's documentation; not
 just X Code.  It is easily understood after five years of experience.
 The beginner struggles with the concepts, the locutions, the native
 phrases that the experienced programmer understands.

 For example, I was reading up on NSString yesterday and it began
 discussing delegates.  What the blazes is a delegate? (Please, no
 responses needed.)  Open up any Developer page on the Apple site, and
 you run into the same thing.  Concepts appear that are inadequately
 described, or described with so much jargon that even the experienced
 programmer (such as myself) has trouble making his way through it.

 Some of this might be better dealt with if the document were more
 extensively hyperlinked.

Massive hyperlinking would be nice, but you can make do without.

Google for delegate site:developer.apple.com and the first hit is
Cocoa Fundamentals Guide: Delegates and Data Sources. This document
explains what delegates are and how to use them.

It's documentation, not a tutorial. It assumes you're relatively
fluent in the system as a whole, and doesn't try to teach you from
scratch. In other words, this is a feature, not a bug. I could
certainly see wanting more tutorials from Apple, but the documentation
itself does the job it's intended for pretty well. For now, if you're
after a tutorial, your best bet is probably to turn to third parties
in the form of Cocoa books.

Mike
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Problem with NSFileManger directoryContentsAtPath

2008-05-16 Thread Hamish Allan
On Fri, May 16, 2008 at 6:02 AM, JanakiRam [EMAIL PROTECTED] wrote:
 When i perform ls command it shows file name as Icon?. When i perform cp
 command  tab it shows the file name as Icon^M.
 Why Terminal does show different  names for the same file.

Because the filename contains a non-printing character
(http://en.wikipedia.org/wiki/Control_character). bash (which is
what is performing the tab completion) and ls have different ways of
denoting non-printing characters. NSLog is treating it as if there is
an implicit line feed.

 When i see it in
 Finder it does show as Icon.

This would suggest that the Finder has been designed not to indicate
the presence of non-printing characters.

 Please advise. Thanks in Advance.

Advise you about what, though? You say that for some files it is
failing, but the code you included seems to be working perfectly.

Hamish
___

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: Guidance for Cocoa's steep learning curve

2008-05-16 Thread john darnell

Sigh.  Your attitude reminds me of a conversation I once had with a
fellow programmer.  When I was encouraging her to add more documentation
to the code, she replied, jokingly, If it was hard for me to write,
then it should be hard for them to read.

The sad thing is that you are not joking...

[Mike says:]  
Google for delegate site:developer.apple.com and the first hit is
Cocoa Fundamentals Guide: Delegates and Data Sources. This document
explains what delegates are and how to use them.

It's documentation, not a tutorial. It assumes you're relatively
fluent in the system as a whole, and doesn't try to teach you from
scratch. In other words, this is a feature, not a bug. I could
certainly see wanting more tutorials from Apple, but the documentation
itself does the job it's intended for pretty well. For now, if you're
after a tutorial, your best bet is probably to turn to third parties
in the form of Cocoa books.


___

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]


kCAOnOrderOut animation not working

2008-05-16 Thread Dion Crannitch
I'm using -defaultActionForKey: to add an animation when a sublayer is
removed from its parent. My animation is never used and instead the
sublayer fades out (which I assume is the default). But if I add the
animation to kCAOnOrderIn it works as I expect.

My sublayer class's defaultActionForKey: implementation looks like this:

+ (idCAAction)defaultActionForKey:(NSString *)key
{
if ([key isEqualToString:kCAOnOrderOut]) {  
return [MyAnimation animation];
}
return [super defaultActionForKey:key];
}

What do I need to do to change the order out animation?

Thanks,

Dion Crannitch
___

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: Guidance for Cocoa's steep learning curve

2008-05-16 Thread I. Savant
 Sigh.  Your attitude reminds me of a conversation I once had with a
 fellow programmer.  When I was encouraging her to add more documentation
 to the code, she replied, jokingly, If it was hard for me to write,
 then it should be hard for them to read.

 The sad thing is that you are not joking...

  I don't think it's possible to continue a rational debate when you
keep going down this type of path. Nobody here even remotely suggested
that documentation should be hard to read. Conversely, nobody can
reasonably argue that it is possible for documentation (on such a
highly complex technical subject) to be made easy.

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


Re: Problem with NSFileManger directoryContentsAtPath

2008-05-16 Thread JanakiRam
When i give this filename as part of rsync source file ( using --files-from
) , rsync is treating this filename as 2 different file names , because
rsync expects each filen name separated by \r.
Hence my rsync command is failing

JanakiRam.


On Fri, May 16, 2008 at 5:42 PM, Jean-Daniel Dupas [EMAIL PROTECTED]
wrote:

 Yes, they all display it in a different way, and why is it a problem ?
 What does it prevent you to do?



 Le 16 mai 08 à 07:02, JanakiRam a écrit :

 When i perform ls command it shows file name as Icon?. When i perform cp
 command  tab it shows the file name as Icon^M.
 Why Terminal does show different  names for the same file. When i see it in
 Finder it does show as Icon.

 Please advise. Thanks in Advance.

 JanakiRam

 On Thu, May 15, 2008 at 4:34 PM, Jean-Daniel Dupas [EMAIL PROTECTED]
 wrote:

 Icon\r is an invisible file that contains a custom directory icon.

 What make you think this file is handle in different way ?
 The terminal displays '\r' as ^M but it's not a problem. Isn't it?


 Le 15 mai 08 à 12:17, JanakiRam a écrit :

  Hi All,
 I'm facing an issue with NSFileManger directoryContentsAtPath API. This
 seems to be an wried issue. But its very important for me to fix. Please
 help me.

 My application is trying to enumerate  the folders in inside a Mac
 using NSFileManager  API. But for some files its failing.

 It looks like the file name ( inside bundle ) is interpreted by Finder
 and
 Terminal in a different ways. Can any one please suggest me a way to
 resolve
 this issue.

 Thanks in Advance

 *Cocoa Code for your reference.*

 NSFileManager *defaultManager = [NSFileManager defaultManager];
 NSArray *filePath = [defaultManager directoryContentsAtPath:
 @/Users/janakiram/Downloads/Folder.tiff];
 int i , count = [filePath count];

 for ( i = 0 ; i  count ; i++ ) {
 NSLog(@ filepath  is (%@),[filePath objectAtIndex:i]);

 }

 *Output:*

 [Session started at 2008-05-15 15:34:38 +0530.]
 2008-05-15 15:34:38.951 FileEnumerator[4094:10b]  filepath  is (Icon
 )

 FileEnumerator has exited with status 0.

 *Terminal View of Folder :*

 Janakirams-iMac-G5:~ janakiram$ cd /Users/janakiram/Downloads/Folder.tiff

 Janakirams-iMac-G5:Folder.tiff janakiram$ ls -la
 total 112
 drwxr-xr-x@  3 janakiram  staff   102 May 15 15:36 .
 drwx--+ 92 janakiram  staff  3128 May 15 15:17 ..
 -rwxr-xr-x@  1 janakiram  staff 0 Aug  8  2006 Icon?

 Janakirams-iMac-G5:Folder.tiff janakiram$ cp -R Icon^M




 JanakiRam.
 ___

 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: Guidance for Cocoa's steep learning curve

2008-05-16 Thread Jeff LaMarche

On May 16, 2008, at 9:30 AM, john darnell wrote:


I don't mean to be mean, but I agree with Joseph; most Apple
documentation is really, really poor.

*No, that's not correct.*  The documentation is extensive, and
comprehensive, but unless you already know what you are reading about,
it might as well have been written in Farsi (no offense meant to any  
who

speak Farsi--and if Farsi is your first language, then substitute
English for Farsi).



I'm curious what you're actually looking for in documentation; what  
you think Apple or Microsoft could do to make them better, because I'm  
having trouble accepting this premise and it seems to me that what you  
want is simply unrealistic. If they were able to make documentation  
that made you happy, my guess is that the most of us would hate it,  
because we'd have to slog through fundamental conceptual information  
in places where it doesn't belong.


I am not as familiar with Microsoft's documentation, but my limited  
experience with it has been fairly positive (as much as I hate to say  
anything good about Microsoft ;) ) and I find the Apple documentation  
to be excellent. There have been times where the documentation has  
lagged behind development and caused some difficulties for developers,  
especially in the early days of OS X, but overall, I think we are  
spoiled by the amount of information we have available to us.  
Personally, I think that the Object-Oriented Programming with  
Objective-C book on the developer website, which isn't all that  
changed from the NeXT days, contains one of the clearest explanations  
of the concepts underlying object-oriented programming that I've seen  
anywhere, and it is right where it belongs - that type of conceptual  
material doesn't belong in the API documentation.


Hand-holding guides exist; they're called books. Apple even offers  
several guides to conceptual information, but they are separate from  
the API documentation. Although I think a reasonably intelligent  
person could learn everything they needed to know from Apple's  
official documentation without using other books, those other books  
clearly exist for a reason, which is to shorten the learning curve a  
bit and gather up a lot of disparate information into one place. Like  
I. Savant, my educational background is not in programming, and I am  
pretty much self taught, so believe me, I understand the challenges of  
learning this stuff. You have to acquire the foundational knowledge,  
either from the Apple documentation, or from third-party books. You  
can't just expect to look at tiny pieces of the puzzle like the API  
documentation of a class and expect to magically get the big picture  
from it.


Documentation isn't magic. It can't be all things to all people.  
Considering the complexity and the target audience, I'd say that  
Apple's documentation is, frankly, stellar. Yes, often understanding  
one part will require you to do some research to understand a term or  
concept from another part of the system, or to sit down for a few  
hours and experiment, or maybe even ask a few questions here. If it  
could be made so simple that none of that was necessary (without  
sacrificing functionality), most of the people on this list would be  
out of a job or, at least, making less money. Too many people assume  
programming is (or should be) easier than it really is.



___

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: Guidance for Cocoa's steep learning curve

2008-05-16 Thread Michael Ash
On Fri, May 16, 2008 at 10:19 PM, john darnell
[EMAIL PROTECTED] wrote:

 Sigh.  Your attitude reminds me of a conversation I once had with a
 fellow programmer.  When I was encouraging her to add more documentation
 to the code, she replied, jokingly, If it was hard for me to write,
 then it should be hard for them to read.

 The sad thing is that you are not joking...

I don't think you quite understood what I'm getting at.

Apple's documentation does its job quite well. The problem with it,
such as it is, is that it is not a tutorial. If you're learning a
system from scratch, you don't want and can't really use straight-up
documentation, you want a tutorial.

Apple's tutorials pretty much stink. They're short and quick and cover
very little. This is an area where they lack quite a bit and, luckly,
third parties have leapt in to cover the hole. If you're having
trouble getting up to speed then it is this lack which is getting you.

But it is unreasonable to expect the NSString reference documentation
to cover basic concepts about the framework. That's not what reference
documentation is for.

Mike
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSURLRequest : Unable to Quit App after Syn call to Server. SOLVED???

2008-05-16 Thread fclee
I needed to modify the default 'GET' Response of the NSURLRequest to a 'POST'...

So I changed 'NSURLRequest' to a 'NSMutableURLRequest' to modify the HTTPMethod:

// ---
// 2)  Create the request.
NSMutableURLRequest  *theRequest=[NSMutableURLRequest 
requestWithURL:[NSURL URLWithString:theServerURL]
  
cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];

// ---
// 2a)  Modify the Request from default 'GET' to 'POST':
[theRequest setHTTPMethod:@POST];



Now, I can QUIT (via [NSAPP Terminate:self] without residual errors, etc.
I'm not sure why...
..but it appears to be solved.

Ric.


On 05/16/2008 06:32 [EMAIL PROTECTED] wrote ..
 On 05/15/2008 17:56 Jens Alfke wrote ..

 ...You should call [NSApp terminate: self] instead. 

 I did that; and repeated it.

 I'm running in debug mode.  The program works till I QUIT via [NSApp 
 terminate:self].

 Now I'm getting (via gdb console {Running as a Cocoa App on my MacBookPro):

 Running…
 2008-05-16 09:18:52.868 iPhoneSOAP (Cocoa version)[553:817]
 {AppDelegate} startSOAP start
 2008-05-16 09:18:53.079 iPhoneSOAP (Cocoa version)[553:817]
 {startSoap} end.
 Program received signal:  “EXC_BAD_ACCESS”.
 (gdb)

 Here's a piece of the Error Report:
 ..
 Date/Time:   2008-05-16 09:33:54.449 -0400
 OS Version:  Mac OS X 10.5.2 (9C7010)
 Report Version:  6

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

 I don't know why this is happening; of course I'm suspecting the SYNCHRONOUS 
 connection
 to the server is the source...

 Does NSURLRequest need to be CLOSED before exit?
 I don't remember seeing NSURLRequest closer in the doc.

 Any ideas/remedies for the EXC_BAD_ACCESS (SIGBUS)?

 Ric.



 On 05/15/2008 17:56 Jens Alfke wrote ..
 
  On 15 May '08, at 2:21 PM, [EMAIL PROTECTED] wrote:
 
  The Cocoa code below works.  I get data back from the server.
   However, I'm unable to QUIT this application after this particular
   routine passes through.  I checked the Activity Monitor and can see
   a bunch of threads still in session:
 
  That's expected, and not a problem. CFNetwork uses a background thread
  to perform its I/O.
 
  [NSApp stop:self];//  Does not work when above
   routine was performed.
 
  That's your problem. You should call [NSApp terminate: self] instead.
  Although you shouldn't even need that — the standard Quit menu command
  is already bound to that action.
 
  —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: Set view in bottom right corner of NSTableView

2008-05-16 Thread Stéphane


On May 16, 2008, at 3:58 PM, [EMAIL PROTECTED] wrote:


Hello List

I have been using NSTableView -setCornerView: to provide additional  
drag thumb image views for tables embedded in splitviews.


Has anyone found it possible to do the same thing in the bottom  
right hand corner of a table as opposed to the top?
Obviously there is no NSTableView -setBottomCornerView: method but  
I thought it might be possible by manually adding a subview to the  
enclosing NSScrollView.


This might not be that easily possible as the positions of the views  
inside the scrollview are recomputed quite often and your bottom  
corner view would be ignored by this code. So this would require  
subclassing some code in NSScrollView. Not impossible but not easy  
and this part of the AppKit does not work the same way between OS  
versions.



___

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: Setting default application for URL scheme

2008-05-16 Thread Matthew Gertner
This works like a charm except for one thing. After I register my
handler, it gets requests to load a new URL as expected the app is
already running. If the app isn't running, I see the dock slide over
slightly like it's about to open a new bundle, then it slides back and
the app doesn't open. If I rebuild the Launch Services database using
lsregister then it works fine. Is there some way to rebuild the
database programmatically, or is there something else I need to do
besides calling  LSSetDefaultHandlerForURLScheme? I tried calling the
undocument function _LSSaveAndRefresh after I register the handler,
but that doesn't seem to help.

Thanks in advance,
Matt

On Fri, May 16, 2008 at 5:49 PM, Matthew Gertner
[EMAIL PROTECTED] wrote:
 This works like a charm except for one thing. After I register my
 handler, it gets requests to load a new URL as expected the app is
 already running. If the app isn't running, I see the dock slide over
 slightly like it's about to open a new bundle, then it slides back and
 the app doesn't open. If I rebuild the Launch Services database using
 lsregister then it works fine. Is there some way to rebuild the
 database programmatically, or is there something else I need to do
 besides calling  LSSetDefaultHandlerForURLScheme? I tried calling the
 undocument function _LSSaveAndRefresh after I register the handler,
 but that doesn't seem to help.

 Thanks in advance,
 Matt

 On Thu, May 15, 2008 at 12:23 AM, Jens Alfke [EMAIL PROTECTED] wrote:

 On 14 May '08, at 2:25 PM, Nick Zitzmann wrote:

 That's the best way to do it. However, some programs tend to override the
 user's choices for default URL handlers.

 The proper UI is to show a pop-up menu (in your app's prefs) of applications
 that handle this scheme, with the current default one selected, and let the
 user pick. That's what Safari, iChat, Mail, etc. all do.

 —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/matthew%40allpeers.com

 This email sent to [EMAIL PROTECTED]




 --
 *** Note that my email has changed to [EMAIL PROTECTED]
 Please update your address book accordingly. ***




-- 
*** Note that my email has changed to [EMAIL PROTECTED]
Please update your address book accordingly. ***
___

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]


[JOB] A little Cocoa work...

2008-05-16 Thread MacDev Dude
Hi,
I have a bit of Cocoa work available that a someone from this list may be
interested in. It'd be a very limited number of hours - a couple weekends
maybe, just making some fairly straight-forward modifications to existing
Cocoa apps to which the source and clear instructions will be provided. A
fixed price for the work with be negotiated once the developer understands
the scope. A general working knowledge of Objective-C and Cocoa
with familiarity of CLI invocation, plists, user defaults should suffice,
but a knowledge of Distributed Objects would be a nice plus. If this
interests you please reply directly to me with a description or summary of
your Cocoa experience, links to any apps you may have developed, and some
comments on your near-term availability. 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: Dynamic message typing problem

2008-05-16 Thread Julius Guzy


On  Fri, 16 May 2008 10:12:24 -0600 Michael Vannorsdel wrote

I've tried the code here and it works as expected.  Could you give
more detail on your build setup?  Like what arch you're building for,


This is running as stand alone app. on Mac Pro 10.5.2

how you're executing the program,

From Xcode - build and run


if you're executing code other than
this, if this is actually running as a plugin or loaded bundle.

No, nothing like that


With regard to the build settings i'm not sure which items of  
information are significant.
I left everything as default except that once the errors started to  
appear (in the code i ported from my G4)
I made garbage collection required and the code to be developed for  
OS 10.5.

Here are the settings that I'm guessing to be relevant:

In the xcode project info window General
Project Format: XCode 3.0 compatible

Cross develop using Target SDK: Mac OS 10.5

Under Build
Configuration : Active Configuration
Show Settings defined at this level

Architectures
ARCHS = ppc i386

Build Locations
SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk

Linking
PREBINDING = NO

GCC 4.0 - Code Generation
GCC_MODEL_TUNING = G5   (PowerPC G5 [-mtune=G5]
GCC_ENABLE_OBJC_GC = required  (Garbage collection = required)

GCC - 4.0 Language
GCC_INPUT_FILETYPE = sourcecode.c.objc(Objective-C)

GCC - 4.0 Warnings
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_UNUSED_VARIABLE = YES



Under Configurations
Debug
Release

Is this information sufficient?

Thanks
Julius

http://juliuspaintings.co.uk



___

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: Set view in bottom right corner of NSTableView

2008-05-16 Thread Kyle Sluder
On Fri, May 16, 2008 at 10:49 AM, Stéphane [EMAIL PROTECTED] wrote:
 This might not be that easily possible as the positions of the views inside
 the scrollview are recomputed quite often and your bottom corner view would
 be ignored by this code. So this would require subclassing some code in
 NSScrollView. Not impossible but not easy and this part of the AppKit does
 not work the same way between OS versions.

Actually, it's not that hard.  Subclass NSScrollView and override -tile.

--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: [MODERATOR] Re: WWDC ticket needed

2008-05-16 Thread Alex Kac
I got the impression it wasn't his ticket, he just saw that on eBay  
and posted it as a wow type thing.


On May 16, 2008, at 1:05 AM, [EMAIL PROTECTED] wrote:


Date: Fri, 16 May 2008 02:03:04 -0400
From: Scott Anguish [EMAIL PROTECTED]
Subject: [MODERATOR] Re: WWDC ticket needed
To: Hal Mueller [EMAIL PROTECTED]
Cc: Cocoa Dev cocoa-dev@lists.apple.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

It is one thing to sell your ticket (when your ticket allows it)

HOWEVER, posting ebay ads here for your tickets is not acceptable.


On May 15, 2008, at 4:45 PM, Hal Mueller wrote:


eBay item 220234875066 is at $1525 already, and not closing for
another 5 days!



scott
moderator


Alex Kac - President and Founder
Web Information Solutions, Inc. -  Central Texas Microsoft Certified  
Partner


The optimist proclaims that we live in the best of all possible  
worlds; and the pessimist fears this is true.

-- James Clabell



___

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: Guidance for Cocoa's steep learning curve

2008-05-16 Thread Andy Lee

On May 16, 2008, at 10:50 AM, Jens Alfke wrote:
but there are still a lot of concepts and details to learn, and many  
times their topology does not reduce to a directed acyclic graph  
(i.e. you can't present them in order without forward references.)


Jens, I was going to bring up the concept of forward references, but I  
ran off to run an errand and now I find you beat me to it. ;)


I think this gets at what a lot of people complain about when they  
feel overwhelmed by the things they need to learn to start developing  
with Cocoa.  (There's also the issue of people trying to do too much  
too soon, as has been mentioned, but that's a separate discussion.)   
Forward references are what the concepts docs are for, but for some  
reason, they don't seem to be serving that purpose for some people.   
I'm not sure why.


With the rapidly increasing popularity of Cocoa development (as  
evidenced by the sold-out WWDC), I wonder if the market for Cocoa  
instruction will grow as well.  I don't just mean more books, as  
welcome as those will be.  I feel like introductory Cocoa is the sort  
of thing where face-to-face instruction makes a huge difference.  I  
can imagine someone taking the road maps that Erik Buck started this  
thread with (a pretty good pass at linearizing the DAG, IMO) and  
building a curriculum around them.  This could be used in a Continuing  
Education course, or in an after-work study program like some  
companies have.  People could offer video courses too.


--Andy

___

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

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

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

This email sent to [EMAIL PROTECTED]


Cocoa: How do I send/receive XML within a HTTP connect?

2008-05-16 Thread fclee
Hello, I'm having trouble determining the best path to follow.

Here's the schema in a nutshell:

[Mac  XML/SOAP - Server]
.. where an HTTP Post connection is created and a post/reply is synchronously 
generated.

I want to use Cocoa to do the equivalent in Java:

  StreamConnection xmlstream = null;
  HttpConnection connection = null;
xmlstream = (StreamConnection)Connector.open(SOAP_SERVER_URL + 
;deviceside=false,Connector.READ_WRITE,true);
   ...
   OutputStream out = connection.openOutputStream();  // HttpConnection class.
   out.write(xmlreq.getBytes()); // Note: 'xmlreq' is type String.
...
 //  Get Response -
 // Get the connection status
 status = connection.getResponseCode();  // HttpConnection class.

--

Specifically, I need to:
1) Open a read/write connection to a WSDL Soap server.-- using 
NSURLConnection?
2) Change Request Properties  Methods to reflect a POST connection.  -- using 
NSMutableURLRequest?
3) Send a XML (SOAP envelope) to the Server; and   -- ? inside NSURLConnection?
4) Get a XML response.-- via NSURLConnection?

This is a SYNCHRONOUS, HTTP (POST) connection.



Here's my dilemma:
1) I thought about using the Core Foundation (CFNetworking) route:

   // Java equivalent: connection.setRequestProperty(Content-Type, 
text/xml; charset=utf-8);

CFHTTPMessageSetHeaderFieldValue(myRequest,CFSTR(User-Agent), 
CFSTR(Apple iPhone));
CFHTTPMessageSetHeaderFieldValue(myRequest,CFSTR(Content-Type), 
CFSTR(text/xml; charset=utf-8));
CFHTTPMessageSetHeaderFieldValue(myRequest,CFSTR(Accept), 
CFSTR(text/html));

But I don't know how to Synchronously Send/Receive as shown in the Java code, 
above.


2) If possible, I prefer to use the higher-level NSNetworking scheme: via 
NSMutableURLRequest.
 I can modify the request to be POST and I think I can modify the header 
for the Content-Type, etc.

 Do I use NSURLConnection to actually TRANSMIT  RECEIVE XML data to the Server 
like this?

   serverData = [NSURLConnection sendSynchronousRequest:theRequest 
returningResponse:serverResponse 
error:myError];

3) Then, how do I flush(), close() this connection?

4) or... must I try the CF route?

Regards,
Ric.
___

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: Dynamic message typing problem

2008-05-16 Thread Scott Ribe
 - (void) callPrintConstFloat:(id)pId {
 [pId printFloat:98.76]; // pId is object of
 class AnonTargetClass
 }

This is probably compiled in file which does not include the declaration of
class AnonTargetClass, so the compiler assumes that printFloat takes an int,
casts 98.76 to the int 98, and passes those 4 bytes to a method that's
expecting a float or double. You should be seeing a compiler warning about
this.

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


Re: Cocoa: How do I send/receive XML within a HTTP connect?

2008-05-16 Thread Jens Alfke


On 16 May '08, at 10:59 AM, [EMAIL PROTECTED] wrote:

Do I use NSURLConnection to actually TRANSMIT  RECEIVE XML data to  
the Server like this?


  serverData = [NSURLConnection sendSynchronousRequest:theRequest
   returningResponse:serverResponse
   error:myError];


Yes, if you want to send it synchronously.


3) Then, how do I flush(), close() this connection?


You don't need to. It's all done for you.

—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: Cocoa: How do I send/receive XML within a HTTP connect?

2008-05-16 Thread fclee
I should add...

Does the NSMutableURLRequest actually send the XML data to the server?

Via the NSMutableURLRequest class, I can alter the HTTP Body, etc.
However, I need to send a SOAP/XML envelope  receive a XML response.

I don't see where in the NSNetworking docs that I can send a SOAP/XML to the 
server.

I'm puzzled. 

Ric.


On 05/16/2008 10:59 [EMAIL PROTECTED] wrote ..
 Hello, I'm having trouble determining the best path to follow.
 
 Here's the schema in a nutshell:
 
 [Mac  XML/SOAP - Server]
 .. where an HTTP Post connection is created and a post/reply is synchronously 
 generated.
 
 I want to use Cocoa to do the equivalent in Java:
 
   StreamConnection xmlstream = null;
   HttpConnection connection = null;
 xmlstream = (StreamConnection)Connector.open(SOAP_SERVER_URL + 
 ;deviceside=false,Connector.READ_WRITE,true);
...
OutputStream out = connection.openOutputStream();  // HttpConnection class.
out.write(xmlreq.getBytes()); // Note: 'xmlreq' is type String.
 ...
  //  Get Response -
  // Get the connection status
  status = connection.getResponseCode();  // HttpConnection class.
 
 --
 
 Specifically, I need to:
 1) Open a read/write connection to a WSDL Soap server.-- using 
 NSURLConnection?
 2) Change Request Properties  Methods to reflect a POST connection.  -- 
 using
 NSMutableURLRequest?
 3) Send a XML (SOAP envelope) to the Server; and   -- ? inside 
 NSURLConnection?
 4) Get a XML response.-- via NSURLConnection?
 
 This is a SYNCHRONOUS, HTTP (POST) connection.
 
 
 
 Here's my dilemma:
 1) I thought about using the Core Foundation (CFNetworking) route:
 
// Java equivalent: connection.setRequestProperty(Content-Type, 
 text/xml;
 charset=utf-8);
 
 CFHTTPMessageSetHeaderFieldValue(myRequest,CFSTR(User-Agent), 
 CFSTR(Apple
 iPhone));
 CFHTTPMessageSetHeaderFieldValue(myRequest,CFSTR(Content-Type), 
 CFSTR(text/xml;
 charset=utf-8));
 CFHTTPMessageSetHeaderFieldValue(myRequest,CFSTR(Accept), 
 CFSTR(text/html));
 
 But I don't know how to Synchronously Send/Receive as shown in the Java code, 
 above.
 
 
 2) If possible, I prefer to use the higher-level NSNetworking scheme: via 
 NSMutableURLRequest.
  I can modify the request to be POST and I think I can modify the header 
 for
 the Content-Type, etc.
 
  Do I use NSURLConnection to actually TRANSMIT  RECEIVE XML data to the 
 Server
 like this?
 
serverData = [NSURLConnection sendSynchronousRequest:theRequest 
 returningResponse:serverResponse 
 error:myError];
 
 3) Then, how do I flush(), close() this connection?
 
 4) or... must I try the CF route?
 
 Regards,
 Ric.

___

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: Guidance for Cocoa's steep learning curve

2008-05-16 Thread Scott Ribe
 Forward references are what the concepts docs are for, but for some
 reason, they don't seem to be serving that purpose for some people.
 I'm not sure why.

I get the feeling that some people never notice the Companion Guides
section at the top of the class references. They're right there at the top;
I don't know what Apple could do to make them more obvious. But much of the
discussion re docs seems to indicate that some people remain totally unaware
of these guides...

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


Re: Cocoa: How do I send/receive XML within a HTTP connect?

2008-05-16 Thread fclee
On 05/16/2008 11:18 Jens Alfke wrote ..

 On 16 May '08, at 10:59 AM, [EMAIL PROTECTED] wrote:

  Do I use NSURLConnection to actually TRANSMIT  RECEIVE XML data to
  the Server like this?
 
serverData = [NSURLConnection sendSynchronousRequest:theRequest
 returningResponse:serverResponse
 error:myError];

 Yes, if you want to send it synchronously.

  3) Then, how do I flush(), close() this connection?

 You don't need to. It's all done for you.

 —Jens

I'm having difficulty formulating the Request.
As we know,  the NSMutableURLRequest inherits methods that can alter the Http 
body, etc.
I don't think I need to do that.

I need to  send a pre-written SOAP/XML envelop to the server; and get an 
response that I disseminate.

Something like this:   [XML/SOAP string (or data)]  [NSURLRequest] --- 
[NSURLConnection] --- [Server].
  Server --- [NSURLConnection] --- 
response.

I can send an empty http request to the reserver and get a response.
But I don't know how to attach a data item (XML/SOAP) to the request.

Any Ideas?

Regards,
Ric.
___

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: How do I send/receive XML within a HTTP connect?

2008-05-16 Thread stephen joseph butler
On Fri, May 16, 2008 at 1:11 PM,  [EMAIL PROTECTED] wrote:
 I should add...

 Does the NSMutableURLRequest actually send the XML data to the server?

 Via the NSMutableURLRequest class, I can alter the HTTP Body, etc.
 However, I need to send a SOAP/XML envelope  receive a XML response.

 I don't see where in the NSNetworking docs that I can send a SOAP/XML to the 
 server.

 I'm puzzled.

The SOAP envelope is part of the HTTP body. The URL framework has
nothing to do with 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 [EMAIL PROTECTED]


Re: Set view in bottom right corner of NSTableView

2008-05-16 Thread [EMAIL PROTECTED]

Once again Kyle, thanks.
This looks like just the ticket.

On 16 May 2008, at 18:15, Kyle Sluder wrote:


On Fri, May 16, 2008 at 10:49 AM, Stéphane [EMAIL PROTECTED] wrote:
This might not be that easily possible as the positions of the  
views inside
the scrollview are recomputed quite often and your bottom corner  
view would
be ignored by this code. So this would require subclassing some  
code in
NSScrollView. Not impossible but not easy and this part of the  
AppKit does

not work the same way between OS versions.


Actually, it's not that hard.  Subclass NSScrollView and override - 
tile.


--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: Cocoa: How do I send/receive XML within a HTTP connect?

2008-05-16 Thread fclee
Ahhh!
Okay...  I'm trying to envision how this would work.  I'm essentially working 
with a 'black box' (the Server).
The server is waiting for SOAP/XML data  shall respond accordingly.

So you're saying that I should do something like this:
..
NSData *soapData = SOAP/XML in NSData format.
..
[NSMutableURLRequest setHTTPBody:soapData];
..

Is this the correct paradigm?

Ric.

On 05/16/2008 11:29 stephen joseph butler wrote ..
 On Fri, May 16, 2008 at 1:11 PM,  [EMAIL PROTECTED] wrote:
  I should add...
 
  Does the NSMutableURLRequest actually send the XML data to the server?
 
  Via the NSMutableURLRequest class, I can alter the HTTP Body, etc.
  However, I need to send a SOAP/XML envelope  receive a XML response.
 
  I don't see where in the NSNetworking docs that I can send a SOAP/XML to the
 server.
 
  I'm puzzled.
 
 The SOAP envelope is part of the HTTP body. The URL framework has
 nothing to do with 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/fclee%40dialup4less.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: Cocoa: How do I send/receive XML within a HTTP connect?

2008-05-16 Thread stephen joseph butler
On Fri, May 16, 2008 at 1:53 PM,  [EMAIL PROTECTED] wrote:
 Ahhh!
 Okay...  I'm trying to envision how this would work.  I'm essentially working 
 with a 'black box' (the Server).
 The server is waiting for SOAP/XML data  shall respond accordingly.

 So you're saying that I should do something like this:
 ..
 NSData *soapData = SOAP/XML in NSData format.
 ..
 [NSMutableURLRequest setHTTPBody:soapData];
 ..

 Is this the correct paradigm?

Well... essentially. But setHTTPBody is not a class method. So you
want something like:

NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:soapEndpoint];

[req setHTTPBody:soapData];
[req setValue:@application/soap+xml forHTTPHeaderField:@Content-Type];

Did you see my other message this morning? You're calling some of your
methods improperly and that's why you were crashing.
___

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: How do I send/receive XML within a HTTP connect?

2008-05-16 Thread Jens Alfke


On 16 May '08, at 11:11 AM, [EMAIL PROTECTED] wrote:


Via the NSMutableURLRequest class, I can alter the HTTP Body, etc.
However, I need to send a SOAP/XML envelope  receive a XML response.


NSURLRequest etc. have nothing to do with the type of content you  
send. They don't care whether it's XML, HTML, MP3, JPEG, whatever. You  
just hand them raw data to send in the body.


I don't see where in the NSNetworking docs that I can send a SOAP/ 
XML to the server.


That's too bad. If only the documentation came with some kind of  
search feature so you didn't have to ask hundreds of people for help  
on every little detail. Then you'd be able to type SOAP into the  
search field, maybe adjust the settings to Full Text and Contains,  
and find that documentation wherever it was! But since Xcode sucks and  
has no search feature, and since Apple won't let Google index their  
online docs, there's no way around it. Someone else will have to take  
over answering, though, because I'm getting tired of it.


—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: Storing PDF selection

2008-05-16 Thread John Calhoun


On May 15, 2008, at 11:43 PM, Laurent Cerveau wrote:
If I have a PDF View , select part of it and get the  
currentSelection, showing it tells something like

Page index = 2, Range = (0, 21]

However I do not see where I could get the range of the PDFSelection  
and later recreate a selection with this value


Not the range, but you can get the bounds for each page the selection  
covers:  -[PDFSelection boundsForPage: (PDFPage *) page].


To unflatten you can call [PDFPage selectionForRect:] for each  
partial selection you saved off.  Selections can be added then  
[PDFSelection addSelection: (PDFSelection *) selection].


Yeah, a little hacky

John Calhoun—___

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: Guidance for Cocoa's steep learning curve

2008-05-16 Thread Shawn Erickson
On Fri, May 16, 2008 at 11:22 AM, Scott Ribe [EMAIL PROTECTED] wrote:
 Forward references are what the concepts docs are for, but for some
 reason, they don't seem to be serving that purpose for some people.
 I'm not sure why.

 I get the feeling that some people never notice the Companion Guides
 section at the top of the class references. They're right there at the top;
 I don't know what Apple could do to make them more obvious. But much of the
 discussion re docs seems to indicate that some people remain totally unaware
 of these guides...

Yeah I get that feeling as well... The conceptual documentation is
good and has been getting better and better. Also the getting starting
docs lead you down the paths you need to follow. Not sure how to get
folks to find the information that is in front of them. I guess folks
are a little impatient and don't want to read things closely enough...

IMHO grab a book or two, hit up http://www.cocoadevcentral.com/ (etc.)
and MOST IMPORTANTLY read the getting started and conceptual
documentation in all of the areas that the book and online tutorials
touch on.

More often then not when someone asks a question on this list I am
able to type a few words into google scoped to Apple's developer site
and hit on the conceptual docs that I can then link to help answer the
question. So I find the information exists and is usually more then
sufficient (when not I file feedback).

-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: Problem binding to recreated NSCollectionView

2008-05-16 Thread David Carlisle


On May 16, 2008, at 11:03 AM, I. Savant wrote:

On Fri, May 16, 2008 at 12:55 PM, David Carlisle
[EMAIL PROTECTED] wrote:

FWIW, I got my very own collection view (MyVOCV) working nicely with
NSArrayController, all except for animations, and I just pre  
ordered the

animation book from Amazon.
So thanks for the suggestions,


 Hey! Good work. Maybe it's worth posting on CocoaDev.com or a blog
somewhere. I'm sure a LOT of people would benefit from something like
that. Sort of a pay it forward kind of thing. Congrats.

--
I.S.


There are only a few secrets involved (in my limited and as yet  
unanimated version), and the one about using NSKeyedArchiver is  
already on CocoaDev.  The other one is that if you bind  
MyCollectionView content to NSArrayController arrangedObjects, you  
need to have the MyCollectionView content method return a nil to  
NSArrayController to force it to call setContent with the updated array.


My MyCollectionViewItem in the nib is connected to MyCollectionView  
IBOutlet itemPrototype, and the prototype NSView in the nib is  
connected to MyCollectionViewItem IBOutlet prototypeView.  When I call  
setView in a copy of MyCollectionViewItem, I put that view into a  
different NSView variable so as not to confuse it with prototypeView.


These are some important methods in MyCollectionView:


- (NSView *) copyOfPrototypeView {
   NSData *d = [NSKeyedArchiver archivedDataWithRootObject: 
[itemPrototype prototypeView]];

   return [NSKeyedUnarchiver unarchiveObjectWithData:d];
}

- (void) newItemForRepresentedObject:(id)ro {
MyCollectionViewItem *newProto = [itemPrototype copy];
[newProto setCollectionView:self];
[newProto setRepresentedObject:ro];
NSView *newView = [self copyOfPrototypeView];
[newProto setView:newView];

// etc, for example:
[newView setFrameOrigin:p];
[self addSubview:newView];
}

- (void) setContent:(NSArray *)content {
  // compare with old content array to do layout and animation
}

- (NSArray *) content {
return nil;  // This forces NSArrayController to call setContent
}

- (BOOL) isFlipped {
return YES;
}

// This is probably not needed
- (Class) valueClassForBinding:(NSString *)binding {
return [NSObject class];
}
___

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: Working through a problem...

2008-05-16 Thread Jeff LaMarche


On May 16, 2008, at 4:55 PM, john darnell wrote:


I am attempting to follow these instructions, but whenever I do, when
the cursor hovers over the table view control on the dialog the label
that shows is NSTableColumn, and in the info panel the connected  
button

remains grayed out and the message tableView must be of type
NSTableView appears on the panel.

How do I get IB to select the tableView instead of the columnView?



Well, I don't have the current version of this book, but one trick  
that can help is to change the nib window to hierarchical view, and  
then expand the tree out until you can see the tableView that you want  
to connect to, then control-drag to that instead of the table on the  
column. That's probably the easiest way to get to one item in a nested  
hierarchy such as you have with the table views.



___

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: Working through a problem...

2008-05-16 Thread Paul Goracke

john darnell wrote:


I am attempting to follow these instructions, but whenever I do, when
the cursor hovers over the table view control on the dialog the label
that shows is NSTableColumn, and in the info panel the connected  
button

remains grayed out and the message tableView must be of type
NSTableView appears on the panel.

How do I get IB to select the tableView instead of the columnView?


I've always found the best way to deal with these nestings in IB is to  
use (permanently or temporarily) either List or Column View Mode. That  
way you can reveal the view hierarchy and see exactly what you are  
connecting.


pg

___

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: How do I send/receive XML within a HTTP connect? -- Solved.

2008-05-16 Thread Jens Alfke


On 16 May '08, at 1:36 PM, [EMAIL PROTECTED] wrote:


I got this to work!

...

   NSError **myError;
   NSHTTPURLResponse **serverResponse;

...
   self.smsXMLString = [NSString  
stringWithContentsOfFile:smsXMLPath encoding:NSUTF8StringEncoding  
error:myError];


If that's not crashing, it's only because it never got an HTTP error.  
Someone else already pointed out to you that the those types are  
wrong. What your code will do if an error occurs is try to write the  
NSError to a random memory location, either crashing or corrupting  
your state. Go and look up the earlier message if you want to see how  
to fix it.


—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: Dynamic message typing problem

2008-05-16 Thread Bill Bumgarner

On May 16, 2008, at 2:17 PM, Julius Guzy wrote:

On 16 May 2008, at 19:23 Scott Ribe [EMAIL PROTECTED] wrote


- (void) callPrintConstFloat:(id)pId {
[pId printFloat:98.76]; // pId is object of
class AnonTargetClass
}


This is probably compiled in file which does not include the  
declaration of
class AnonTargetClass, so the compiler assumes that printFloat  
takes an int,
casts 98.76 to the int 98, and passes those 4 bytes to a method  
that's
expecting a float or double. You should be seeing a compiler  
warning about

this.

Thanks Scott.

Yes, the file did not include declaration of AnonTargetClass.
I did see compiler warnings but I've always seen these on the G4 and  
the system worked perfectly well.


An almost universal rule of Mac OS X programming: If you see a  
compiler warning, you are doing something wrong.


Fix the compiler warnings first (and correctly -- i.e. casting willy- 
nilly is not a fix) and then address the real problems within your  
code that remain.


In this case, that the code worked on any platform is merely a  
coincidence brought about by the architecture of said platform and the  
compiler.



Any idea where I should look to find ways of correcting this code?
Does one need to store the SEL or something like that?


You need to declare -printFloat: someplace that the compilation of the  
above will see the declaration and will interpret the arguments  
correctly.


This may be as simple as #import'ing an appropriate header file.   A  
more precise fix would be to not use (id) as the parameter type, but  
to declare the type explicitly.  This would have the side effect of  
requiring that you #import the class definition (or use @class, which  
won't solve the problem).


Also do you have any idea of where I could look for a description,  
(possibly with an example ?) of the standard approach to dynamic  
typing when it is not possible to include the header of the called  
object, for instance when having to avoid circularity in header file  
definition or the object is being defined on the fly?


Circularity of includes is easily addressed by using @class in the  
header portion to forward declare classes such that the circularity is  
avoided.


As per the implementation, circularity of includes should not be any  
more of an issue than in headers.   It is simply a matter of including  
the files in the right order.


Which, of course, is a pain in the butt and for which Xcode projects  
offer project headers and precompiled headers such that you can have  
one master (or set of masters) header(s) that are included in your  
implementation files instead of mentioning individual header files.



Even so I'm puzzled.
I thought cocoa was designed to allow dynamic typing i.e. where the  
class of the called object is not declared in the calling file and  
that the run time resolution process involves searching a method  
table for a match of the method call and by this means, if the  
method name is unique, the types of the parameters are determined.  
Indeed is this not just the standard messaging mechanism? Or is this  
why I sometimes have the impression that cocoa encourages us to pass  
Objects as parameters to everything?  The Kochan  Programming in   
Objective-C does note the possibility of conflict when method names  
are not unique but here the method is unique. and exactly, even if  
we are passing object ids these will eventually need to be resolved  
so that brings us back to square one..


The runtime resolution process is very good about figuring out what  
method to call dynamically at runtime, but Objective-C is still a C  
derived language.  Thus, it benefits from all of the efficiencies and  
suffers from all of the idiosyncrasies of C.


In this case, you haven't given the compiler enough information about  
the size and encoding of the parameters.   By the time the runtime  
sees the method call, the compiler has already had its way with the  
arguments -- potentially promoting the float to an int or otherwise  
losing information.


You need to make the method declaration visible to the compiler to  
make this work.



P.S.
Does this problem of mine qualify as an example of the difficulties  
in learning cocoa recently discussed on this list?


Not really.   Ignoring compiler warnings is a common mistake that many  
many folk make when first learning C, Objective-C or C++, regardless  
of targeted programming environment.


The tools are trying to help you by pointing out where you have done  
something that is incompletely specified.   Fix the warning, most of  
your problems are likely to go away.


b.bum

___

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

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

Help/Unsubscribe/Update your Subscription:

Re: The challenge for Cocoa's on-line documentation

2008-05-16 Thread Andy Lee

On May 16, 2008, at 5:05 PM, Erik Buck wrote:
 [Re-post from http://www.cocoabuilder.com/archive/message/cocoa/2007/8/20/188026 
]


That was well worth reposting.

This may partly answer my question about why people don't notice or  
study the concepts docs.  Maybe we're too used to clicking on search  
results and getting fast answers to small questions; we're not used to  
methodically reading introductory material and building a foundation  
of understanding, at least not to the extent required by Cocoa.


When I was a NextStep programmer, it was clear to me that concepts  
docs came first, then reference docs.  I don't know if NeXT did all  
that much to reinforce that mindset.  It may just have been because I  
hadn't been spoiled on Google yet.


(Not to knock Google.  Searching for blah site:developer.apple.com  
is often -- not always, but often -- *much* more likely to return  
relevant hits than searching with the Xcode documentation window.  I  
assume this is because Google has much more data and better algorithms  
to be able to assign relevancy to web pages.  On the other hand,  
Google can't do a Contains search.)


--Andy

___

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

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

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

This email sent to [EMAIL PROTECTED]


Core Data, SQL stores, and predicate restrictions

2008-05-16 Thread Sean McBride
Hi all,

After reading the docs and archives, it is clear to me now that with
Core Data's SQL store one is more limited in the types of predicates one
can use with fetches.

What I can't find is a list of what I can and can't do.  The best I
found was [the] SQL store, on the other hand, compiles the predicate
[...] to SQL and evaluates the result in the database itself. [...] it
means that evaluation happens in a non-Cocoa environment, and so sort
descriptors (or predicates) that rely on Cocoa cannot work.  How do I
know if my predicate relies on Cocoa?

For example, given the Employees/Departments scenario: if I try to fetch
all employees that are in exactly 2 departments I use a fetch predicate
of departments[SIZE] == 2 which works great everywhere except with the
SQL store.  I learnt this the hard way.

Thanks,

--

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada

___

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: Dynamic message typing problem

2008-05-16 Thread Scott Ribe
 ...if the method 
 name is unique, the types of the parameters are determined.

Not unless a declaration is visible. Your reasoning is that there's no other
printFloat: so the compiler should know, but this is still (sort of) C--if
you don't include a declaration that tells the compiler what the parameter
types are, it doesn't know. In other words, it ain't C# or Java, it depends
on those .h files ;-)

 Any idea where I should look to find ways of correcting this code?

You need to have a declaration of printFloat visible where it is called. Any
declaration of printFloat, not necessarily the one in the anonymous class:
that one, or one in a base class, or a category, or a protocol.

Also, you need to make sure that all instances of the printFloat: method are
declared the same. OK, that is not ***100% strictly required***, but having
a printFloat: in one class that takes a float, and one in another class that
takes a different kind of argument, is ***not*** an easy thing to deal with.

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


Re: Dynamic message typing problem

2008-05-16 Thread Michael Vannorsdel
Just to add, it's generally important to include compiler warnings  
with your problem description as they provide valuable clues.  The  
compiler issues warnings when something doesn't look right, make  
sense, or lacking information.  Usually the compiler will make guesses  
and assumptions as to what you want the code to do, which is not  
always correct.  The binary will build but may not function as intended.



On May 16, 2008, at 3:34 PM, Bill Bumgarner wrote:


Thanks Scott.

Yes, the file did not include declaration of AnonTargetClass.
I did see compiler warnings but I've always seen these on the G4  
and the system worked perfectly well.


An almost universal rule of Mac OS X programming: If you see a  
compiler warning, you are doing something wrong.


Fix the compiler warnings first (and correctly -- i.e. casting willy- 
nilly is not a fix) and then address the real problems within your  
code that remain.


In this case, that the code worked on any platform is merely a  
coincidence brought about by the architecture of said platform and  
the compiler.



Any idea where I should look to find ways of correcting this code?
Does one need to store the SEL or something like that?


You need to declare -printFloat: someplace that the compilation of  
the above will see the declaration and will interpret the arguments  
correctly.


This may be as simple as #import'ing an appropriate header file.   A  
more precise fix would be to not use (id) as the parameter type, but  
to declare the type explicitly.  This would have the side effect of  
requiring that you #import the class definition (or use @class,  
which won't solve the problem).


Also do you have any idea of where I could look for a description,  
(possibly with an example ?) of the standard approach to dynamic  
typing when it is not possible to include the header of the called  
object, for instance when having to avoid circularity in header  
file definition or the object is being defined on the fly?


Circularity of includes is easily addressed by using @class in the  
header portion to forward declare classes such that the circularity  
is avoided.


As per the implementation, circularity of includes should not be any  
more of an issue than in headers.   It is simply a matter of  
including the files in the right order.


Which, of course, is a pain in the butt and for which Xcode projects  
offer project headers and precompiled headers such that you can have  
one master (or set of masters) header(s) that are included in your  
implementation files instead of mentioning individual header files.



Even so I'm puzzled.
I thought cocoa was designed to allow dynamic typing i.e. where the  
class of the called object is not declared in the calling file and  
that the run time resolution process involves searching a method  
table for a match of the method call and by this means, if the  
method name is unique, the types of the parameters are determined.  
Indeed is this not just the standard messaging mechanism? Or is  
this why I sometimes have the impression that cocoa encourages us  
to pass Objects as parameters to everything?  The Kochan   
Programming in  Objective-C does note the possibility of conflict  
when method names are not unique but here the method is unique. and  
exactly, even if we are passing object ids these will eventually  
need to be resolved so that brings us back to square one..


The runtime resolution process is very good about figuring out what  
method to call dynamically at runtime, but Objective-C is still a C  
derived language.  Thus, it benefits from all of the efficiencies  
and suffers from all of the idiosyncrasies of C.


In this case, you haven't given the compiler enough information  
about the size and encoding of the parameters.   By the time the  
runtime sees the method call, the compiler has already had its way  
with the arguments -- potentially promoting the float to an int or  
otherwise losing information.


You need to make the method declaration visible to the compiler to  
make this work.



P.S.
Does this problem of mine qualify as an example of the difficulties  
in learning cocoa recently discussed on this list?


Not really.   Ignoring compiler warnings is a common mistake that  
many many folk make when first learning C, Objective-C or C++,  
regardless of targeted programming environment.


The tools are trying to help you by pointing out where you have done  
something that is incompletely specified.   Fix the warning, most of  
your problems are likely to go away.


___

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, SQL stores, and predicate restrictions

2008-05-16 Thread Bill Dudney

HI Sean,

One example would be if you have a method that calculates a value.  
That value would not be in the DB so the compiled predicate (if it  
would even compile) would not work because there is not column  
corresponding to your calc'd value.


I think this is worth filing a bug against the docs to clear that up.

HTH,


-bd-
http://bill.dudney.net/roller/objc

On May 16, 2008, at 3:50 PM, Sean McBride wrote:


Hi all,

After reading the docs and archives, it is clear to me now that with
Core Data's SQL store one is more limited in the types of predicates  
one

can use with fetches.

What I can't find is a list of what I can and can't do.  The best I
found was [the] SQL store, on the other hand, compiles the predicate
[...] to SQL and evaluates the result in the database itself. [...] it
means that evaluation happens in a non-Cocoa environment, and so sort
descriptors (or predicates) that rely on Cocoa cannot work.  How do I
know if my predicate relies on Cocoa?

For example, given the Employees/Departments scenario: if I try to  
fetch
all employees that are in exactly 2 departments I use a fetch  
predicate
of departments[SIZE] == 2 which works great everywhere except with  
the

SQL store.  I learnt this the hard way.

Thanks,

--

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada

___

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/bdudney%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: Dynamic message typing problem

2008-05-16 Thread Scott Ribe
 Just to add, it's generally important to include compiler warnings
 with your problem description...

Yo, any list moms listening? This is a really good suggestion that seems
like something that should perhaps be incorporated into monthly email
summarizing the list  how to ask questions.

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


Re: Dynamic message typing problem

2008-05-16 Thread I. Savant
Yo, any list moms listening? This is a really good suggestion that  
seems

like something that should perhaps be incorporated into monthly email
summarizing the list  how to ask questions.


  Yeah, it's been awhile since Scott Anguish's monthly mailing,  
hasn't it? Lots of traffic recently that kind of walks all over  
etiquette ...


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


Re: Dynamic message typing problem

2008-05-16 Thread Julius Guzy

Thanks to all who replied to my pleas for help.
I took Bill and Scott's suggestions to heart and produced the answer  
I needed: Dynamic Typing which allows me to avoid circularity etc.


I post the complete solution as an example and to check that I'm not  
running close to the wind by using a dummy class definition. The code  
gets no compiler warnings.


//  AnonTargetClass.h
#import Cocoa/Cocoa.h
@interface AnonTargetClass : NSObject {
}
- (void) printFloat:(float)pF;

//  AnonTargetClass.m
#import AnonTargetClass.h
@implementation AnonTargetClass
- (void) printFloat:(float)pF {
NSLog(@%7.3f,pF);
}

//  DummyClass.h
#import Cocoa/Cocoa.h
@interface DummyClass : NSObject {
}
- (void) printFloat:(float)pF;

//  DummyClass.m
#import DummyClass.h
@implementation DummyClass
- (void) printFloat:(float)pF {
}

//  CallingClass.h
#import Cocoa/Cocoa.h
#import DummyClass.h;
@interface CallingClass : NSObject {
}
- (void) callPrintConstFloat:(id)pId;
- (void) callPrint:(id)pId zFloat:(float)pF;

//  CallingClass.m
#import CallingClass.h
@implementation CallingClass
- (void) callPrintConstFloat:(id)pId {
[pId printFloat:99.99];
}
- (void) callPrint:(id)pId zFloat:(float)pF {
[pId printFloat:pF];
}

//  main.m
#import Cocoa/Cocoa.h
#import AnonTargetClass.h
#import CallingClass.h

int main(int argc, char *argv[])
{
AnonTargetClass * atcObj= [[AnonTargetClass 
alloc]init];
CallingClass* callingObj= [[CallingClass 
alloc]init];

[callingObj callPrintConstFloat:atcObj];
[atcObj printFloat:88.88];
}


[Session started at 2008-05-17 00:33:01 +0100.]
2008-05-17 00:33:01.988 testDynamicBinding[2436:10b]  99.990
2008-05-17 00:33:01.989 testDynamicBinding[2436:10b]  88.880

Thanks again
Julius

http://juliuspaintings.co.uk



___

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: The challenge for Cocoa's on-line documentation

2008-05-16 Thread Kevin Grant

Wikis like CocoaDev can be nice for filling these gaps.  I find
it helpful to see not only the articles, which are usually
practical, but also visitor comments.

For example, someone can easily add a statement to a 4-year-old
page, pointing out a new approach that works better.  Or, a
debate can begin, where people show multiple solutions or point
out problems they've had.

Kevin G.



On May 16, 2008, at 5:05 PM, Erik Buck wrote:
[Re-post from http://www.cocoabuilder.com/archive/message/cocoa/2007/8/20/188026 
]


That was well worth reposting.

This may partly answer my question about why people don't notice or  
study the concepts docs.  Maybe we're too used to clicking on search  
results and getting fast answers to small questions; we're not used  
to methodically reading introductory material and building a  
foundation of understanding, at least not to the extent required by  
Cocoa.


When I was a NextStep programmer, it was clear to me that concepts  
docs came first, then reference docs.  I don't know if NeXT did all  
that much to reinforce that mindset.  It may just have been because  
I hadn't been spoiled on Google yet.


(Not to knock Google.  Searching for blah site:developer.apple.com  
is often -- not always, but often -- *much* more likely to return  
relevant hits than searching with the Xcode documentation window.  I  
assume this is because Google has much more data and better  
algorithms to be able to assign relevancy to web pages.  On the  
other hand, Google can't do a Contains search.)


--Andy

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Dynamic message typing problem

2008-05-16 Thread Bill Bumgarner

On May 16, 2008, at 4:51 PM, Julius Guzy wrote:

Thanks to all who replied to my pleas for help.
I took Bill and Scott's suggestions to heart and produced the answer  
I needed: Dynamic Typing which allows me to avoid circularity etc.


Good.  BTW:  Nice paintings.

I post the complete solution as an example and to check that I'm not  
running close to the wind by using a dummy class definition. The  
code gets no compiler warnings.


You don't need the dummy class.

I'd do it something like this (Mail Code -- this probably won't  
compile).


Only I'd also pull out all of the #imports and move to using a shared  
precomp for the project...


//  AnonTargetClass.h
#import Cocoa/Cocoa.h
@interface AnonTargetClass : NSObject {
}
- (void) printFloat:(float)pF;

//  AnonTargetClass.m
#import AnonTargetClass.h
@implementation AnonTargetClass
- (void) printFloat:(float)pF {
NSLog(@%7.3f,pF);
}

//  CallingClass.h
#import Cocoa/Cocoa.h

@class AnonTargetClass;
@interface CallingClass : NSObject {
}
- (void) callPrintConstFloat:(AnonTargetClass *)pId;
- (void) callPrint:(id)pId zFloat:(float)pF;

//  CallingClass.m
#import CallingClass.h
#import AnonTargetClass.h
@implementation CallingClass
- (void) callPrintConstFloat:(AnonTargetClass *)pId {
[pId printFloat:99.99];
}
- (void) callPrint:(id)pId zFloat:(float)pF {
[pId printFloat:pF];
}

//  main.m
#import Cocoa/Cocoa.h
#import AnonTargetClass.h
#import CallingClass.h

int main(int argc, char *argv[])
{
AnonTargetClass * atcObj= [[AnonTargetClass 
alloc]init];
CallingClass* callingObj= [[CallingClass 
alloc]init];

[callingObj callPrintConstFloat:atcObj];
[atcObj printFloat:88.88];
}

___

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: Dynamic message typing problem

2008-05-16 Thread Jens Alfke


On 16 May '08, at 2:34 PM, Bill Bumgarner wrote:

An almost universal rule of Mac OS X programming: If you see a  
compiler warning, you are doing something wrong.


Amen. One of the first things I do to any Xcode project I work on is  
turn on Treat warnings as errors in the build settings. For some  
reason almost all of Obj-C's type-checking errors appear as warnings,  
and you ignore those at your peril.


(I also recommend adding -Wall to the Other warning flags field.  
That enables [almost] all warnings. Yes, you'll sometimes have to  
tweak correct code that triggers a warning; but that's much less time  
consuming than tracking down a bizarre runtime problem that could have  
been detected by the compiler if you'd let it.)


—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: Dynamic message typing problem

2008-05-16 Thread I. Savant
Amen. One of the first things I do to any Xcode project I work on is  
turn on Treat warnings as errors in the build settings. For some  
reason almost all of Obj-C's type-checking errors appear as  
warnings, and you ignore those at your peril.


  VERY good advice. A little self-discipline is good. I admit to  
previously being very bad about harmless warnings. By harmless, I  
mean the may not respond to variety. It's messy, though, and it  
always rubbed my OCD wrong. ;-)


  Hi. I'm Idiot Savant and I have a Warnings problem. I've been clean  
for about a year now and it gets easier every day ...


   sits down, waits for clapping 

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


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]

Re: The challenge for Cocoa's on-line documentation

2008-05-16 Thread Gustavo Eulalio
Very good post, Erik.

Here's what I feel now about this issue.

I too am having difficulties to learn Cocoa. The problem might be that
I'm new to both Cocoa and Objective C. I've seen some tutorials that
try to teach them at the same time. I'm afraid they might be a little
too shallow, exploring some specific details while failing to explaing
the background. Without having learned Objective C, I don't feel
confident to have a go at Cocoa.

On the other hand, when I see Objective C tutorials, they seem to be
targeted to the begining programmer. They'll explain the OO theory,
and what a function is, etc. So, while I do appreciate learing the
quirks of Objective C, having to read all that theory that I learned
10+ years ago turns out to make the text very boring and
uninteresting. In that sense, I think a mere From Java to Objective C
in 10 days book would be the quickest way to get there, even though I
don't usually recommend or have this kind of book.

Having learned Objective C, understanding Cocoa seems a tad less of a
challenge. But only after that would I turn to Apple's concepts
documentation on Cocoa.

-- 
Gustavo Eulalio
[EMAIL PROTECTED]



On Fri, May 16, 2008 at 6:05 PM, Erik Buck [EMAIL PROTECTED] wrote:
 The potential audience for a computer programming documentation can range 
 from beginner's who don't know what a compiler is to people who are experts 
 themselves and just want a quick reference.  Beginners are frustrated when 
 prerequisite knowledge is assumed, and experts are frustrated when they have 
 to search through redundant introductory material in order to find the nugget 
 they seek.

  In the middle of that spectrum are programmers who are expert users of other 
 frameworks.  These programmers often want a quick translation guide.  I 
 would do such and such this way using that framework; how can I do it with 
 Cocoa?  Sometimes we even see programmers in the various forums complain 
 that Cocoa works differently than some other framework.  I don't know how to 
 respond to that other than say, Yup, Cocoa works differently than that.

  Authors have an additional challenge when writing on-line documentation.  
 With a printed book, it is usually safe to assume that readers start at the 
 beginning or will at least flip back a few chapters if they get lost.  
 Readers come to on-line documentation in seemingly random order.  A single 
 search might identify twenty pages of information at various points along the 
 spectrum from beginner to expert. The odds are _not_ in the author's favor 
 that readers will understand the prerequisites and context needed to 
 understand a page found at random.  Once again, a newbie who chances upon 
 expert level documentation will be frustrated and report that the 
 documentation isn't helpful.  An expert who finds extremely introductory 
 information will complain that the documentation is too bulky and it's too 
 hard to find information.

  Cocoa presents yet another challenge.  In most respects, Cocoa is not an 
 al-la-cart framework.  There are key design patterns, repeated idioms, 
 optional conventions, and most importantly some essential conventions.  No 
 matter how much experience a programmer may have, if the programmer fails to 
 adhere to essential conventions (like Cocoa memory management conventions), 
 they will not succeed with Cocoa.  It is common that an experienced 
 programmer will get started by searching Apple's on-line documentation and 
 miss critical details.  A symptom of this phenomenon is a mailing list post 
 claiming that NSMutableDictionary is broken because the class is following 
 essential conventions that the programmer isn't.

  As an aside, this phenomenon is not unique to Cocoa.  I recall similar 
 postings regarding Microsoft's IUnknow COM interface in COM mailing lists.  I 
 remember postings to device driver mailing lists indicating that the poster 
 had some very strange conceptions about what a device driver is.  It seems 
 common to me that programmers who are completely unfamiliar with graphics 
 programming will get upset about one detail or another of a graphics API 
 particularly when mathematics are required. My point is only that Apple's 
 Cocoa documentation and mailing lists are not the only ones to suffer from 
 criticisms in the various categories I have described.

  Back to the subject:  there is yet another problem: I just want to do such 
 and such? Why is it so hard?  These questions often prompt the why do you 
 want to do that? or don't fight the frameworks or what are you really 
 trying to do? responses.  I don't think any kind of documentation can avoid 
 these questions or answer them.  Sometimes the question is along the lines of 
 I just want to build a launch vehicle that will put my neighbor's dog into 
 space.  It's not as if I want the dog to survive.  why is it so hard?  What 
 kind of book can really answer that kind of question?

  The bottom line is that Apple's