Re: Document-Based Application

2009-07-27 Thread Graham Cox


On 27/07/2009, at 2:09 PM, Quincey Morris wrote:


On Jul 26, 2009, at 20:39, David Blanton wrote:

I have 22 file types, each with its own C++ methods for extracting  
its data.


Now, I could use just one subclass of NSDocument and in the

- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName  
error:(NSError **)outError


method do a case statement on typeName BUT I think it would be  
cleaner to  subclass NSDocument for each of my file types and  
override only the read and write methods.


If the *only* reason for making separate subclasses is the code to  
extract the data, I don't see any great advantage. You need 22  
pieces of code, and it's probably easier for housekeeping purposes  
to keep them all in one place than to spread them around. (But  
separate subclasses would be in no way wrong.)


If there are other behavioral differences, then it might make more  
sense to use different subclasses.


HTH IMO FWIW



There are many other approaches you could take also.

In my app I have one document class but a simple schema for extending  
the types of files it can read and write by mapping file types (and/or  
UTIs) to specific method selectors. The mapping table is a simple  
dictionary. This allows me to add the method via a category, amend the  
mapping table and info.pList and away it goes. The core document class  
never changes so I can reuse that code in many different apps.


This is no better or worse in terms of the amount of code you need to  
write but it does make managing it quite easy.


--Graham
___

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

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

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

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


Re: Cocoa Document-Based App v. Windows MDI App

2009-07-27 Thread Graham Cox


On 27/07/2009, at 1:46 PM, David Blanton wrote:

I am the only Mac programmer where I work;  the rest being windows.   
I am constantly challenged to make Mac programs look like windows to  
some extent.


Windows has an architecture called Multiple Document Interface.   
Each doc opened is displayed in the same window 'frame' with a row  
of tab controls at the top to select a document.


A Cocoa Document-Based App is one document one window ... multiple  
windows.


How do I win the battle of 'too many windows floatin' around on the  
Mac, we want everything in one window like windows! ?



MDI is a travesty of UI design. Just one example - drag and drop  
between windows in different MDI apps is quite frankly, virtually  
unusable, where it is even attempted at all.


The Mac's approach is much better (i.e. more usable), though when  
there are a lot of windows it can appear confusing to some. However,  
system features such as Exposé were designed to help overcome the  
problem of finding a particular window among a lot of clutter and it  
works well. Spaces is also useful for managing windows among several  
apps working together in particular ways.


The people who are asking you to do this are misguided. If they want  
to make Mac apps, they should not be thinking about replicating the  
Windows version on the Mac, but instead fitting in with the way all  
other Mac apps work. Mac users are notoriously unforgiving of apps  
that don't work the right way, and apps that are an obvious Windows  
port do less well in terms of sales and user satisfaction, and in many  
cases will not be used unless there is absolutely no alternative. The  
same goes for Java apps to some extent. However I know how hard it can  
be to get those of a pointy-haired disposition to understand this  
argument, so you might have an uphill battle. Who matters more - the  
end user, or the people in the company who think a unified product is  
easier to handle? (even if in reality it's probably not).


Even if they cannot or will not be re-educated, you don't have much  
choice anyway - the Mac does not support MDI in the Windows sense and  
faking it would be a huge effort that would be more than entirely  
wasted - the app will sell less well and be reviewed poorly.


--Graham


___

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

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

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

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


Re: How to display the file's basic information in the columns of

2009-07-27 Thread Bright


 But when I drop the file into the table view, the app exited immediately.

Find the crash report and look at it; if you don't figure it out from that,
send another message here with the crash report.


Hi
Sorry, I can not figure  out the crash report. Could you tell me  how to 
find the crash
report in detail?  But, I debug the application and find out that the the 
problem is this code
[theRecordsArray?insertObject:infoDictionary? atIndex:row+i];. Maybe I should 
not 
make the NSDictionary as the augment of the NSArray's insertObject:atIndex 
method.

___

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

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

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

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


Re:How to display the file's basic information in the columns of the tableview

2009-07-27 Thread Bright


Hi 
   In the - (BOOL)tableView: acceptDrop: row: dropOperation: method, I tried 
 to insert the information Dictionary into the  Array use the code 
 [tableRecordsArray insertObject:infoDictionary  atIndex:row+i];.
But when I drop the file into the table view, the app exited immediately.
Now, I find that the code [tableRecordsArray insertObject:infoDictionary  
atIndex:row+i]; maybe is not 
correct.  maybe I should not make the NSDictionary as an argument of the 
NSArray's method.
Could anyone tell me how to display the objects of the NSDictionary class into 
the different columns of a table view? 
thank you!

___

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

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

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

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


Re: How to display the information in the columns of the table view?

2009-07-27 Thread Graham Cox


On 25/07/2009, at 11:56 PM, Bright wrote:


Hi all,
   In my application, I want to drag the file into the table view.  
At the same time, display the basic information in the columns of  
the table view.
   Now, I got the basic information of the file and saved it in a  
NSDictionary object.The code is :theInfoDictionary  
=[NSDictionarydictionaryWithObjectsAndKeys:[filePath  
lastPathComponent], @name,[filePath pathExtension], @extension,  
modDate, @modifiedDate,nil];
 In the - (BOOL)tableView: acceptDrop: row: dropOperation: method,  
I tried to insert the information Dictionary into the  Array use the  
code [tableRecordsArray insertObject:infoDictionary atIndex:row+i];.
But when I drop the file into the table view, the app exited  
immediately. But I do not know how to realize it.
  Note: The enclosure is the code of this application. I wish  
someone can find out the bug and amend it for me. Thank you.

 Any help greatly appreciated.



You asked the same question less than 24 hours ago. If you didn't get  
an answer, it's probably because nobody knows, didn't understand the  
question or couldn't be bothered to help.


I'm inclined to go with the last one because the question is ill- 
framed, contains no information that can help find the problem, no  
relevant code, and doesn't state what you've tried. This isn't  
debuggers anonymous - if you can't be bothered to help yourself why  
would anyone else feel obliged? Sorry to sound so harsh but I'm in a  
spiky mood today and your post got under my skin...


I will debug your code for you at my standard going consultation rate,  
which is around $100 per hour plus loss of earnings on anything else I  
have to drop to do it. Shouldn't take more than a few hours. OK with  
you?


--Graham

P.S. Your attachment was a 4.5MB download. That's pretty unfriendly to  
have thrown into my email inbox unsolicited at my own expense in terms  
of bandwidth.

___

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

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

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

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


Views in CDBA's

2009-07-27 Thread David Blanton

CDBA - Cocoa Document-Based Application.

I dragged a Scroll View from the LIbrary Objects Tab to the Window  
defined in MyDocument.xib.


All of my content to be displayed here will be bit maps.

So .. do I

1.  make a view, store in this nib.

2. Render my bit map to this view.

3. Set the document view of the scroll view to this view.

___

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

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

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

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


Re: Cocoa Document-Based App v. Windows MDI App

2009-07-27 Thread Jeff Biggus

On Jul 26, 2009, at 10:46 PM, David Blanton wrote:

I am the only Mac programmer where I work;  the rest being windows.   
I am constantly challenged to make Mac programs look like windows to  
some extent.


Windows has an architecture called Multiple Document Interface.   
Each doc opened is displayed in the same window 'frame' with a row  
of tab controls at the top to select a document.


A Cocoa Document-Based App is one document one window ... multiple  
windows.


How do I win the battle of 'too many windows floatin' around on the  
Mac, we want everything in one window like windows! ?


Can I use Safari  tabs somehow?



While the full MDI way of doing things would be a bad thing on a Mac  
for many reasons, simply having multiple documents per single NSWindow  
is common in Cocoa apps, and there are two main ways that I see people  
doing this: tabs across the top, like Safari; or a sidebar view down  
the side, like Mail, iTunes, iChat, etc.


Starting with Leopard, the NSSplitView IB widget can be used to set up  
the views and you can decide how to customize the look (it comes in  
both vertical and horizontal flavors). You can also used the excellent  
and flexible 3rd party solutions of RBSplitView and KFSplitView (which  
are also more backward compatible). If you want it to look like Safari  
tabs across the top you'll just have to do a little work to make that  
top bar view behave how you want. Side tabs are much easier to get  
up and running, and are often a better solution GUI-wise, depending on  
your app.


There are many other ways to skin this cat too, but this is probably  
the simplest, and it can look quite elegant.


jeff
___

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

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

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

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


Re: Document-Based Application

2009-07-27 Thread Jeffrey Oleander

 On Mon, 2009/07/27, Graham Cox graham@bigpond.com wrote:
 From: Graham Cox graham@bigpond.com
 Subject: Re: Document-Based Application
 To: David Blanton aired...@tularosa.net
 Cc: cocoa-dev cocoa-dev@lists.apple.com
 Date: Monday, 2009 July 27, 00:10
 On 2009/07/27, at 2:09 PM, Quincey Morris wrote: 
 On 2009 Jul 26, at 20:39, David Blanton wrote:
 I have 22 file types, each with its own C++
 methods for extracting its data.
 
 Now, I could use just one subclass of NSDocument

or you could have 22 classes, and use setDelegate
in your NSDocument sub-class to control which one
gets used for each file.


  
___

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

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

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

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


Re: Cocoa Document-Based App v. Windows MDI App

2009-07-27 Thread Andy Lee

On Jul 26, 2009, at 11:46 PM, David Blanton wrote:
I am the only Mac programmer where I work;  the rest being windows.   
I am constantly challenged to make Mac programs look like windows to  
some extent.


I guess I'd ask the question we often ask about coding questions: What  
are you really trying to do?  It sounds like the problem is that  
Windows users accustomed to MDI get visually confused by multiple  
windows from different apps overlapping each other willy-nilly.  One  
simple solution to that is Command-Option-H to hide all other apps;  
there's even a utility out there that will do this for you  
automatically when you switch apps.  There are also utility apps that  
place a dark gray background between your app's windows and all other  
apps' windows.


Windows has an architecture called Multiple Document Interface.   
Each doc opened is displayed in the same window 'frame' with a row  
of tab controls at the top to select a document.


A Cocoa Document-Based App is one document one window ... multiple  
windows.


How do I win the battle of 'too many windows floatin' around on the  
Mac, we want everything in one window like windows! ?


First, there are certain realities that no amount of battling will  
change: some Windows users want MDI, and the Mac does not support it.   
Second, it seems to me, to borrow a business cliché, that you're all  
on the same team, with the same goals -- delivering successful  
applications.  What's not clear to me is why the Windows developers  
care whether your apps are Windows-like, and why they have any  
influence over your design.  Are they also end-users?  Are your apps  
in-house apps?  Do they have authority over your UI decisions or  
merely complaints?  Aren't you there to be the person who knows better  
about Macs than they do -- or else *they'd* be writing your apps?



Can I use Safari  tabs somehow?


I don't know of any public framework for creating tabbed interfaces.   
I'm pretty sure there are some good third-party options.  If tabs are  
all it would take to satisfy your co-workers, then sure, you could  
create an interface they'd like better without violating Mac UI  
conventions.


However, as I recall, MDI is much more than a tabbed interface.  It's  
actually windows within a window, where each sub-window is a real  
window, complete with in-window menu bar, and the Mac frameworks  
simply do not support this.  The nearest thing would either be a  
tabbed interface as you suggested or an index-card metaphor like I've  
seen for at least one app (targeted at writers).  The latter would be  
a much different metaphor than windows within a window, but people  
who don't get that applications should behave according to the UI  
rules of their respective platforms probably aren't too sensitive to  
such nuances.


--Andy

___

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

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

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

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


Re: Cocoa Document-Based App v. Windows MDI App

2009-07-27 Thread Andrew Farmer

On 26 Jul 2009, at 22:57, Jeff Biggus wrote:
If you want it to look like Safari tabs across the top you'll just  
have to do a little work to make that top bar view behave how you  
want. Side tabs are much easier to get up and running, and are often  
a better solution GUI-wise, depending on your app.


Check out PSMTabBar. Turns a standard NSTabView into a Safari-style  
tab view, with tabs on any side you want - including all the tricky  
functionality like draggable tabs.

___

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

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

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

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


Re: Views in CDBA's

2009-07-27 Thread Graham Cox


On 27/07/2009, at 3:44 PM, David Blanton wrote:


So .. do I

1.  make a view, store in this nib.

2. Render my bit map to this view.

3. Set the document view of the scroll view to this view.



Yes, that should work.

But there is an easier way. If you drag in a custom view, set its  
class to your document view class, select it, then do Layout - Embed  
Object In - Scroll View, and it will set up the containment for you.  
It's a small thing, but it saves mistakes.


--Graham


___

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

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

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

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


Re: How to display the information in the columns of the table view?

2009-07-27 Thread Bright
Hi Graham and Others,
  I am sorry for my doing. I am a new learning for cocoa. And the time using 
the Cocoa-dev
mailist for short time. So I am not familiar with the rules of the mailist very 
much.
  At the same time, English is not my mother language. So sometimes I do not 
know how to 
express myself and my questions.
I Am Sorry. Next time, I will comply the regulation. 
Bright
___

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

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

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

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


Re: Cocoa Document-Based App v. Windows MDI App

2009-07-27 Thread Andy Lee


On Jul 27, 2009, at 12:50 AM, David Blanton wrote:


I think I'll use:

The Mac frameworks just don't support that approach. Sorry. I could  
re-implement MDI on the Mac, but it would be about a man-year's  
work. Do you want me to do that?


Personally, I wouldn't tempt fate.  What if they say yes?  Or yes, but  
please work on it as a background task in addition to your existing  
responsibilities?  Next they'll be asking for resize widgets on all  
four sides of each window.  Then Windows-like menu bars within the  
windows that pop down when you hit Alt.


Writing Windows programs is the job of Windows programmers.  It makes  
no sense for them to ask a Mac developer to write a Windows program on  
a Mac.


--Andy




Thanks for a few chuckles as well!

On Jul 26, 2009, at 10:20 PM, Quincey Morris wrote:


On Jul 26, 2009, at 20:46, David Blanton wrote:

I am the only Mac programmer where I work;  the rest being  
windows.  I am constantly challenged to make Mac programs look  
like windows to some extent.


Windows has an architecture called Multiple Document Interface.   
Each doc opened is displayed in the same window 'frame' with a row  
of tab controls at the top to select a document.


A Cocoa Document-Based App is one document one window ... multiple  
windows.


How do I win the battle of 'too many windows floatin' around on  
the Mac, we want everything in one window like windows! ?


a. You can't win the battle. Not ever.

b. Your best strategy is probably to say, The Mac frameworks just  
don't support that approach. Sorry. I could re-implement MDI on the  
Mac, but it would be about a man-year's work. Do you want me to do  
that?


(I'm not saying this is true, just that it's your best strategic  
answer.)


Consider Adobe's adoption of a more-or-less MDI interface on the  
Mac, and the many-more-than-one man-years of work they put into it,  
and the huge outcry that resulted anyway.


Consider also that Windows (Vista and beyond) doesn't exactly use  
the MDI interface any more (not the traditional one), though it  
uses something related to it that's more complicated. You want to  
reinvent that?



___

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/airedale%40tularosa.net

This email sent to aired...@tularosa.net





___

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

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

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

This email sent to ag...@mac.com


___

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

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

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

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


Re: Cocoa Document-Based App v. Windows MDI App

2009-07-27 Thread Andy Lee

On Jul 27, 2009, at 2:22 AM, Andy Lee wrote:
I guess I'd ask the question we often ask about coding questions:  
What are you really trying to do?  It sounds like the problem is  
that Windows users accustomed to MDI get visually confused by  
multiple windows from different apps overlapping each other willy- 
nilly.  One simple solution to that is Command-Option-H to hide all  
other apps; there's even a utility out there that will do this for  
you automatically when you switch apps.  There are also utility apps  
that place a dark gray background between your app's windows and all  
other apps' windows.


And of course there's also Spaces.

--Andy


___

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

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

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

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


Re: Views in CDBA's

2009-07-27 Thread Kyle Sluder
On Jul 26, 2009, at 10:44 PM, David Blanton aired...@tularosa.net  
wrote:


I dragged a Scroll View from the LIbrary Objects Tab to the Window  
defined in MyDocument.xib.


All of my content to be displayed here will be bit maps.


Well that's a bit of a tautology considering it's all going to be  
rendered into the window's backing store, which is a bitmap.



So .. do I


I'm assuming you're describing a procedure here, not laying out a set  
of options? That's how I'm interpreting it.



1.  make a view, store in this nib.


Make a view is a bit vague. Again assuming, this time that you're  
referring to subclass NSView. In that case yes, but I don't know  
what store in this nib means.



2. Render my bit map to this view.


Yes. Typically this will happen in -drawRect:. You will probably be  
drawing NSBitmapImageReps here.



3. Set the document view of the scroll view to this view.


This is why I was confused about store Im this nib above. When you  
drag a scroll view in from the Library, it has a custom view inside of  
it, set up as the scroll view's document view. You can use the  
Identity inspector to change it's class to that which you created in  
step 1.


--Kyle Sluder
___

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

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

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

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


Re: Cocoa Document-Based App v. Windows MDI App

2009-07-27 Thread Jeff Biggus

On Jul 27, 2009, at 1:24 AM, Andrew Farmer wrote:

Check out PSMTabBar. Turns a standard NSTabView into a Safari- 
style tab view, with tabs on any side you want - including all the  
tricky functionality like draggable tabs.


Wow, that's great.


In reference to what to say to the Windows programmers, I'll give them  
the benefit of the doubt (assuming they aren't just harassing David  
for the sheer fun of it) that they just want to clean up what may be a  
clutter of multiple documents that show up on screen in the current  
version of the Mac implementation of their app. (I have no idea what  
the app is or does, so I'll presume this to be the case.) In which  
case they're probably just asking for the entirely reasonable request  
to consolidate the document windows. (I'll even grant them that  
relying and Exposé and/or Spaces isn't an elegant solution, as was the  
case with Safari before tabs.)


Entirely doable via several methods without having to have any foreign  
Windows GUI ideas invade a nice Cocoa app.


jeff___

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

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

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

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


Re: How to display the information in the columns of the table view?

2009-07-27 Thread Alexander Spohr

Compile as debug.
Run and look at the console in Xcode.

Try
[tableRecordsArray addObject:infoDictionary]
instead of

[tableRecordsArray insertObject:infoDictionary  atIndex:row+i];



Tell us what tableRecordsArray is and how you allocate it.

atze

ps. signing what Graham Cox said.


Am 25.07.2009 um 15:56 schrieb Bright:


Hi all,
   In my application, I want to drag the file into the table view.  
At the same time, display the basic information in the columns of  
the table view.
   Now, I got the basic information of the file and saved it in a  
NSDictionary object.The code is :theInfoDictionary  
=[NSDictionarydictionaryWithObjectsAndKeys:[filePath  
lastPathComponent], @name,[filePath pathExtension], @extension,  
modDate, @modifiedDate,nil];
 In the - (BOOL)tableView: acceptDrop: row: dropOperation: method,  
I tried to insert the information Dictionary into the  Array use the  
code [tableRecordsArray insertObject:infoDictionary  atIndex:row 
+i];.
But when I drop the file into the table view, the app exited  
immediately. But I do not know how to realize it.
  Note: The enclosure is the code of this application. I wish  
someone can find out the bug and amend it for me. Thank you.

 Any help greatly appreciated.
 BrightAudio  
player.zip___


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

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

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

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


___

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

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

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

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


Multiple keyboard shortcuts for the same menu command

2009-07-27 Thread Oleg Krupnov
I'd like the Go Back command in my app to be triggered by both Cmd+[
and Cmd+- (left arrow) keyboard shortcuts. How do I do that?

I am aware of the [NSMenuItem isAlternate] but it only works if the
keyboard equivalents are the same and only the modifiers differ,
whereas in my case the opposite is the case: the modifiers are the
same and the keyboard equivalents are different.

Is there a way to do it, desirably without much hassle (invisible
buttons, Carbon, etc.)?

Thanks!
___

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

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

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

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


Re:Re: How to display the information in the columns of the table view?

2009-07-27 Thread Bright
Try

[tableRecordsArray addObject:infoDictionary]
instead of
 [tableRecordsArray insertObject:infoDictionary  atIndex:row+i];

Tell us what tableRecordsArray is and how you allocate it.

 I have tried the replacement, it does not work.
The tableRecordsArray the NSArray object for conserve the dragged files to the 
table view.
I allocate it in the controller class's -awakeFromNib method.
   The enclosure is the code of Contoller.m  class . There is the  what the 
tableRecordsArray? is in detail.
Thanks a lot.

myController.rtf
Description: Binary data
___

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

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

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

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

Re: How to display the information in the columns of the table view?

2009-07-27 Thread Andrew Farmer
The crash you're seeing is almost certainly occuring because you  
aren't retaining infoDictionary correctly.

___

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

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

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

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


Re: Multiple keyboard shortcuts for the same menu command

2009-07-27 Thread Тимофей Даньшин
Well, you could have two different menu items doing the same thing and  
having the two shortcuts.

On Jul 27, 2009, at 11:38 AM, Oleg Krupnov wrote:


I'd like the Go Back command in my app to be triggered by both Cmd+[
and Cmd+- (left arrow) keyboard shortcuts. How do I do that?

I am aware of the [NSMenuItem isAlternate] but it only works if the
keyboard equivalents are the same and only the modifiers differ,
whereas in my case the opposite is the case: the modifiers are the
same and the keyboard equivalents are different.

Is there a way to do it, desirably without much hassle (invisible
buttons, Carbon, etc.)?

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/ok5.admin%40gmail.com

This email sent to ok5.ad...@gmail.com


___

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

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

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

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


Dictionary with enum keys?

2009-07-27 Thread Debajit Adhikary
I need to create a dictionary/hashmap where the

   - Keys are enums
   - Values are some subclass of NSObject


NSDictionary won't work here (enums don't conform to NSCopying).

I could perhaps use a CFDictionaryRef here, but I'd like to know if is there
any other way to achieve this.
___

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

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

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

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


Re: Cocoa Document-Based App v. Windows MDI App

2009-07-27 Thread Aaron Burghardt


On Jul 27, 2009, at 12:50 AM, David Blanton wrote:


I think I'll use:

The Mac frameworks just don't support that approach. Sorry. I could  
re-implement MDI on the Mac, but it would be about a man-year's  
work. Do you want me to do that?


To add to that argument, you might list some of the details that would  
be affected.  For example, you may/would break the behavior of the  
Window menu to switch between, or even be aware of, your different  
windows.


Another argument: In the 90's, Microsoft tried to make Office more  
neutral by making the Mac version look/feel like the Windows version  
(Word 6/Excel 5).  It was poorly received, MS took the lesson and  
separated their Mac development into a more autonomous group, then  
proceeded to deliver products that were much better received.  An old  
review of Mac Office 98 should offer documentation of this  
philosophical change, and it persists to this day.


One last argument:  Ask them to consider what they would think if the  
tables were turned and you asked them to change their Windows apps to  
put the menu bar at the top of the screen.


Good luck,

Aaron



smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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

Re: Dictionary with enum keys?

2009-07-27 Thread Jean-Daniel Dupas


Le 27 juil. 09 à 10:48, Debajit Adhikary a écrit :


I need to create a dictionary/hashmap where the

  - Keys are enums
  - Values are some subclass of NSObject


NSDictionary won't work here (enums don't conform to NSCopying).

I could perhaps use a CFDictionaryRef here, but I'd like to know if  
is there

any other way to achieve this.


NSMapTable using NSIntegerMapKeyCallBack. (The C API is recommanded  
when working with something else than object)


But CFDictionary is perfectly valid too.



___

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

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

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

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


Re: Cocoa Document-Based App v. Windows MDI App

2009-07-27 Thread Jean-Daniel Dupas


Le 27 juil. 09 à 10:49, Aaron Burghardt a écrit :



On Jul 27, 2009, at 12:50 AM, David Blanton wrote:


I think I'll use:

The Mac frameworks just don't support that approach. Sorry. I could  
re-implement MDI on the Mac, but it would be about a man-year's  
work. Do you want me to do that?


To add to that argument, you might list some of the details that  
would be affected.  For example, you may/would break the behavior of  
the Window menu to switch between, or even be aware of, your  
different windows.




And more important, you will break Exposé and Spaces (it would not be  
possible to put windows on many spaces).



___

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

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

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

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


Creating an installer for KEXT

2009-07-27 Thread Shraddha Karwan
Hi,

I have a Kernel extension. I am using Package Maker Version 3.0.3 (174). I
need Root Authentication for installing the KEXT in the
/System/Library/Extension directory.
The package maker tutorials on Apple's site refer to some older version of
Package Maker which consists of a Root Authentication check box in the
Contents pane. But the version which I have contains an Admin authentication
check box. I want the root user access for loading the KEXT. How do I
achieve this?

-- 
Regards,
Shraddha Karwan
___

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

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

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

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


Re: Creating an installer for KEXT

2009-07-27 Thread I. Savant

On Jul 27, 2009, at 7:06 AM, Shraddha Karwan wrote:

I have a Kernel extension. I am using Package Maker Version 3.0.3  
(174). I

need Root Authentication for installing the KEXT in the
/System/Library/Extension directory.


  This is best posted to the xcode-users list (Package Maker is part  
of Xcode Tools) ... it isn't specific to Cocoa.


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


Re: How to display the information in the columns ...... is OK

2009-07-27 Thread Bright
The crash you're seeing is almost certainly occuring because you 

aren't retaining infoDictionary correctly.

Haha. You are right. I added the [infoDictionary retain]; at the end of 
the info code fragement.
At the same time, I modified  other code correspondingly. It is OK now. 
 Thank you.  Thank you for everyone's help
Bright
___

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

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

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

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


Re: Rotating image

2009-07-27 Thread Dragos Ionel
No need to release an image created using the imageNamed.

Dragos


On Sun, Jul 26, 2009 at 4:00 AM, Agha Khan agha.k...@me.com wrote:

 HI:
 I have an image which works fine.
 UIImage *img = [UIImage imageNamed:@background.png];
 [img drawAtPoint:CGPointMake(0,0)];
 [img release];

 Now suppose I want to rotate that image at 90 degree. Is there an easy way
 to accomplish this task?

 Best regards
 Agha

 ___

 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/dragosionel%40gmail.com

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

___

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

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

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

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


Re: How to display the file's basic information in the columns of

2009-07-27 Thread Scott Ribe
Debugging the application is better than finding the crash report anyway.

Now that you know where it's crashing, there is of course nothing at all
wrong with putting an NSDictionary into an NSArray. You have a memory error
elsewhere that is the root cause of the crash. I have 2 suggestions:

- Show more of your code, at least from the allocation of theRecordsArray
and infoDictionary until the crash;

- Review the basic memory management rules to try to figure out where you
didn't follow them:

http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Articl
es/mmPractical.html

Note that I'm assuming the simple case and most likely cause--if you're
doing anything like using threads then you'll need to say so ;-)

-- 
Scott Ribe
scott_r...@killerbytes.com
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 arch...@mail-archive.com


Re: bypass NSApp

2009-07-27 Thread Julien Isorce
Hi,

I took all your remarks into account and I decided to
use the event dispatching system that uses the C third party program.

So I post an event which will be handled by the main loop of the C third
party program.
The attached callback intializes the nsapp and in the main thread.

To get ride of [NSapp run], I am also posting at regular time, an event and
the attached callback calls
[NSApp nextEventMatchingMask..], [NSApp sendEvent..].

It also resolves the problem of having several plugins like that (or loading
this same plugin several times)

The solution is ok but I am still convinced that the NSRunLoop could/should
get the ability to perform/handle the events that the NSApp is the only one
able to do.

Anyway, thx for all your answers/advises

Julien


2009/7/11 Stephen J. Butler stephen.but...@gmail.com

 On Fri, Jul 10, 2009 at 6:50 PM, Julien Isorcejulien.iso...@gmail.com
 wrote:
  you are enterely right so then we are moving to the other solution:
 bypass
  NSApp,
  making a classic NSRunLoop but add to it the ability to perform/handle
 the
  events that the NSApp usually is the only one able to do.
 
  I am open to any solution, even if it requires to have only one plugin
 which
  has the main thread (=only one plugin based on Cocoa)

 I just took a break and went swimming, and while I was swimming I
 pondered the question, What is REALLY Julien's problem? I think I
 figured it out!

 I bet you ALREADY have a plugin written in GNUstep working on Linux or
 some other platform. You were hoping you could just recompile the
 plugin on OS X and it would work here too. But as we've been trying to
 tell you, there is no way this will ever work.

 But MacPorts lets you build GNUstep for OS X! So, if this is your
 situation, the way to make this all work is compile GNUstep for OS X,
 and link your app against it like you would in Linux.
 ___

 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/julien.isorce%40gmail.com

 This email sent to julien.iso...@gmail.com

___

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

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

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

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


Re: [iPhone] Why can't a UITextField be its own delegate?

2009-07-27 Thread Jonathan Hendry


On Jul 25, 2009, at 16:14 PM, WT wrote:


Convoluted? I don't see it that way.

This particular text field needs to limit its number of characters  
to a given interval.


Seems like a good job for an NSFormatter attached to the field.
___

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

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

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

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


Re: Views in CDBA's

2009-07-27 Thread David Blanton

3. Set the document view of the scroll view to this view.


This is why I was confused about store Im this nib above. When you  
drag a scroll view in from the Library, it has a custom view inside  
of it, set up as the scroll view's document view. You can use the  
Identity inspector to change it's class to that which you created in  
step 1.




I was thinking I had to set the view programatically.  Now I get it.

I want to thank everyone who offered suggestions, answers and wisdom.

This will be a Mac App (no pun intended) !

I know I'll be back but for now ... Ciao!

db




On Jul 27, 2009, at 12:47 AM, Kyle Sluder wrote:

On Jul 26, 2009, at 10:44 PM, David Blanton aired...@tularosa.net  
wrote:


I dragged a Scroll View from the LIbrary Objects Tab to the Window  
defined in MyDocument.xib.


All of my content to be displayed here will be bit maps.


Well that's a bit of a tautology considering it's all going to be  
rendered into the window's backing store, which is a bitmap.



So .. do I


I'm assuming you're describing a procedure here, not laying out a  
set of options? That's how I'm interpreting it.



1.  make a view, store in this nib.


Make a view is a bit vague. Again assuming, this time that you're  
referring to subclass NSView. In that case yes, but I don't know  
what store in this nib means.



2. Render my bit map to this view.


Yes. Typically this will happen in -drawRect:. You will probably be  
drawing NSBitmapImageReps here.



3. Set the document view of the scroll view to this view.


This is why I was confused about store Im this nib above. When you  
drag a scroll view in from the Library, it has a custom view inside  
of it, set up as the scroll view's document view. You can use the  
Identity inspector to change it's class to that which you created in  
step 1.


--Kyle Sluder





___

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

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

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

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


Re: Document-Based Application

2009-07-27 Thread Scott Ribe
Also remember that although 1 class per file is usual practice, there's
nothing in the language that requires it.

If the cleanest solution turns out to be 22 very small and somewhat similar
classes, put them in 1 file (well ok, 2) instead of spreading them between
22 (well ok, 44) files.

-- 
Scott Ribe
scott_r...@killerbytes.com
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 arch...@mail-archive.com


NSTextView - Image Editing?

2009-07-27 Thread Frank D. Engel, Jr.

Hi,

In Leopard, there is an option to enable Image Editing in an  
NSTextView.  I was hoping that meant I could pop up an Image Edit  
panel, as in an IKImageView, but that doesn't seem to be the case?


What does that option do, and is there any easy way that I could use  
the Image Edit panel within an NSTextView?


I can't seem to find that anywhere, but Pages, for example, seems to  
do something very similar to that...



Thank you!

---
Frank D. Engel, Jr.  fde...@fjrhome.net

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep John 3:16
John 3:16 For God so loved the world, that he gave his only begotten  
Son, that whosoever believeth in him should not perish, but have  
everlasting life.

$


__
D O T E A S Y - Join the web hosting revolution!
http://www.doteasy.com
___

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

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

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

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


Re: NSTextView - Image Editing?

2009-07-27 Thread Douglas Davidson


On Jul 27, 2009, at 8:57 AM, Frank D. Engel, Jr. wrote:

In Leopard, there is an option to enable Image Editing in an  
NSTextView.  I was hoping that meant I could pop up an Image Edit  
panel, as in an IKImageView, but that doesn't seem to be the case?


What does that option do, and is there any easy way that I could use  
the Image Edit panel within an NSTextView?


This option is advisory for attachments; unfortunately the attachment  
classes do not yet implement this functionality, so if you want to pop  
up a panel you would need to do it yourself.


Douglas Davidson

___

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

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

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

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


Re: Search Item in the Application menu missing in Other languages

2009-07-27 Thread Arun
Hi  Peter,

selector(showHelp:) is the default action that gets called when we click on
the Help - showHelp option.
Looks like you did not undersatnd the question correctly.
The Hep menu in english contains a Search menu item in English. If you
change the Operating System language, Search menu item
disappears. Is there any way in which we can get the Search menu item under
Help Menu in all the languages?

Thanks
Arun KA




On Sat, Jul 25, 2009 at 4:33 AM, Peter Ammon pam...@apple.com wrote:


 On Jul 24, 2009, at 11:22 AM, Arun wrote:

  Hi All,

 I have a cocoa application which is localized in multiple languages.
 My application uses default Menu's like File, Edit, View, etc.,
 When the language is set to English in the System Preferences -
 International - languages, Under the Help menu there is an item called
 Search.
 But if the language is changed to french, German or Japanese and
 application
 is launched, the same Search item under Help menu is missing.
 Is there anything that is missing or not configured in my application for
 which my application is behaving like this?

 Thanks
 Arun


 Hi Arun,

 Leopard has some heuristics for determining which menu is the Help menu.
  The simplest way to make sure it gets identified correctly in all languages
 is to include a menu item with the default Help action, which is
 @selector(showHelp:).

 Hope this, well, helps,
 -Peter

___

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

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

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

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


Pop-up Panels?

2009-07-27 Thread Frank D. Engel, Jr.
I want to create something like an NSPopUpButton, but instead of a  
menu coming from it, I'd like to display a custom panel that acts like  
a pop-up menu: it would be a selection interface, but not a simple  
menu; if the user clicks outside of it, it would just disappear and  
nothing would change, etc...  like pop-up calculators and calendars in  
some programs...


I'm sure things like this are done often enough, but all of the search  
terms I'm coming up with are giving me sites that show how to change  
the appearance of the button itself, not what gets popped up.


Can someone point me to something that might help with this?


Thank you!


---
Frank D. Engel, Jr.  fde...@fjrhome.net

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep John 3:16
John 3:16 For God so loved the world, that he gave his only begotten  
Son, that whosoever believeth in him should not perish, but have  
everlasting life.

$


__
D O T E A S Y - Join the web hosting revolution!
http://www.doteasy.com
___

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

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

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

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


Re: NSString -componentsSeparatedByString: line break

2009-07-27 Thread Chase Meadors
Thanks guys, except now I'm having a new problem. My array of lines is  
now containing empty strings that actually report a length of zero.  
This would be fine, except when I try to filter the array to get rid  
of these empty lines,


[array filterUsingPredicate:[NSCompoundPredicate  
notPredicateWithSubpredicate:[NSPredicate predicateWithFormat:@SELF  
LIKE %@, @]]];


this code has no affect. These empty strings have a length of 0 so  
they would have to be just empty strings. Other filtering predicates  
work fine. Is this a problem with the predicate?


On Jul 26, 2009, at 9:57 PM, Rob Keniger wrote:



On 27/07/2009, at 12:23 PM, Adam R. Maxwell wrote:



On Jul 26, 2009, at 7:11 PM, Greg Guerin wrote:


Chase Meadors wrote:

If the length of this mystery string is 1 and it's not a space,  
what is it???


Use -characterAtIndex:0 and print the returned unichar using the  
%x format.


Another sometimes-handy trick is to create a mutable copy and call  
CFStringTransform with kCFStringTransformToUnicodeName.



You should also look at -getLineStart:end:contentsEnd:forRange: if  
you're parsing lines of text, as it takes into account a variety of  
possible line endings, not just \n.


--
Rob Keniger



___

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

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

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

This email sent to c.ed.m...@gmail.com


___

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

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

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

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


iTunes DB Change Notifications?

2009-07-27 Thread Brad Gibbs
I've looked through the docs and Googled, but may not be looking for  
the right terms.


Are there change notifications for the iTunes database?  I'd like to  
have an iTunes client on a different machine on the local network be  
notified of changes, rather than having to poll and reload the  
database regularly.


Thanks.

Brad
___

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

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

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

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


Re: Pop-up Panels?

2009-07-27 Thread I. Savant

On Jul 27, 2009, at 1:35 PM, Frank D. Engel, Jr. wrote:

I want to create something like an NSPopUpButton, but instead of a  
menu coming from it, I'd like to display a custom panel that acts  
like a pop-up menu: it would be a selection interface, but not a  
simple menu; if the user clicks outside of it, it would just  
disappear and nothing would change, etc...  like pop-up calculators  
and calendars in some programs...


  You'd want a button that stays down when the view is displayed  
(like a popup). You'd want a view in which to display your complicated  
UI. For this, you'd need a borderless (or custom-drawn) window to  
position over the control's host window in which to display your  
custom view.


  There are examples of both online. If you have more specific  
questions, post them (in other words, what have you tried, and  
break it down).



I'm sure things like this are done often enough, but all of the  
search terms I'm coming up with are giving me sites that show how to  
change the appearance of the button itself, not what gets popped up.




  I recall someone coming up with something like this (a popup- 
calendar-date-chooser control of some kind). Perhaps you could learn  
by example if you found it.


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


Re: iTunes DB Change Notifications?

2009-07-27 Thread I. Savant

On Jul 27, 2009, at 1:38 PM, Brad Gibbs wrote:

I've looked through the docs and Googled, but may not be looking for  
the right terms.


Are there change notifications for the iTunes database?  I'd like to  
have an iTunes client on a different machine on the local network be  
notified of changes, rather than having to poll and reload the  
database regularly.


  Short answer: No.

  Long answer: You can get around this, but you won't get  
instantaneous notifications. iTunes maintains an XML PLIST  
representation of the database for third-party developers to latch  
onto for reading only. Using FSEvents for Leopard and above (or  
UKKQueue for Tiger and before), you can watch this file for changes  
and respond accordingly.


  Caveat: This doesn't work on network volumes. You'll have to have  
the local machine monitoring for the changes and notifying any  
interested parties (clients) over the network.


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


Re: iTunes DB Change Notifications?

2009-07-27 Thread Kyle Sluder

On Jul 27, 2009, at 10:38 AM, Brad Gibbs bradgi...@mac.com wrote:

Are there change notifications for the iTunes database?  I'd like to  
have an iTunes client on a different machine on the local network be  
notified of changes, rather than having to poll and reload the  
database regularly.


Nope. No public ones, anyway. You could watch the iTunes DB files with  
FSEvents or kqueue and refresh over Apple events when you detect a  
change.


File a Radar, too.

--Kyle Sluder



___

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

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

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

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


NSTableView - strange behaviour after cell text color assignment

2009-07-27 Thread Alexander Bokovikov

Hi, All,

I'm trying to color my table's rows depending on some value, returning  
from a function like this:


int GetState(int rowIndex);

I've searched around the Net and the only clear way I've found is to  
set my AppController, as a tableView delegate and respond to the message


- (void)tableView:(NSTableView *)aTableView
  willDisplayCell:(id)aCell
   forTableColumn:(NSTableColumn *)aTableColumn
  row:(int)rowIndex;

I've created this method as the next:

if (rowIndex == selRow)
color = [NSColor selectedTextColor];
else
switch (st = GetState(rowIndex)) {
case 1 : { color = [NSColor colorWithCalibratedRed:0

 green:0

  blue:0.5

 alpha:1.0]; break; }
case 2 : { color = [NSColor colorWithCalibratedRed:0

 green:0.5

  blue:0

 alpha:1.0]; break; }
case 3 : { color = [NSColor colorWithCalibratedRed:0.5

 green:0

  blue:0

 alpha:1.0]; break; }
}
[aCell  setTextColor:color];

I've got a strange effect: a new row is selected OK, when I change  
selection in the tableview, but the row, which was selected, remains  
being drawn with the same selected color unless reloadData will  
appear. Therefore, changing selection quickly I can change color of  
many rows to selected color, unless update will come. Selection bar  
itself looks OK, and selected row background and text color changes  
immediately, but how to update the row, which was previously selected?  
I believed it will be done by my delegate method. It looks like this  
method is called at some not appropriate time. Is there a solution?


Thanks.



___

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

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

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

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


Re: NSString -componentsSeparatedByString: line break

2009-07-27 Thread Shawn Erickson
On Mon, Jul 27, 2009 at 10:36 AM, Chase Meadorsc.ed.m...@gmail.com wrote:
 Thanks guys, except now I'm having a new problem.

Are you using -getLineStart:end:contentsEnd:forRange:? If not you
should switch to use that and see if you still have an issue.

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/getLineStart:end:contentsEnd:forRange:

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


UITextView not updating

2009-07-27 Thread Development

I asked about this earlier and no one seemed the know the answer.
I have a UITextView inside of a scroll view. The textview is offscreen  
when the main view loads. So it does not update when data is loaded in  
to it. Thus when ever the scroll it is inside moves I use a standard  
scrollview delegate method to detect the scroll. Then execute the code  
below.


if(scrollView == miniScroll){
for (UIView *childView in onlinePeopleView.subviews)
{   
[childView setNeedsDisplay];
}
}

This does not work. setNeedDisplay does not cause it to update and  
display the text inside of the textview. What can I do to cause the  
text to be displayed? Everything else is set up correctly in IB and  
the text size is unaltered. So I know its none of that. If I NSLog()  
the contents of the text view it shows that the textview is infact  
imbued with the correct text it simply will not display. How can I  
force a textview to update it's display?



Thanks
___

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

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

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

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


Re: UITextView not updating

2009-07-27 Thread Luke the Hiesterman

It would be easier to answer this with a sample project.

Luke

On Jul 27, 2009, at 11:10 AM, Development wrote:


I asked about this earlier and no one seemed the know the answer.
I have a UITextView inside of a scroll view. The textview is  
offscreen when the main view loads. So it does not update when data  
is loaded in to it. Thus when ever the scroll it is inside moves I  
use a standard scrollview delegate method to detect the scroll. Then  
execute the code below.


if(scrollView == miniScroll){
for (UIView *childView in onlinePeopleView.subviews)
{   
[childView setNeedsDisplay];
}
}

This does not work. setNeedDisplay does not cause it to update and  
display the text inside of the textview. What can I do to cause the  
text to be displayed? Everything else is set up correctly in IB and  
the text size is unaltered. So I know its none of that. If I NSLog()  
the contents of the text view it shows that the textview is infact  
imbued with the correct text it simply will not display. How can I  
force a textview to update it's display?



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/luketheh%40apple.com

This email sent to luket...@apple.com


___

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

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

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

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


Re: NSString -componentsSeparatedByString: line break

2009-07-27 Thread Chase Meadors
Nevermind though, it WAS an empty string, and I just changed the  
predicate to @SELF == %@, @

I didn't think the == was for strings but it worked.

On Jul 27, 2009, at 1:03 PM, Shawn Erickson wrote:

On Mon, Jul 27, 2009 at 10:36 AM, Chase Meadorsc.ed.m...@gmail.com  
wrote:

Thanks guys, except now I'm having a new problem.


Are you using -getLineStart:end:contentsEnd:forRange:? If not you
should switch to use that and see if you still have an issue.

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#/ 
/apple_ref/occ/instm/NSString/getLineStart:end:contentsEnd:forRange:


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


Re: iTunes DB Change Notifications?

2009-07-27 Thread Brad Gibbs
If Apple is providing the XML file for third party developer use, but  
they don't provide any way to monitor changes, does that mean that  
their intention is for third party apps to regularly refresh from the  
XML file?  Isn't this an extremely expensive operation?  Particularly  
when moving data across a network?


How about interjecting a Core Data app, running on the machine that  
maintains the XML file?  That machine could monitor the XML file with  
FSEvents and maintain a CD DB that mirrors the XML file, adding new  
objects or fetching, updating and then saving changes, as  
appropriate.  On the context's WillSaveNotification, it could alert  
its clients, sending just the updated information.


If this works, the question is, would it be better to maintain  
mirrored CD DB's on each of the clients (clients will be a mix of Macs  
and iPhones), and update those databases when changes occur?  Or,  
should they query the server when they need information?  The client  
UI's would be much more responsive if the clients each maintained  
their own databases, particularly if I wanted to get cover art to the  
clients, but maintenance gets more complicated.




On Jul 27, 2009, at 10:48 AM, Kyle Sluder wrote:


On Jul 27, 2009, at 10:38 AM, Brad Gibbs bradgi...@mac.com wrote:

Are there change notifications for the iTunes database?  I'd like  
to have an iTunes client on a different machine on the local  
network be notified of changes, rather than having to poll and  
reload the database regularly.


Nope. No public ones, anyway. You could watch the iTunes DB files  
with FSEvents or kqueue and refresh over Apple events when you  
detect a change.


File a Radar, too.

--Kyle Sluder




___

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

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

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

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


Re: iTunes DB Change Notifications?

2009-07-27 Thread slasktrattena...@gmail.com
On Mon, Jul 27, 2009 at 7:46 PM, I. Savantidiotsavant2...@gmail.com wrote:
 On Jul 27, 2009, at 1:38 PM, Brad Gibbs wrote:

 I've looked through the docs and Googled, but may not be looking for the
 right terms.

 Are there change notifications for the iTunes database?  I'd like to have
 an iTunes client on a different machine on the local network be notified of
 changes, rather than having to poll and reload the database regularly.

  Short answer: No.


Short answer: YES. A distributed notification is posted every time the
the database is updated. Add an observer for notifications named
com.apple.iTunes.sourceSaved posted by object
com.apple.iTunes.sources.

Good luck.
___

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

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

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

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


Re: iTunes DB Change Notifications?

2009-07-27 Thread I. Savant

On Jul 27, 2009, at 3:09 PM, slasktrattena...@gmail.com wrote:


Short answer: YES. A distributed notification is posted every time the
the database is updated. Add an observer for notifications named
com.apple.iTunes.sourceSaved posted by object
com.apple.iTunes.sources.


  Is this documented / public? If not, fair warning: this string  
could change at any time without notice and your product will stop  
working.


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


Re: Search Item in the Application menu missing in Other languages

2009-07-27 Thread Peter Ammon
Arun, my advice is the same.  To identify which menu (if any) should  
get the Search field, AppKit examines the actions of the items in that  
menu.  If a menu contains an item with the showHelp: action, then  
AppKit concludes that menu is the Help menu, and it will get the  
Search field.


-Peter

On Jul 27, 2009, at 9:54 AM, Arun wrote:


Hi  Peter,

selector(showHelp:) is the default action that gets called when we  
click on the Help - showHelp option.

Looks like you did not undersatnd the question correctly.
The Hep menu in english contains a Search menu item in English. If  
you change the Operating System language, Search menu item
disappears. Is there any way in which we can get the Search menu  
item under Help Menu in all the languages?


Thanks
Arun KA




On Sat, Jul 25, 2009 at 4:33 AM, Peter Ammon pam...@apple.com wrote:

On Jul 24, 2009, at 11:22 AM, Arun wrote:

Hi All,

I have a cocoa application which is localized in multiple languages.
My application uses default Menu's like File, Edit, View, etc.,
When the language is set to English in the System Preferences -
International - languages, Under the Help menu there is an item  
called

Search.
But if the language is changed to french, German or Japanese and  
application

is launched, the same Search item under Help menu is missing.
Is there anything that is missing or not configured in my  
application for

which my application is behaving like this?

Thanks
Arun

Hi Arun,

Leopard has some heuristics for determining which menu is the Help  
menu.  The simplest way to make sure it gets identified correctly in  
all languages is to include a menu item with the default Help  
action, which is @selector(showHelp:).


Hope this, well, helps,
-Peter



___

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

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

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

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


Re: NSTableView - strange behaviour after cell text color assignment

2009-07-27 Thread Alexander Bokovikov

Replying to myself:


- (void)tableView:(NSTableView *)aTableView
  willDisplayCell:(id)aCell
   forTableColumn:(NSTableColumn *)aTableColumn
  row:(int)rowIndex;


The function above works perfectly, but the problem reason was in the  
incorrect receiving of the selected row index. I wrongly assigned it,  
as a global variable, within a function, which updated my table data  
on timer. therefore the selected row index value was changed on timer,  
but not on real selection change. why didn't 5 set the assignment in  
the tableViewSelected: action, going from tableView? Really, I did it.  
But unfortunately this action raises on the mouse clicks only.  
Keyboard clicks are passing by this action.


Fortunately I've found a solution, that really works. I've registered  
an observer for NSTableViewSelectionDidChangeNotification  
notification, and now every change of selection is processed.


I believe, the question is closed.

Thanks.
___

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

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

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

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


Re: Creating an installer for KEXT

2009-07-27 Thread Fritz Anderson

On 27 Jul 2009, at 6:52 AM, I. Savant wrote:

 This is best posted to the xcode-users list (Package Maker is part  
of Xcode Tools) ... it isn't specific to Cocoa.


Better yet, installer-dev, which is specifically for PackageMaker and  
Installer.app. PackageMaker is... um... subtle. You need a specialty  
list.


— F

--
Fritz Anderson -- Xcode 3 Unleashed: Now in its second printing -- http://x3u.manoverboard.org/ 



___

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

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

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

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


Re: [iPhone] Why can't a UITextField be its own delegate?

2009-07-27 Thread Fritz Anderson

On 27 Jul 2009, at 9:58 AM, Jonathan Hendry wrote:


Seems like a good job for an NSFormatter attached to the field.


Can you attach an NSFormatter to a UITextField? The only mention in  
the docs of attaching formatters to cells says right up front that the  
subject does not apply to iPhone OS.


— F

--
Fritz Anderson -- Xcode 3 Unleashed: Now in its second printing -- http://x3u.manoverboard.org/ 



___

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

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

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

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


Re: Dictionary with enum keys?

2009-07-27 Thread Ken Thomases

On Jul 27, 2009, at 3:52 AM, Jean-Daniel Dupas wrote:


Le 27 juil. 09 à 10:48, Debajit Adhikary a écrit :


I need to create a dictionary/hashmap where the

 - Keys are enums
 - Values are some subclass of NSObject


NSDictionary won't work here (enums don't conform to NSCopying).

I could perhaps use a CFDictionaryRef here, but I'd like to know if  
is there

any other way to achieve this.


NSMapTable using NSIntegerMapKeyCallBack. (The C API is recommanded  
when working with something else than object)


But CFDictionary is perfectly valid too.


You can also use NSDictionary with NSNumber keys.  You'll just have to  
cast your enum values to one of the integer types.


Cheers,
Ken

___

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

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

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

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


NSTableView cell editing begin / end notifications?

2009-07-27 Thread Alexander Bokovikov

Hi, All,

In my app I have a table, populated by some periodic procedure,  
working on a timer. At the same time I need to add a cell editing  
capability. But periodic updating procedure calls [tableView  
reloadData], which resets the cell editor, if it is active.


Therefore I need to stop this update procedure for a time, when cell  
editor is active. I've searched over the Net, but can't find any  
simple solution or description, how to catch editor appearance and  
hiding. Could anybody point me any sample or at least what  
notifications should I use? I don't like the idea to subclass a cell  
editor, but of course I'll do it (though don't know how to do it yet)  
if there will no other simpler solutions.


Thanks.
___

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

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

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

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


How to set the string and integer value of an NSButtonCell using NSOutilneView

2009-07-27 Thread Korei Klein
I'm implementing an NSOutlineViewDataSource object which will be the 
data source of an NSOutlineView.

The NSOutlineView displays its data in NSButtonCell s.

The value displayed in an NSButtonCell is both an integer, and a string.
The delegate method which I am implementing 
outlineView:objectValueForTableColumn:byItem, however, allows me to 
return only one value to the NSOutlineView.


Is it possible for my implementation of 
outlineView:objectValueForTableColumn:byItem to set both the string 
value and the integer value of the NSButtonCell?



Also, how do I determine the index of the column which is the second 
argument of outlineView:objectValueForTableColumn:byItem.

___

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

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

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

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


NSXMLDocument and schema validation (Not finding schema document?)

2009-07-27 Thread Leif Harrison
Has anyone had success using NSXMLDocument to validate XML using an  
XML Schema document?  I can parse and process my XML file fine as long  
as I don't validate, but when I call validateAndReturnError: I'm  
getting back the error xmlSchemaParse: could not load ''.


As far as I can tell, the schema URL in my XML document is fine (I can  
access it using Safari), and I've validated the same XML document  
using the same schema URL using XML Nanny.  So...I can't figure out  
why NSXMLDocument can't find my schema.  Heck, I've even grabbed the  
schema URL from the NSXMLDocument root element (by getting the  
attribute xsi:schemaLocation) and checked that I can access the URL  
directly using NSString stringWithContentsOfURL:.


Does NSXMLDocument actually use the URL specified via  
xsi:schemaLocation, or do I need to actually put the schema document  
somewhere else?


- Leif Harrison
  rexfe...@catsreach.org
  l...@ubermind.com
___

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

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

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

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


nil there not here

2009-07-27 Thread David Blanton

I create a CGImageRef and store it
When I get around to using it, it is nil

My code is below ... fire away, please!


#import MyDocumentView.h

@interface MyDocument : NSDocument
{
MyDocumentView* _myDocumentView;
}
@end


- (id)init
{
self = [super init];
if (self) {

// Add your subclass-specific initialization here.
// If an error occurs here, send a [self release] message and  
return nil.


_myDocumentView = [[MyDocumentView alloc] init];
[_myDocumentView retain];

}
return self;
}


- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error: 
(NSError **)outError


	context = CGBitmapContextCreate (bitmap.m_array, bitmap.m_pixelsx,  
bitmap.m_pixelsy, 8, bitmap.m_pixelsx * 4, colorSpace, 	 
kCGImageAlphaNoneSkipFirst|kCGBitmapByteOrder32Host);	

CGImageRelease(_myDocumentView-_cgImageRef);
_myDocumentView-_cgImageRef =  CGBitmapContextCreateImage (context);
CGImageRetain(_myDocumentView-_cgImageRef); 
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);

at this point _myDocumentView-_cgImageRef is not nil



@interface MyDocumentView : NSView {
@public
CGImageRef  _cgImageRef;
}

@end

@implementation MyDocumentView

- (void)drawRect:(NSRect)dirtyRect {

if(_cgImageRef)  HERE _cgImageRef is nil
{
		NSGraphicsContext *graphicsContext = [NSGraphicsContext  
currentContext];

CGContextRef context = (CGContextRef)[graphicsContext 
graphicsPort];
CGRect r;
		r = CGRectMake(dirtyRect.origin.x  , dirtyRect.origin.y ,  
dirtyRect.size.width, dirtyRect.size.width);	

CGContextDrawImage(context, r, _cgImageRef);
}
}

@end

___

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

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

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

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


Re: How to set the string and integer value of an NSButtonCell using NSOutilneView

2009-07-27 Thread Chase Meadors
Well, according to the documentation, an NSButtonCell's object value  
(and all interpretations thereof) correspond to the state of the  
button (on, off, or mixed). You want to set this as well as set the  
title of the button. Unlike NSBrowser, NSOutlineView's data source  
methods don't provide direct access to the cell, it only asks you for  
the object value.


It's a bit of a pain, but if you want the button state AND the title  
of the button to be affected by object value, you could subclass  
NSButtonCell and override -setObjectValue:. THEN, in the datasource  
methods, you could pass a dictionary containing an int and a string.  
Then do this:


- (void)setObjectValue:(id)object {

[super setObjectValue:[object valueForKey:@buttonState]];

[self setTitle:[object valueForKey:@buttonTitle]];

}

Getting controls to USE your custom cell can be icky (NSBrowser ack!),  
but I don't have much experience with NSOutlineView. If you have  
trouble with that, just reply and ask on the list. You should be able  
to just call -setCellClass:[MyCustomCell class] on your outline view.


On Jul 27, 2009, at 4:17 PM, Korei Klein wrote:

I'm implementing an NSOutlineViewDataSource object which will be the  
data source of an NSOutlineView.

The NSOutlineView displays its data in NSButtonCell s.

The value displayed in an NSButtonCell is both an integer, and a  
string.
The delegate method which I am implementing  
outlineView:objectValueForTableColumn:byItem, however, allows me to  
return only one value to the NSOutlineView.


Is it possible for my implementation of  
outlineView:objectValueForTableColumn:byItem to set both the string  
value and the integer value of the NSButtonCell?



Also, how do I determine the index of the column which is the second  
argument of outlineView:objectValueForTableColumn:byItem.

___

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/c.ed.mead%40gmail.com

This email sent to c.ed.m...@gmail.com


___

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

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

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

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


Re: [iPhone] Why can't a UITextField be its own delegate?

2009-07-27 Thread WT

On Jul 26, 2009, at 4:16 AM, Greg Guerin wrote:


WT wrote:

It seems I'll have to opt for having a regular UITextField and a  
custom class whose sole purpose is to provide a delegate that does  
the common work. As Kyle suggested, I may need to make that a  
superclass and derive additional delegates to perform extra work  
after the common task.


As previously noted, you could also give the common-task delegate  
its own delegate.  Then you get the advantages of delegation, it's  
just one level away from the UITextField's direct delegate.


More generally, you could implement the Chain Of Responsibility  
pattern in the UITextField's direct delegate (the principal  
delegate), so any number of other secondary delegates could  
contribute to the overall task, in chain-priority order, and  
according to which selectors a secondary delegate implements.  Since  
any secondary delegate could also be the principal of its own chain,  
you have the potential for a tree of delegates.


Yes, after careful consideration, the Chain of Responsibility is the  
approach I went with, and it's working great. Thanks for the suggestion.


Wagner
___

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

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

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

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


Re: nil there not here

2009-07-27 Thread Greg Guerin

David Blanton wrote:


_myDocumentView = [[MyDocumentView alloc] init];
[_myDocumentView retain];


This is over-retaining _myDocumentView.  You called alloc/init, so  
you already own the instance.  If you retain it again, you're not  
gaining anything.  Unless you're doing the extra retain because  
you're over-releasing somewhere else.  Then the extra retain is  
hiding the symptom of the over-release bug.



Regarding the rest of your code, is it possible for -drawRect to be  
called before readFromData has been called and returned?  I note this  
in particular because drawRect is basically a callback rather than  
something you directly invoke.


Is MyDocumentView being added to a view hierarchy before readFromData  
has been invoked?


And is there a reason readFromData isn't a method of MyDocumentView?   
It seems odd to be manipulating another object's ivars directly from  
some other class.


  -- GG

___

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

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

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

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


Re: nil there not here More Info

2009-07-27 Thread David Blanton
I just noticed that the object I allocate is not the one whose  
drawRect is being called ... I am confused ... what other object is  
there !


On Jul 27, 2009, at 3:44 PM, David Blanton wrote:


I create a CGImageRef and store it
When I get around to using it, it is nil

My code is below ... fire away, please!


#import MyDocumentView.h

@interface MyDocument : NSDocument
{
MyDocumentView* _myDocumentView;
}
@end


- (id)init
{
   self = [super init];
   if (self) {

   // Add your subclass-specific initialization here.
   // If an error occurs here, send a [self release] message and  
return nil.


_myDocumentView = [[MyDocumentView alloc] init];
[_myDocumentView retain];

   }
   return self;
}


- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName  
error:(NSError **)outError


	context = CGBitmapContextCreate (bitmap.m_array, bitmap.m_pixelsx,  
bitmap.m_pixelsy, 8, bitmap.m_pixelsx * 4, colorSpace, 	 
kCGImageAlphaNoneSkipFirst|kCGBitmapByteOrder32Host);	

CGImageRelease(_myDocumentView-_cgImageRef);
_myDocumentView-_cgImageRef =  CGBitmapContextCreateImage (context);
CGImageRetain(_myDocumentView-_cgImageRef); 
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);

at this point _myDocumentView-_cgImageRef is not nil



@interface MyDocumentView : NSView {
@public
CGImageRef  _cgImageRef;
}

@end

@implementation MyDocumentView

- (void)drawRect:(NSRect)dirtyRect {

if(_cgImageRef)  HERE _cgImageRef is nil
{
		NSGraphicsContext *graphicsContext = [NSGraphicsContext  
currentContext];

CGContextRef context = (CGContextRef)[graphicsContext 
graphicsPort];
CGRect r;
		r = CGRectMake(dirtyRect.origin.x  , dirtyRect.origin.y ,  
dirtyRect.size.width, dirtyRect.size.width);	

CGContextDrawImage(context, r, _cgImageRef);
}
}

@end

___

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

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

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

This email sent to aired...@tularosa.net





___

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

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

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

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


Re: [iPhone] Why can't a UITextField be its own delegate?

2009-07-27 Thread WT

On Jul 27, 2009, at 10:32 PM, Fritz Anderson wrote:


On 27 Jul 2009, at 9:58 AM, Jonathan Hendry wrote:


Seems like a good job for an NSFormatter attached to the field.


Can you attach an NSFormatter to a UITextField? The only mention in  
the docs of attaching formatters to cells says right up front that  
the subject does not apply to iPhone OS.


— F


That's the reason I had to code it (limiting the number of characters)  
myself. My understanding, like yours, was that you can't attach a  
formatter to a text field on the iPhone SDK.


Wagner

___

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

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

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

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


Re: nil there not here

2009-07-27 Thread Dave Carrigan


On Jul 27, 2009, at 2:44 PM, David Blanton wrote:


_myDocumentView = [[MyDocumentView alloc] init];
[_myDocumentView retain];


You already own _myDocumentView by virtue of the fact that you used  
alloc/init, so this extra retain is going to lead to memory leaks  
unless you release twice in -dealloc (which obviously you don't want  
to do).


- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName  
error:(NSError **)outError


	context = CGBitmapContextCreate (bitmap.m_array, bitmap.m_pixelsx,  
bitmap.m_pixelsy, 8, bitmap.m_pixelsx * 4, colorSpace, 	 
kCGImageAlphaNoneSkipFirst|kCGBitmapByteOrder32Host);	

CGImageRelease(_myDocumentView-_cgImageRef);
_myDocumentView-_cgImageRef =  CGBitmapContextCreateImage (context);
CGImageRetain(_myDocumentView-_cgImageRef); 
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);


You are treating _myDocumentView as a pointer to a struct. Since you  
declared as _cgImageRef as @public, it will work, it completely  
defeats the goal of encapsulation in the language, so you should have  
a good reason for doing it. If you can't think of a good reason, then  
instead you should set up getter and setter methods for these members:


- (void)setImage:(CGImageRef)image
{
  CFRetain(image);
  CFRelease(_cgImageRef);
  _cgImageRef = image;
}

- (CGImageRef)image
{
  return _cgImageRef;
}

An even better design would probably be to not even create getters and  
setters and create a method in your view such as


- (BOOL)setImageFromData:(NSData*)data type:(NSString*)type error: 
(NSError**)error

{
   /* everything in -readFromData goes here
}

Then:

- (BOOL)readFromData:(NSData*)data ofType:(NSString*)typeName error: 
(NSError*)outError

{
   return [_myDocumentView setImageFromData:data type:typeName  
error:outError];

}

It's hard to say without knowing your architecture if that's the  
better design, but it is definitely better if your view is the only  
thing that uses the imageref, especially since it completely hides the  
fact that your view uses CGImages and you are now free to use anything  
else that comes along without affecting the rest of your design.


As to why your ivar becomes nil, that's hard to say without seeing  
your entire project. But I suspect that if you start using better  
encapsulation and other OO principals in your design, your problem  
will disappear.


Regards,

--
Dave Carrigan
d...@rudedog.org
Seattle, WA, USA



PGP.sig
Description: This is a digitally signed message part
___

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

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

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

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

Re: nil there not here More Info

2009-07-27 Thread Scott Ribe
 I just noticed that the object I allocate is not the one whose
 drawRect is being called ... I am confused ... what other object is
 there !

One defined in a nib file perhaps?

-- 
Scott Ribe
scott_r...@killerbytes.com
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 arch...@mail-archive.com


Re: UITextView not updating

2009-07-27 Thread Info

Hi,

I run into the same problem with an app for that I decided to set up  
my view controllers / views as singletons (and therefore to reuse them).


Views within a scroll view display their previous values if they  
become a new value assigned when they are scrolled off (screen or  
scroll view bounds - I can't tell).


A fix (very bad for performance) is to set up the view controller as a  
delegate for the scroll view and to do somethings like this:


-(void) viewDidScroll {
   myTextView.frame=myTextView.frame;
}

It's a bug in UIKit a I always wanted to file but didn't do...

Markus

On 27.07.2009, at 20:10, Development wrote:


I asked about this earlier and no one seemed the know the answer.
I have a UITextView inside of a scroll view. The textview is  
offscreen when the main view loads. So it does not update when data  
is loaded in to it. Thus when ever the scroll it is inside moves I  
use a standard scrollview delegate method to detect the scroll. Then  
execute the code below.


if(scrollView == miniScroll){
for (UIView *childView in onlinePeopleView.subviews)
{   
[childView setNeedsDisplay];
}
}

This does not work. setNeedDisplay does not cause it to update and  
display the text inside of the textview. What can I do to cause the  
text to be displayed? Everything else is set up correctly in IB and  
the text size is unaltered. So I know its none of that. If I NSLog()  
the contents of the text view it shows that the textview is infact  
imbued with the correct text it simply will not display. How can I  
force a textview to update it's display?



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/info%40edv-medien.de

This email sent to i...@edv-medien.de



___

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

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

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

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


Re: nil there not here

2009-07-27 Thread David Blanton


- (BOOL)readFromData:(NSData*)data ofType:(NSString*)typeName error: 
(NSError*)outError

{
  return [_myDocumentView setImageFromData:data type:typeName  
error:outError];

}


Yes, I should do it as above and will. Thanks for the suggestion.

I guess a better way of stating the problem is :

What is the preferred method of associating a view with a document?   
This is the fundamental issue for me.


___

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

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

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

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


Re: nil there not here

2009-07-27 Thread Kyle Sluder
On Mon, Jul 27, 2009 at 3:56 PM, David Blantonaired...@tularosa.net wrote:
 What is the preferred method of associating a view with a document?  This is
 the fundamental issue for me.

It's known as the Model-View-Controller paradigm.  Typically you
create some custom class known as a controller, which mediates between
a view and the model (document).

--Kyle Sluder
___

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

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

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

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


Re: How to display the information in the columns of the table view?

2009-07-27 Thread Paul M



Hi all,
   In my application, I want to drag the file into the table view. At 
the same time, display the basic information in the columns of the 
table view.

...


Thanks for just wasting an hour and a half trying to recover from that 
stupid huge attachment!


I'm on dial-up - I have no choice, I live in a rural area.

When my email froze trying to dl the first message after I logged in, I 
thought it was rfelated to some other problems earlier in the day. 
After killing the connection and running a few tests, I found I was 
temporarily locked out of the apple list, presumably because it thought 
I still had an active connection.
Anyway it got worse from there but I'll bore you no longer, You caused 
me significant irritation, and prevented me from getting some emails I 
was waiting on.


Actually. I'm surprised that the list allows such stupid behaviour.


___

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

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

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

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


Dynamic UI with scroll view

2009-07-27 Thread Chase Meadors
I'm writing an app where the number of controls in the UI is dependent  
on the amount of information to be entered. The scroll view  
programming guide is not helping either. The only experience I've had  
with scroll views is the ones that come with other views in IB.


If I'm thinking correctly, I can build a view in code (with copying  
some generic text fields/popup with correct settings in the nib) then  
set the documentView of the scroll view with this newly created view.  
But this: (the scroll view is an independent scroll view made in IB)


NSLog(@%@, [scrollView documentView]); //outputs (null)

[scrollView setDocumentView:[[NSView alloc]  
initWithFrame:NSMakeRect(0, 0, 500, 500)]];


NSLog(@%@, [scrollView documentView]); //outputs (null) again

Also, I'm not too clear on how the frame of this view should work.  
Should I just make it whatever height I need for all the controls and  
the scroll view will scroll it?


Thanks for any help.
___

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

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

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

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


Re: NSString -componentsSeparatedByString: line break

2009-07-27 Thread Kirk Kerekes

How about:

[array filterUsingPredicate:[NSPredicate  
predicateWithFormat:@SELF.length  0]];


LIKE is awfully fancy for the purpose.

On Jul 27, 2009, at 2:03 PM, cocoa-dev-requ...@lists.apple.com wrote:


Date: Mon, 27 Jul 2009 12:36:27 -0500
From: Chase Meadors c.ed.m...@gmail.com
Subject: Re: NSString -componentsSeparatedByString: line break
To: Cocoa-Dev List Cocoa-dev@lists.apple.com
Message-ID: e8f93d5f-f100-47ee-bf8a-a6fa26200...@gmail.com
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

Thanks guys, except now I'm having a new problem. My array of lines is
now containing empty strings that actually report a length of zero.
This would be fine, except when I try to filter the array to get rid
of these empty lines,

[array filterUsingPredicate:[NSCompoundPredicate
notPredicateWithSubpredicate:[NSPredicate predicateWithFormat:@SELF
LIKE %@, @]]];

this code has no affect. These empty strings have a length of 0 so
they would have to be just empty strings. Other filtering predicates
work fine. Is this a problem with the predicate?


___

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

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

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

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


NSString and regular expressions

2009-07-27 Thread Rick Mann
I need to do some regex searches on NSStrings, and use capturing  
groups. Looking online I found some discussions from 2003 referring to  
MOKit, which hasn't been touched since 2005, and seems to include a  
lot of stuff I don't care about. Other references to agkit suggest it  
doesn't support unicode.


All of this makes me wonder if there's not a better support in this  
day and age for regex? I'm surprised not to find it in NSString.


Recommendations on what I should use? Thanks!


--
Rick

___

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

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

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

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


Re: NSString and regular expressions

2009-07-27 Thread Dave DeLong

RegexKit.  Without a doubt.

http://regexkit.sourceforge.net

I use it in about 75% of my projects.

Dave

On Jul 27, 2009, at 6:37 PM, Rick Mann wrote:

I need to do some regex searches on NSStrings, and use capturing  
groups. Looking online I found some discussions from 2003 referring  
to MOKit, which hasn't been touched since 2005, and seems to include  
a lot of stuff I don't care about. Other references to agkit suggest  
it doesn't support unicode.


All of this makes me wonder if there's not a better support in this  
day and age for regex? I'm surprised not to find it in NSString.


Recommendations on what I should use? Thanks!


--
Rick

___

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/davedelong%40me.com

This email sent to davedel...@me.com


___

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

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

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

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


Re: NSString and regular expressions

2009-07-27 Thread Rob Keniger


On 28/07/2009, at 10:38 AM, Dave DeLong wrote:


RegexKit.  Without a doubt.

http://regexkit.sourceforge.net

I use it in about 75% of my projects.


RegexKit is very nice and extremely comprehensive, but it has quite a  
large footprint and is probably overkill for many uses.


Unfortunately, RegexKit Lite (the stripped-down version) uses the  
built-in ICU library which uses a syntax quite different to the PCRE  
that most people are used to.


You might want to look at AGRegex which is very compact (one class)  
and which uses PCRE:


http://colloquy.info/project/browser/trunk/Frameworks/AGRegex

--
Rob Keniger



___

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

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

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

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


NSWindow reference remains null after window did load

2009-07-27 Thread Daniel Child
I have a master controller loading a window controller subclass, but  
for some reason, I cannot get a pointer to the window loaded in the  
XIB file. I've looked at every connection, and I've also tested the  
order by of method calls.


In the window controller's init:
[self window] yields nothing.

Likewise in awakeFromNib and windowDidLoad.

It's totally mysterious because I have practically identical setups in  
two other programs, the only difference being that they used nib files  
and this is xib. But from what I understand, that shouldn't matter.


For what it's worth, in the XIB file, the window outlet goes to File's  
Owner (the window controller subclass). The window contains a table,  
and (unsurprisingly) [myTable window] also yields nothing.


Eventually the window does load, but only in its basic nib-drawn form,  
ignoring all of the initialization that the controller is supposed to  
do except for two text fields, which do for some reason get initialized.


I've spent hours checking connections and stepping through code. Does  
anyone have a suggestion where I can look to track down this issue.


Thanks.
___

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

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

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

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


Re: NSTableView - strange behaviour after cell text color assignment

2009-07-27 Thread Graham Cox


On 28/07/2009, at 5:51 AM, Alexander Bokovikov wrote:


I wrongly assigned it, as a global variable



Whenever you find yourself doing this, stop, look and figure out  
another way. It's almost invariably a sign of a bad design or flawed  
implementation.


--Graham


___

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

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

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

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


Re: NSWindow reference remains null after window did load

2009-07-27 Thread Graham Cox


On 28/07/2009, at 12:39 PM, Daniel Child wrote:

I have a master controller loading a window controller subclass, but  
for some reason, I cannot get a pointer to the window loaded in the  
XIB file. I've looked at every connection, and I've also tested the  
order by of method calls.


In the window controller's init:
[self window] yields nothing.

Likewise in awakeFromNib and windowDidLoad.

It's totally mysterious because I have practically identical setups  
in two other programs, the only difference being that they used nib  
files and this is xib. But from what I understand, that shouldn't  
matter.


For what it's worth, in the XIB file, the window outlet goes to  
File's Owner (the window controller subclass). The window contains a  
table, and (unsurprisingly) [myTable window] also yields nothing.


If this is literally true, isn't this the problem? The window outlet  
of the controller should go to... ta-d!... the WINDOW. That is,  
the actual window, not its controller, or a view within it, but the  
NSWindow object.


--Graham


___

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

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

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

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


Re: NSWindow reference remains null after window did load

2009-07-27 Thread Randall Meadows

On Jul 27, 2009, at 8:39 PM, Daniel Child wrote:

I have a master controller loading a window controller subclass, but  
for some reason, I cannot get a pointer to the window loaded in the  
XIB file. I've looked at every connection, and I've also tested the  
order by of method calls.


In the window controller's init:
[self window] yields nothing.

Likewise in awakeFromNib and windowDidLoad.

It's totally mysterious because I have practically identical setups  
in two other programs, the only difference being that they used nib  
files and this is xib. But from what I understand, that shouldn't  
matter.


For what it's worth, in the XIB file, the window outlet goes to  
File's Owner (the window controller subclass). The window contains a  
table, and (unsurprisingly) [myTable window] also yields nothing.


Eventually the window does load, but only in its basic nib-drawn  
form, ignoring all of the initialization that the controller is  
supposed to do except for two text fields, which do for some reason  
get initialized.


I've spent hours checking connections and stepping through code.  
Does anyone have a suggestion where I can look to track down this  
issue.


This came up in another chat I had today.  In that case, the window  
was not set to be visible at launch, so the system deferred actually  
loading it until it was ready to be shown.  Perhaps that's happening  
to you?

___

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

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

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

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


Re: Dictionary with enum keys?

2009-07-27 Thread Debajit Adhikary
Thanks! The NSNumber approach is working fine :)

On Mon, Jul 27, 2009 at 1:35 PM, Ken Thomases k...@codeweavers.com wrote:

 On Jul 27, 2009, at 3:52 AM, Jean-Daniel Dupas wrote:

  Le 27 juil. 09 à 10:48, Debajit Adhikary a écrit :

  I need to create a dictionary/hashmap where the

  - Keys are enums
  - Values are some subclass of NSObject


 NSDictionary won't work here (enums don't conform to NSCopying).

 I could perhaps use a CFDictionaryRef here, but I'd like to know if is
 there
 any other way to achieve this.


 NSMapTable using NSIntegerMapKeyCallBack. (The C API is recommanded when
 working with something else than object)

 But CFDictionary is perfectly valid too.


 You can also use NSDictionary with NSNumber keys.  You'll just have to cast
 your enum values to one of the integer types.

 Cheers,
 Ken


___

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

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

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

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