User Experience, Bring App Window back when Clicking Dock Icon

2010-04-01 Thread Gustavo Pizano
Hello.

I was reading a little about the user Experience, but I hadn't been able to 
achieve the goal, when I close the window, it closes the it but the app doesn't 
terminate but I can't bring it back again, I have set in IB to don't release 
when closed. I tried doing something with the Window Menu, but once I close the 
window it deactivate all the items, so I can't associate a Menu Item to the 
App's makeFrontAndKey method,  I guess Im really missing something, 

The other option I see is that most of the apps once I click the dock icon 
again it will bring the window back on screen,  how to achieve this? some 
window delegate method?


Thanks 

Gustavo


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CALayer's removeFromSuperlayer processing time

2010-04-01 Thread vincent habchi
Le 31 mars 2010 à 22:02, vincent habchi a écrit :

> For some unknown reason (I am investigating on that), the new layer I create 
> to replace the old won't be displayed before the old get deallocated. So I 
> get a visible glitch while the old layer is removed from screen but not yet 
> deallocated.

Okay, I've solved this using a timer.

Thanks a lot,
Vincent


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Adding Rows to a Table View

2010-04-01 Thread Dave

Hi Fritz and Matt,

Thanks for taking the time to reply.


On 1 Apr 2010, at 00:30, Matt Neuburg wrote:

And one other thought - you say you're gathering this data in a  
"secondary
thread", so be sure to jump out to the main thread before calling  
something

like insertRowsAtIndexPaths:withRowAnimation or reloadData. m.


I confirm that the method that calls  
insertRowsAtIndexPaths:withRowAnimation/reloadData is called from the  
Main Thread.


On 31 Mar 2010, at 21:17, Fritz Anderson wrote:

Fix this first; I'm surprised it doesn't crash your app almost  
immediately:


On 31 Mar 2010, at 1:52 PM, Dave wrote:
...

[myObjectNameString release];
[myFactYearString release];
[myFactMonthString release];
[myFactDayString release];
[myFactSourceDatabaseString release];
[myFactTextString release];


Review the memory-management rules. You don't take ownership of any  
of the objects you get from myDictionary, and you must not release  
them. If you're using Xcode 3.2 or later, try Build > Build and  
Analyze from time to time. If you're not, Snow Leopard is only $30.


The "release" calls were actually if'ed out of the version I was  
running. This was the remnants of some debug code I'd added ages ago,  
I've removed the offending lines now.


I actually have Snow Leopard, but I'm using Leopard at the moment. I  
can easily move over to Snow Leopard, I will do that over the weekend.


For the rest: If it were me, I'd note that  
insertRowsAtIndexPaths:withRowAnimation: takes an array, allocate  
an NSMutableArray and accumulate the paths into it at each  
iteration of the loop, not doing the insertRows..., reloading the  
table, or the re-titling of the controller until I was out of the  
loop.


After that, I'd break after the end of the loop, and see if the  
index-path array contained as many objects as I expected, and that  
they were all unique. I think I'd have a better picture then.


— F



I've recoded the method so that it does as you said and build an  
array and then just makes one call to  
"insertRowsAtIndexPaths:withRowAnimation:". However it still fails to  
update the table. None of the expected call backs are called. I've  
tried this with both the row and section starting at 0 and at 1.  
Could someone tell me what the correct index starting point is? (e.g.  
0 or 1).


"numberOfSectionsInTableView"		 -- Gets called once and always  
returns 1.
"tableView: numberOfRowsInSection"	-- Gets called once and returns  
the number of items in the initially empty array (0).


None of the other TableView call backs gets called.

I've tried it with/without calls to reloadData. I've stepped through  
the code and at the end of the loop there is the correct number of  
items in the "myIndexPathArray". In the most case the number of items  
passed to the "parser: didParseItems" will be 10. This is the current  
size of the batch of items to buffer before updating the main Array  
and the TableView.


Any ideas on what to try next? I've googled this and found a number  
of threads from people with the same or similar problems but have not  
found anything on what is causing the problem and how to fix it.


Thanks again for your help.
All the Best
Dave

I've copied the code below

- (void)parser:(ParserBase*)theParser didParseItems:(NSArray*) 
theItemDictionaryArray

{
NSEnumerator*   myArrayEnumerator;
NSDictionary*   myDictionary;
NSString*   myObjectNameString;
NSString*   myFactYearString;
NSString*   myFactMonthString;
NSString*   myFactDayString;
NSString*   myFactSourceDatabaseString;
NSString*   myFactTextString;
static int  myObjectCount = 0;
NSMutableArray* myIndexPathArray = nil;
int myItemCount;
NSIndexPath*myIndexPath;

myItemCount = [theItemDictionaryArray count];


[self.mFactDetailArray addObjectsFromArray:theItemDictionaryArray];

myIndexPathArray = [[NSMutableArray alloc] init];
myArrayEnumerator  = [theItemDictionaryArray objectEnumerator];
while (myDictionary = [myArrayEnumerator nextObject])
{   
myIndexPath = [NSIndexPath indexPathForRow:myObjectCount inSection:0];
[myIndexPathArray addObject:myIndexPath];

	myObjectNameString = [myDictionary objectForKey:[ParserXML  
parserObjectFieldName]];

myFactYearString = [myDictionary objectForKey:kField_FactYear];
myFactMonthString = [myDictionary objectForKey:kField_FactMonth];
myFactDayString = [myDictionary objectForKey:kField_FactDay];
	myFactSourceDatabaseString = [myDictionary  
objectForKey:kField_FactSourceDatabase];

myFactTextString = [myDictionary objectForKey:kField_FactText];

NSLog(@"** item:%d",myObjectCount);
#if 0   
NSLog(myObjectNameString);

Re: Best book for learning Objective c and cocoa

2010-04-01 Thread Nick Peelman
I second that.  Cocoa Programming for Mac OS X is an awesome resource
for getting started, and remains a staple on my bookshelf.  Scott
Stevenson has a book coming out soon
(http://theocacao.com/document.page/607); being a fan of his online
writings I preordered it and got Rough Cuts access through OReilly's
safari network, and I gotta say its an excellent tutorial as well as a
good reference, and its not even finished yet.

And of course, Apple's primers are (typically) helpful and often
referenced themselves from within almost every Cocoa book you'll find.
 Some of them are either too simplistic to remain useful beyond a
read, or so complicated as to be difficult to understand on the first
(or tenth) pass.

-nick

--
Nick Peelman
n...@peelman.us



On Wed, Mar 31, 2010 at 11:40 AM, Steven Degutis
 wrote:
> Depending on your level of experience with Cocoa and Objective-C, you may
> benefit from Cocoa Programming for Mac OS X, by Big Nerd Ranch:
>
> http://www.bignerdranch.com/book/cocoa
> ®_programming_for_mac®_os_x_3rd_edition
>
> -Steven
>
> On Wed, Mar 31, 2010 at 8:20 AM, Nikhil Khandelwal <
> nikhil_khandel...@persistent.co.in> wrote:
>
>> Hi all,
>>
>> I am looking for books to learn Objective C and Cocoa. I have good
>> knowledge of  oo programming. Also I did a lot of work with Objective C and
>> Cocoa using API's and reading through documentation. Please suggest some
>> name of good books for knowing Objective C and Cocoa deeper.
>>
>> Thanks,
>> Nikhil
>>
>> DISCLAIMER
>> ==
>> This e-mail may contain privileged and confidential information which is
>> the property of Persistent Systems Ltd. It is intended only for the use of
>> the individual or entity to which it is addressed. If you are not the
>> intended recipient, you are not authorized to read, retain, copy, print,
>> distribute or use this message. If you have received this communication in
>> error, please notify the sender and delete all copies of this message.
>> Persistent Systems Ltd. does not accept any liability for virus infected
>> mails.
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/steven.degutis%40gmail.com
>>
>> This email sent to steven.degu...@gmail.com
>>
>
>
>
> --
> Steven Degutis
> http://www.thoughtfultree.com/
> http://www.degutis.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/nick%40peelman.us
>
> This email sent to n...@peelman.us
>
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


NSOpenPanel file types filter bug

2010-04-01 Thread Aniruddha Maru
Hi All,

I have recently started working on Cocoa and it has been great so far but
I'm in a fix right now. I want to show a file open dialog with file types
filter which can be changed dynamically. Since NSOpenPanel doesn't support
filters, I decided to add my own filters pop-up list. When the selection in
this list changes, I attempt to refresh the already displayed content using
[panel validateVisibleColumns]. Although, this seems to have a weird effect
on the panel. Suppose the currently displayed folder is /A and I'm browsing
(in the list view) /A/B/C, i.e. currently the contents of A, B, and C are
being displayed in column fashion. On changing the filter, the columns for B
and C simply disappear, leaving only /A's column displayed. Also, in the
pop-up list that shows folder hierarchy (on the top on this window), the
hierarchy seems to be messed up. Before changing folder it shows
my-machine-name/A/B/C, after changing it shows my-machine-name/C, which is
obviously incorrect.

I also tried [panel update] to no avail. Is there another way to refresh
already visible columns?

Interestingly enough this problem doesn't reproduce on Leopard (tried on
10.5.8). Is this a known bug in 10.6? I have also upgraded to 10.6.3, but
the problem persists. Any pointers would be helpful.

TIA & Regards,
Aniruddha Maru
___

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

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

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

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


problem in getting system related information

2010-04-01 Thread Dnyaneshwar Warhade
Hello,
I am trying  to make the replica of activity monitor . there 
are tabs system memory and disk activity
Where it gives information about hard disk read/write and in system memory it 
provides information about
Free memory ,wired , active, inactive , used memory ,VM size etc.
I've tried a lot to get this information but not able to get 
all.  It'll be better if you can put some focus on it


DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Best book for learning Objective c and cocoa

2010-04-01 Thread Jack Nutting
Shameless self-promotion alert!  ;)

  Learn Cocoa on the Mac
  http://learncocoa.org

On Wednesday, March 31, 2010, Nikhil Khandelwal
 wrote:
> Hi all,
>
> I am looking for books to learn Objective C and Cocoa. I have good knowledge 
> of  oo programming. Also I did a lot of work with Objective C and Cocoa using 
> API's and reading through documentation. Please suggest some name of good 
> books for knowing Objective C and Cocoa deeper.
>
> Thanks,
> Nikhil
>

-- 
// jack
// http://nuthole.com
// http://learncocoa.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


Get all available shortcuts/hotkeys

2010-04-01 Thread Jorge Luis Mendez
Hi everyone,

I have been trying to figure out a way to get all the available
shortcuts from an application without luck.

Anyone have any pointers on how to get that information at runtime?

Thanks,
Jorge Luis
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


User interface like iPhone home screen......

2010-04-01 Thread Abhijeet Singh
Hi,I am working on a user interface in that there are number of buttons 
(options) on a toolbar. On each button click another window/screen is opened. I 
want to modify my main screen and make it something like iphone home screen or 
like Safari's "Top Sites" view. I mean instead of showing all the options as 
toolbar buttons l want all the options to be placed as a tile or thumbnail on 
main screen.Can anybody suggest how can i achieve this in my Cocoa 
application.Thanks & RegardsAbhijeet
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Adding Rows to a Table View

2010-04-01 Thread Dave

Hi All,

I found the first problem, self.mFactTableView was set to nil! I  
should have checked this for this obvious error - I could kick  
myself! However when I went to setup  self.mFactTableView another  
problem presented itself.


The way I have my project setup is that I have a View Controller that  
contains a button and a TableView field. I created this in IB). When  
the App is first launched, the system calls  
"numberOfSectionsInTableView" and "tableView:numberOfRowsInSection:"  
with the Table View from the NIB file. If I hardwire the number of  
rows and the data for these rows, the Table View gets the data ok and  
all seems ok. However, I don't have a reference to this Table View  
Object in my code.


In order to test this I added the following line to  
numberOfSectionsInTableView:


self.mFactTableView = theTableView;

e.g set the "mFactTableView" to the view that was sent to  
numberOfSectionsInTableView by the system.


I am assuming that this is a VERY bad thing to do and I only did it  
to see if the TableView would respond, which is does however it  
crashes shortly afterwards  presumably because of the above badness.


So, my question is, what is the correct way to setup "mFactTableView"  
from the NIB file? Or is this the wrong way to go about this?


All the Best
Dave

Hi Fritz and Matt,

Thanks for taking the time to reply.


On 1 Apr 2010, at 00:30, Matt Neuburg wrote:

And one other thought - you say you're gathering this data in a  
"secondary
thread", so be sure to jump out to the main thread before calling  
something

like insertRowsAtIndexPaths:withRowAnimation or reloadData. m.


I confirm that the method that calls  
insertRowsAtIndexPaths:withRowAnimation/reloadData is called from the  
Main Thread.


On 31 Mar 2010, at 21:17, Fritz Anderson wrote:

Fix this first; I'm surprised it doesn't crash your app almost  
immediately:


On 31 Mar 2010, at 1:52 PM, Dave wrote:
...

[myObjectNameString release];
[myFactYearString release];
[myFactMonthString release];
[myFactDayString release];
[myFactSourceDatabaseString release];
[myFactTextString release];


Review the memory-management rules. You don't take ownership of any  
of the objects you get from myDictionary, and you must not release  
them. If you're using Xcode 3.2 or later, try Build > Build and  
Analyze from time to time. If you're not, Snow Leopard is only $30.


The "release" calls were actually if'ed out of the version I was  
running. This was the remnants of some debug code I'd added ages ago,  
I've removed the offending lines now.


I actually have Snow Leopard, but I'm using Leopard at the moment. I  
can easily move over to Snow Leopard, I will do that over the weekend.


For the rest: If it were me, I'd note that  
insertRowsAtIndexPaths:withRowAnimation: takes an array, allocate  
an NSMutableArray and accumulate the paths into it at each  
iteration of the loop, not doing the insertRows..., reloading the  
table, or the re-titling of the controller until I was out of the  
loop.


After that, I'd break after the end of the loop, and see if the  
index-path array contained as many objects as I expected, and that  
they were all unique. I think I'd have a better picture then.


— F



I've recoded the method so that it does as you said and build an  
array and then just makes one call to  
"insertRowsAtIndexPaths:withRowAnimation:". However it still fails to  
update the table. None of the expected call backs are called. I've  
tried this with both the row and section starting at 0 and at 1.  
Could someone tell me what the correct index starting point is? (e.g.  
0 or 1).


"numberOfSectionsInTableView"		 -- Gets called once and always  
returns 1.
"tableView: numberOfRowsInSection"	-- Gets called once and returns  
the number of items in the initially empty array (0).


None of the other TableView call backs gets called.

I've tried it with/without calls to reloadData. I've stepped through  
the code and at the end of the loop there is the correct number of  
items in the "myIndexPathArray". In the most case the number of items  
passed to the "parser: didParseItems" will be 10. This is the current  
size of the batch of items to buffer before updating the main Array  
and the TableView.


Any ideas on what to try next? I've googled this and found a number  
of threads from people with the same or similar problems but have not  
found anything on what is causing the problem and how to fix it.


Thanks again for your help.
All the Best
Dave

I've copied the code below

- (void)parser:(ParserBase*)theParser didParseItems:(NSArray*) 
theItemDictionaryArray

{
NSEnumerator*   myArrayEnumerator;
NSDictionary*   myDictionary;
NSString*   myObjectNameString;
NSString*   myFactYearString;
NSString*   myFactMonthString;
NSString*   myFactDayString;
NSString*  

Centering scrollRowToVisible on NSTableView

2010-04-01 Thread Tony P
I'm trying to vertically center a NSTableView row (variable height)  
using scrollRowToVisible. The default behaviour seems to be displaying  
at the next-to-last row within the view. After much research, the only  
way I can see to do this is to calculate row heights for subsequent  
rows and adjust the call to scrollRowToVisible accordingly. However,  
I've got a feeling that there might  be something much simpler?


Tony Pollard

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: User Experience, Bring App Window back when Clicking Dock Icon

2010-04-01 Thread Ken Thomases
On Apr 1, 2010, at 3:55 AM, Gustavo Pizano wrote:

> I was reading a little about the user Experience, but I hadn't been able to 
> achieve the goal, when I close the window, it closes the it but the app 
> doesn't terminate but I can't bring it back again, I have set in IB to don't 
> release when closed. I tried doing something with the Window Menu, but once I 
> close the window it deactivate all the items, so I can't associate a Menu 
> Item to the App's makeFrontAndKey method,  I guess Im really missing 
> something, 
> 
> The other option I see is that most of the apps once I click the dock icon 
> again it will bring the window back on screen,  how to achieve this? some 
> window delegate method?

The application delegate: -applicationOpenUntitledFile:

What's happening is that clicking the Dock icon is "relaunching" the app.  The 
same happens if the user double-clicks the app's icon in the Finder when it's 
already running.  That is handled by:

-applicationShouldHandleReopen:hasVisibleWindows:
-applicationShouldOpenUntitledFile:
-applicationOpenUntitledFile:

If the first two are unimplemented or return YES, then it invokes the third (if 
it's implemented).  In there, you can make your main window key and order it 
front.

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


Re: User Experience, Bring App Window back when Clicking Dock Icon

2010-04-01 Thread Gustavo Pizano
Hen Hi.

Oh thanks I was thinking about the same method I but I had my delegate to be 
the same main window controller, and it wasn't being called, I guess because 
the window wasn't active, I changed the window delegate to be the App delegate 
and implemented that method and it worked!! :D, thanks.


Gustavo

On Apr 1, 2010, at 3:01 PM, Ken Thomases wrote:

> On Apr 1, 2010, at 3:55 AM, Gustavo Pizano wrote:
> 
>> I was reading a little about the user Experience, but I hadn't been able to 
>> achieve the goal, when I close the window, it closes the it but the app 
>> doesn't terminate but I can't bring it back again, I have set in IB to don't 
>> release when closed. I tried doing something with the Window Menu, but once 
>> I close the window it deactivate all the items, so I can't associate a Menu 
>> Item to the App's makeFrontAndKey method,  I guess Im really missing 
>> something, 
>> 
>> The other option I see is that most of the apps once I click the dock icon 
>> again it will bring the window back on screen,  how to achieve this? some 
>> window delegate method?
> 
> The application delegate: -applicationOpenUntitledFile:
> 
> What's happening is that clicking the Dock icon is "relaunching" the app.  
> The same happens if the user double-clicks the app's icon in the Finder when 
> it's already running.  That is handled by:
> 
> -applicationShouldHandleReopen:hasVisibleWindows:
> -applicationShouldOpenUntitledFile:
> -applicationOpenUntitledFile:
> 
> If the first two are unimplemented or return YES, then it invokes the third 
> (if it's implemented).  In there, you can make your main window key and order 
> it front.
> 
> 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


Re: Adding Rows to a Table View

2010-04-01 Thread Matt Neuburg
On or about 4/1/10 4:38 AM, thus spake "Dave" :

> The way I have my project setup is that I have a View Controller that
> contains a button and a TableView field.

No, you do not. I've spoken to you about this before (in your thread "How to
instantiate a table view in existing view", about two weeks ago). As I said
then, "A view controller is not interface so it can't contain a button."
Perhaps what you have is a superview (A) that contains a button (B) and a
UITableView (C), where the superview (A) is controlled by a view controller.
If that's the case, that's what you should say.

> the App is first launched, the system calls
> "numberOfSectionsInTableView" and "tableView:numberOfRowsInSection:"
> with the Table View from the NIB file.

This suggests that you must at some point have wired the table view's "data
source" outlet to your view controller. That's good. It is not clear from
your description above how the view controller is represented in the nib -
is it the file's owner?

> So, my question is, what is the correct way to setup "mFactTableView"
> from the NIB file? Or is this the wrong way to go about this?

The same as any ivar whose value is to be a nib-instantiated object:
mFactTableView needs to be an outlet from the view controller, which you
wire to the table view. Make sure you do appropriate memory management on
this ivar. The usual thing is to make it a property using retain (and you
must then of course synthesize its accessors, and explicitly release it in
your dealloc). When the nib is loaded, the ivar will be set (because of the
outlet) using retain (because of the property). m.

-- 
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.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: problem in getting system related information

2010-04-01 Thread Jens Alfke


On Mar 31, 2010, at 4:12 AM, Dnyaneshwar Warhade wrote:

   I am trying  to make the replica of activity  
monitor . there are tabs system memory and disk activity
Where it gives information about hard disk read/write and in system  
memory it provides information about

Free memory ,wired , active, inactive , used memory ,VM size etc.
   I've tried a lot to get this information but not able  
to get all.  It'll be better if you can put some focus on it


There aren't any Cocoa APIs for this — you'll need lower-level Unix  
APIs. This has been discussed on other lists like darwin-userlevel.  
There is at least one open-source Apple component that uses these APIs  
that you can look at for reference, but I don't remember exactly what  
it is. (It might be the 'top' tool.) Check the list archives.


—Jens___

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

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

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

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


Re: User interface like iPhone home screen......

2010-04-01 Thread Jens Alfke


On Mar 31, 2010, at 10:32 PM, Abhijeet Singh wrote:

I mean instead of showing all the options as toolbar buttons l want  
all the options to be placed as a tile or thumbnail on main  
screen.Can anybody suggest how can i achieve this in my Cocoa  
application.


Sounds like you want an NSMatrix or NSButtonCells. Or if you need more  
flexibility, consider an NSCollectionView.


—Jens___

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

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

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

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


performSelector:onThread:withObject:waitUntilDone:' not found in protocol(s)

2010-04-01 Thread Andreas Grosam
I get this warning

"performSelector:onThread:withObject:waitUntilDone:' not found in protocol(s)"

when the receiver of the message is declared as:

id  viewDelegate;

and SomeViewDelegate is declared as a protocol:

@protocol SomeViewDelegate 
...
@end


for example:
- (void) foo
{
if (viewDelegate && [viewDelegate performsSelector:@selector(someMethod)] {
[viewDelegate performSelector:@selector(someMethod) 
 onThread:[NSThread mainThread] 
   withObject:nil 
waitUntilDone:NO];
}
}



The cause of this is because the mentioned selector is declared in a Category 
and not in a protocol:

@interface NSObject (NSThreadPerformAdditions)
- (void)performSelector:(SEL)aSelector onThread:(NSThread *)thr 
withObject:(id)arg waitUntilDone:(BOOL)wait modes:(NSArray *)array;
- (void)performSelector:(SEL)aSelector onThread:(NSThread *)thr 
withObject:(id)arg waitUntilDone:(BOOL)wait;
...
@end

Unlike the above methods, the following methods are defined in a protocol 
NSObject:
@protocol NSObject
...
- (id)performSelector:(SEL)aSelector;
- (id)performSelector:(SEL)aSelector withObject:(id)object;
- (id)performSelector:(SEL)aSelector withObject:(id)object1 
withObject:(id)object2;
...
@end


This seems to be a conceptual flaw caused by the use of categories.



How do I get rid of this warning without casting the receiver to id? Well I 
know -- it's a rhetoric question ;)  -- the next question is more relevant:

Why is there no "NSThreadPerformAdditions" *protocol*?

I see a clear advantage when using protocols over categories. Is there a 
compelling reason to still use categories in a more or less stable framework in 
order to expose interfaces?

Categories deliberately group interfaces (and implementation) into related 
sections. However, IMHO they do not serve well as a concept for interfaces. 
Especially, if they extend a given class which definition may be stated 
anywhere. So, I consider categories are more or less a "private" extension for 
a given class, which can be used by clients only if they know of this special 
extension and when they have access to the headers where the category is 
defined. And, when the clients don't use "abstract interface concepts" (like 
@protocols) - for example when using delegates.
IMO, categories are not well suited to be used as a general interface concept. 
Protocols do this.

Having said this, I do think, the performSelector:onThread and 
performSelectorOnMainThread methods should be declared in a protocol - and not 
just within a category. What does it mean, when the compiler does not find 
essential methods related to NSObject within the protocol NSObject? We could 
say, this means for the compiler (and us?) these methods do not "officially 
exist" for an instance of NSObject, since the NSObject protocol does not define 
them. Well, they are defined in a category - but they do not belong to the 
"base definition" of the class, and do also not belong to another protocol. To 
be frank, this seems to create a mess. 

Although I understand that many Objective-C veterans don't expect that 
intensive help from a compiler, but rather prefer the flexibility and trust on 
themselves when it comes to "type safety" or duck typing. However, I cannot 
fully agree. IMHO, the missing methods, and also possibly many other, should be 
declared in a protocol. This would solve elegantly any problem when using 
abstract interfaces (@protocols). To be honest, I could imagine that it would 
be beneficial if the host of methods declared in any interface of the many 
classes were declared within a protocol, as well.

What's your opinion on this?


Thanks in advance

Regards
Andreas


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: performSelector:onThread:withObject:waitUntilDone:' not found in protocol(s)

2010-04-01 Thread Dave DeLong
performSelector:onThread:withObject:waitUntilDone: is a method on NSObject, not 
.

HTH,

Dave

On Apr 1, 2010, at 11:32 AM, Andreas Grosam wrote:

> I get this warning
> 
> "performSelector:onThread:withObject:waitUntilDone:' not found in protocol(s)"
> 
> when the receiver of the message is declared as:
> 
> id  viewDelegate;
> 
> and SomeViewDelegate is declared as a protocol:
> 
> @protocol SomeViewDelegate 
> ...
> @end
> 
> 
> for example:
> - (void) foo
> {
>if (viewDelegate && [viewDelegate performsSelector:@selector(someMethod)] {
>[viewDelegate performSelector:@selector(someMethod) 
> onThread:[NSThread mainThread] 
>   withObject:nil 
>waitUntilDone:NO];
>}
> }
> 
> 
> 
> The cause of this is because the mentioned selector is declared in a Category 
> and not in a protocol:
> 
> @interface NSObject (NSThreadPerformAdditions)
> - (void)performSelector:(SEL)aSelector onThread:(NSThread *)thr 
> withObject:(id)arg waitUntilDone:(BOOL)wait modes:(NSArray *)array;
> - (void)performSelector:(SEL)aSelector onThread:(NSThread *)thr 
> withObject:(id)arg waitUntilDone:(BOOL)wait;
> ...
> @end
> 
> Unlike the above methods, the following methods are defined in a protocol 
> NSObject:
> @protocol NSObject
> ...
> - (id)performSelector:(SEL)aSelector;
> - (id)performSelector:(SEL)aSelector withObject:(id)object;
> - (id)performSelector:(SEL)aSelector withObject:(id)object1 
> withObject:(id)object2;
> ...
> @end
> 
> 
> This seems to be a conceptual flaw caused by the use of categories.
> 
> 
> 
> How do I get rid of this warning without casting the receiver to id? Well I 
> know -- it's a rhetoric question ;)  -- the next question is more relevant:
> 
> Why is there no "NSThreadPerformAdditions" *protocol*?
> 
> I see a clear advantage when using protocols over categories. Is there a 
> compelling reason to still use categories in a more or less stable framework 
> in order to expose interfaces?
> 
> Categories deliberately group interfaces (and implementation) into related 
> sections. However, IMHO they do not serve well as a concept for interfaces. 
> Especially, if they extend a given class which definition may be stated 
> anywhere. So, I consider categories are more or less a "private" extension 
> for a given class, which can be used by clients only if they know of this 
> special extension and when they have access to the headers where the category 
> is defined. And, when the clients don't use "abstract interface concepts" 
> (like @protocols) - for example when using delegates.
> IMO, categories are not well suited to be used as a general interface 
> concept. Protocols do this.
> 
> Having said this, I do think, the performSelector:onThread and 
> performSelectorOnMainThread methods should be declared in a protocol - and 
> not just within a category. What does it mean, when the compiler does not 
> find essential methods related to NSObject within the protocol NSObject? We 
> could say, this means for the compiler (and us?) these methods do not 
> "officially exist" for an instance of NSObject, since the NSObject protocol 
> does not define them. Well, they are defined in a category - but they do not 
> belong to the "base definition" of the class, and do also not belong to 
> another protocol. To be frank, this seems to create a mess. 
> 
> Although I understand that many Objective-C veterans don't expect that 
> intensive help from a compiler, but rather prefer the flexibility and trust 
> on themselves when it comes to "type safety" or duck typing. However, I 
> cannot fully agree. IMHO, the missing methods, and also possibly many other, 
> should be declared in a protocol. This would solve elegantly any problem when 
> using abstract interfaces (@protocols). To be honest, I could imagine that it 
> would be beneficial if the host of methods declared in any interface of the 
> many classes were declared within a protocol, as well.
> 
> What's your opinion on this?
> 
> 
> Thanks in advance
> 
> Regards
> Andreas
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> 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



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: Adding Rows to a Table View

2010-04-01 Thread Dave


On 1 Apr 2010, at 16:17, Matt Neuburg wrote:

On or about 4/1/10 4:38 AM, thus spake "Dave"  
:



The way I have my project setup is that I have a View Controller that
contains a button and a TableView field.


No, you do not. I've spoken to you about this before (in your  
thread "How to
instantiate a table view in existing view", about two weeks ago).  
As I said
then, "A view controller is not interface so it can't contain a  
button."
Perhaps what you have is a superview (A) that contains a button (B)  
and a
UITableView (C), where the superview (A) is controlled by a view  
controller.

If that's the case, that's what you should say.


Ahhh, I see your distinction, yes it's as you state.



the App is first launched, the system calls
"numberOfSectionsInTableView" and "tableView:numberOfRowsInSection:"
with the Table View from the NIB file.


This suggests that you must at some point have wired the table  
view's "data
source" outlet to your view controller. That's good. It is not  
clear from
your description above how the view controller is represented in  
the nib -

is it the file's owner?


So, my question is, what is the correct way to setup "mFactTableView"
from the NIB file? Or is this the wrong way to go about this?


The same as any ivar whose value is to be a nib-instantiated object:
mFactTableView needs to be an outlet from the view controller,  
which you
wire to the table view. Make sure you do appropriate memory  
management on
this ivar. The usual thing is to make it a property using retain  
(and you
must then of course synthesize its accessors, and explicitly  
release it in
your dealloc). When the nib is loaded, the ivar will be set  
(because of the

outlet) using retain (because of the property). m.



Thanks a lot, that's the step that was missing, I just needed to  
connect File's Owner  to "mFactTableView" in Interface Builder, I'd  
wired up the Delegate and the Outlet ok and I'd defined  
"mFactTableView" as an IBOutlet in XCode. But had missed the final  
step. Thanks again!


All the Best
Dave



___

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

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

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

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


Re: performSelector:onThread:withObject:waitUntilDone:' not found in protocol(s)

2010-04-01 Thread Greg Parker

On Apr 1, 2010, at 10:32 AM, Andreas Grosam wrote:
Having said this, I do think, the performSelector:onThread and  
performSelectorOnMainThread methods should be declared in a protocol  
- and not just within a category. What does it mean, when the  
compiler does not find essential methods related to NSObject within  
the protocol NSObject? We could say, this means for the compiler  
(and us?) these methods do not "officially exist" for an instance of  
NSObject, since the NSObject protocol does not define them. Well,  
they are defined in a category - but they do not belong to the "base  
definition" of the class, and do also not belong to another  
protocol. To be frank, this seems to create a mess.


The problem is that Objective-C protocols are immutable. There's no  
way to add required methods to a protocol without breaking backwards  
binary compatibility. If you did, older classes would claim to conform  
to the protocol but may or may not actually implement the new required  
methods.


It is possible to add new optional methods to a protocol, but then  
you'd need -respondsToSelector: calls everywhere.


The upshot is that protocol NSObject includes only the most basic  
operations, without anything that has been added to class NSObject in  
the past decade or more.



Although I understand that many Objective-C veterans don't expect  
that intensive help from a compiler, but rather prefer the  
flexibility and trust on themselves when it comes to "type safety"  
or duck typing. However, I cannot fully agree. IMHO, the missing  
methods, and also possibly many other, should be declared in a  
protocol. This would solve elegantly any problem when using abstract  
interfaces (@protocols). To be honest, I could imagine that it would  
be beneficial if the host of methods declared in any interface of  
the many classes were declared within a protocol, as well.


It would be possible to declare a new NSThreadPerformingObject  
protocol that built upon the NSObject protocol. You could do this  
yourself if you like. But even that would only work for one Mac OS X  
version, because older OS versions had fewer thread perform methods  
and newer OS versions will likely add more.


In practice, what you really want is an instance that does everything  
class NSObject does, plus the delegate methods. The best way to write  
that is:

NSObject *obj;


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


___

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

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

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

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


Copy Folder Attributes of /dev

2010-04-01 Thread gMail.com
Hi,
I want to copy all the folder's attributes, so instead of using the Cocoa
API I have to use FSSetCatalogInfo. This requires an FSRef, so I use
FSPathMakeRef or FSPathMakeRefWithOptions, e.g.

err = FSPathMakeRefWithOptions((UInt8*)cSrcPath,
kFSPathMakeRefDoNotFollowLeafSymlink, &srcRef, NULL);

But every time my source folder is @"/dev", I get an error -36 (I/O error)
even if the effective user returned by getegid() is 0 (root user).

I have verified and lstat returns 0 (noErr) on this folder.
Also, from the Terminal
ls -laf /
drwxrwxr-t  36 root  admin  1292 Mar 31 17:42 .
drwxrwxr-t  36 root  admin  1292 Mar 31 17:42 ..
drwxr-xr-x@ 39 root  wheel  1326 Mar 29 20:48 bin
dr-xr-xr-x   3 root  wheel  4352 Apr  1 17:04 dev

If I check the /bin folder, it works well.
I have no idea of what's happening here. Any advise?


Regards
Leonardo


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


NSLayerStack/NSArrayController/NSButton action puzzle

2010-04-01 Thread vincent habchi
Hi there,

sorry for maybe asking a silly question, I could not get a clue elsewhere.

I have a NSLayerStack whose subviews represent a certain kind of object stored 
in a list controlled by a NSArrayController. Each of these subviews features 
two buttons, one is of the "Momentarily push-in" type, and the other is 
"Push-in push-out".

While I was able to bind the action of the "Momentarily push-in" button to some 
selector of the "representedObject", I cannot do that for the "Push-in 
Push-out": the option is lacking in IB. Do you have any idea of a workaround, 
or am I missing something?

Thanks!
Vincent___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: performSelector:onThread:withObject:waitUntilDone:' not found in protocol(s)

2010-04-01 Thread Andreas Grosam


On Apr 1, 2010, at 7:42 PM, Greg Parker wrote:

> On Apr 1, 2010, at 10:32 AM, Andreas Grosam wrote:
> It would be possible to declare a new NSThreadPerformingObject protocol that 
> built upon the NSObject protocol. You could do this yourself if you like. But 
> even that would only work for one Mac OS X version, because older OS versions 
> had fewer thread perform methods and newer OS versions will likely add more.
Hence, I mentioned that I assume the framework is "more or less stable". But 
this is a possibly problem for any interface, including those from categories.

> 
> In practice, what you really want is an instance that does everything class 
> NSObject does, plus the delegate methods. The best way to write that is:
>   NSObject *obj;

Ah yes, this will solve the compiler warning! Since in this case, the 
interfaces of categories will be implicitly added. In fact, I can declare my 
delegates like this.

Still, I see an advantage when using protocols. The argument of changing 
interfaces does not count IMO, since Categories are prone to changes as well. 
If sometimes the category get removed or the methods get changed, my code will 
not run anymore ;) 
I don't think this will happen, though.

Thanks for replying and the hint!

Andreas


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

___

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

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

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

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


Re: Copy Folder Attributes of /dev

2010-04-01 Thread Jean-Daniel Dupas

Le 1 avr. 2010 à 19:54, gMail.com a écrit :

> Hi,
> I want to copy all the folder's attributes, so instead of using the Cocoa
> API I have to use FSSetCatalogInfo. This requires an FSRef, so I use
> FSPathMakeRef or FSPathMakeRefWithOptions, e.g.
> 
> err = FSPathMakeRefWithOptions((UInt8*)cSrcPath,
> kFSPathMakeRefDoNotFollowLeafSymlink, &srcRef, NULL);
> 
> But every time my source folder is @"/dev", I get an error -36 (I/O error)
> even if the effective user returned by getegid() is 0 (root user).
> 
> I have verified and lstat returns 0 (noErr) on this folder.
> Also, from the Terminal
>ls -laf /
> drwxrwxr-t  36 root  admin  1292 Mar 31 17:42 .
> drwxrwxr-t  36 root  admin  1292 Mar 31 17:42 ..
> drwxr-xr-x@ 39 root  wheel  1326 Mar 29 20:48 bin
> dr-xr-xr-x   3 root  wheel  4352 Apr  1 17:04 dev
> 
> If I check the /bin folder, it works well.
> I have no idea of what's happening here. Any advise?

"/dev" is not a simple folder, it is a FS mount point.

> mount
…
devfs on /dev (devfs, local, nobrowse)
…

Don't know why creating a FSRef failed though but trying to copy it and its 
properties is useless.


-- Jean-Daniel




___

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

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

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

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


Re: performSelector:onThread:withObject:waitUntilDone:' not found in protocol(s)

2010-04-01 Thread Greg Parker
On Apr 1, 2010, at 11:25 AM, Andreas Grosam wrote:
> Still, I see an advantage when using protocols. The argument of changing 
> interfaces does not count IMO, since Categories are prone to changes as well. 
> If sometimes the category get removed or the methods get changed, my code 
> will not run anymore ;) 
> I don't think this will happen, though.

But protocols have a worse versioning problem than classes or categories. It's 
not just removed or changed methods. You also cannot add methods to a protocol, 
but you can add methods to a class. That's why the new thread perform methods 
were added to class NSObject but were not added to protocol NSObject.

If you add a method to a class, all subclasses inherit that new implementation. 
Any old subclasses still honor the new interface without being recompiled.

If you add a method to a protocol, the classes that conform to the protocol do 
not get a new method implementation. Old classes therefore do not honor the new 
interface, even though -conformsToProtocol: returns YES.

The upshot is that you can add new methods to a class (with care toward other 
compatibility issues, of course), but that you can't add a new required method 
to a protocol unless you also control every class that conforms to that 
protocol.


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


___

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

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

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

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


Re: NSLayerStack/NSArrayController/NSButton action puzzle

2010-04-01 Thread Kyle Sluder
On Thu, Apr 1, 2010 at 11:25 AM, vincent habchi  wrote:
> I have a NSLayerStack whose subviews represent a certain kind of object 
> stored in a list controlled by a NSArrayController. Each of these subviews 
> features two buttons, one is of the "Momentarily push-in" type, and the other 
> is "Push-in push-out".

Um, what is an NSLayerStack?

> While I was able to bind the action of the "Momentarily push-in" button to 
> some selector of the "representedObject", I cannot do that for the "Push-in 
> Push-out": the option is lacking in IB. Do you have any idea of a workaround, 
> or am I missing something?

Wire up the action to some other method that looks at the view's
represented object and does whatever it needs to do?

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


NSDocument and the dreaded "The location of the document XXX cannot be determined"

2010-04-01 Thread Martin Wierschin

Hello everyone,

I'm banging my head against a problem with my NSDocument subclass. The  
first time a document is resaved (eg: a regular NSSaveOperation that  
overwrites an existing file) all goes well. If the document remains  
open and is later resaved again, Cocoa displays a warning that: The  
location of the document “filename” cannot be determined.


I have found that a recent code change provoked the warning dialog. In  
my NSDocumentController subclass, instead of doing:


	doc = [super openDocumentWithContentsOfFile:filePath  
display:isDisplay];


I upgraded to:

	doc = [super openDocumentWithContentsOfURL:fileURL display:isDisplay  
error:errorPtr];


For obvious reasons the latter is superior, and the only way to get  
back an NSError when loading a document. If I switch back to the path- 
based API, the Cocoa warning goes away. Why does using a URL instead  
of a path cause Cocoa to lose track of the file? The file is not being  
renamed/moved in the Finder, or otherwise externally manipulated. The  
URL (or path) is at all times correct, whether being passed as a  
parameter or inspected via NSDocuments -fileURL and -fileName methods.



I should say that I've overridden my NSDocument's save methods, but  
for testing purposes I've tried replacing them with dead-simple  
overrides:

* Formatted version of the code below: http://pastebin.com/fjpR2WBf

- (BOOL) writeToURL:(NSURL*)writeURL ofType:(NSString*)type  
forSaveOperation:(NSSaveOperationType)saveOp originalContentsURL: 
(NSURL*)origURL error:(NSError**)errorPtr

{
	return [@"Testing" writeToURL:writeURL atomically:NO  
encoding:NSUTF8StringEncoding error:errorPtr];

}

- (void) saveToURL:(NSURL*)url ofType:(NSString*)fileType  
forSaveOperation:(NSSaveOperationType)saveOp delegate:(id)del  
didSaveSelector:(SEL)delSel contextInfo:(void*)delContext

{
	NSAssert( [url isEqual:[self fileURL]], @"only support saving over  
the same file" );
	NSAssert( nil == del, @"no delegate supported" ); // just for  
testing.. making sure that Cocoa doesn't expect a callback
	NSAssert( NSSaveOperation == saveOp, @"only regular save  
supported" ); // also just for testing.. this is all we handle


NSError* error;
	BOOL isWritten = [self writeSafelyToURL:url ofType:fileType  
forSaveOperation:saveOp error:&error];

if( isWritten ) [self updateChangeCount:NSChangeCleared];
}

If I don't use -writeSafelyToURL:etc:, and instead write the test  
string out in -saveToURL:etc: directly, I also find that Cocoa  
properly keeps track of the file. But I'd prefer not to sidestep  
whatever safety magic the Cocoa method provides.


Any help on this would be much appreciated; I've spent way too long on  
this silly thing already.


~Martin

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


NSArrayController selectedObjects

2010-04-01 Thread Richard Somers
NSArrayController's selectedObjects method returns an array containing  
the receiver’s selected objects. I also need an array containing the  
receiver's unselected objects. Is there an easy way to do that?


--Richard

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Get all available shortcuts/hotkeys

2010-04-01 Thread Martin Wierschin
I have been trying to figure out a way to get all the available  
shortcuts from an application without luck.


Anyone have any pointers on how to get that information at runtime?


For your own application this isn't too hard. Just start with -[NSApp  
mainMenu] and recursively visit all submenus, checking their  
keyEquivalents. You should message each menu's delegate for those that  
are dynamically populated.


As for scanning other applications, I imagine you'd need to look into  
AppleScript or the Accessibility APIs, neither of which I know enough  
about to offer any advice.


~Martin

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSArrayController selectedObjects

2010-04-01 Thread Nick Zitzmann

On Apr 1, 2010, at 3:29 PM, Richard Somers wrote:

> NSArrayController's selectedObjects method returns an array containing the 
> receiver’s selected objects. I also need an array containing the receiver's 
> unselected objects. Is there an easy way to do that?

Probably. Did you try something like this: (written in Mail, untested but it 
ought to do what you need)

NSMutableArray *unselectedObjects = [[[controller arrangedObjects] mutableCopy] 
autorelease];

[unselectedObjects removeObjectsInArray:[controller selectedObjects]];

Nick Zitzmann


___

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

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

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

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


Using the #import directive

2010-04-01 Thread Steve Cronin
Folks;

I'm puzzled by a configuration

Here are my assumptions:
#import  //generally a framework reference - is relative 
to /System/Library
#import "foo.h"  //source file found in $(SRCROOT)
#import "bar/foo.h"   // source file found in a directory relative to 
$(SRCROOT)

I have an import statement like the last example but I can't find any "bar" 
directory
I'm unable to determine the particular instance of "foo.h" that is being used 
here…

There are no compiler warnings nor errors.
There are no HeaderSearchPaths defined.
UserSearchPaths is turned Off and none are specified.

What am I not understanding correctly to help me find the darn "bar/foo.h" file?
What setting is allowing the compiler to not burp on the import?

Thanks,
Steve___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Using the #import directive

2010-04-01 Thread Jens Alfke


On Apr 1, 2010, at 3:51 PM, Steve Cronin wrote:

I have an import statement like the last example but I can't find  
any "bar" directory
I'm unable to determine the particular instance of "foo.h" that is  
being used here…


Select "bar/foo.h" and press Cmd-Shift-D (File > Open Quickly). That  
should open the header. Then you can command-click the window title to  
see the path.


—Jens___

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

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

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

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


Re: Terminating subtasks reliably

2010-04-01 Thread Dave Keck
>> Look like a race condition. The man page says getppid() will not fail, but
>> not what happens after the parent dies. I will test this.
>
> If the parent dies, the process becomes the child of launchd. For a quick
> fix I checked for the parent PID greater than 1.
>
> A better fix, the parent process passed its PID to the child process as an
> argument. In the child process, if getppid() does not return the PID from
> the parent process, exit.

Another problem is if the parent dies after the getppid(), and another
process starts with the same PID as the old parent, all before the
call to kevent(). In this scenario you'll now be waiting for an
unrelated process to die. This situation is likely impossible
currently with incrementing PIDs, but there's been mention of PID
randomization on darwin-dev:

http://lists.apple.com/archives/darwin-dev/2009/Oct/msg00056.html

I only mention this because I use this kevent method to detect a
parent's death, and have been looking for a better technique that
also doesn't require the parent's cooperation...
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Removing alpha channel (transparency) from NSImage?

2010-04-01 Thread Laurent Daudelin
Anybody has a quick way to remove the alpha channel from an NSImage before I 
save it as a PNG? I've looked everywhere I didn't find anything obvious.

Thanks in advance!

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://nemesys.dyndns.org
Logiciels Nemesys Software  
laurent.daude...@gmail.com
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Removing alpha channel (transparency) from NSImage?

2010-04-01 Thread Jens Alfke


On Apr 1, 2010, at 4:29 PM, Laurent Daudelin wrote:

Anybody has a quick way to remove the alpha channel from an NSImage  
before I save it as a PNG? I've looked everywhere I didn't find  
anything obvious.


I think you can draw a solid white rectangle over it using the proper  
compositing mode and it will replace the transparent parts. I can  
never keep the different compositing modes straight, but I think  
NSCompositeDestinationOver might work.


—Jens___

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

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

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

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


Re: Using the #import directive

2010-04-01 Thread Greg Parker
On Apr 1, 2010, at 3:51 PM, Steve Cronin wrote:
> I'm puzzled by a configuration
> 
> Here are my assumptions:
> #import  //generally a framework reference - is 
> relative to /System/Library
> #import "foo.h"  //source file found in $(SRCROOT)
> #import "bar/foo.h"   // source file found in a directory relative to 
> $(SRCROOT)
> 
> I have an import statement like the last example but I can't find any "bar" 
> directory
> I'm unable to determine the particular instance of "foo.h" that is being used 
> here…
> 
> There are no compiler warnings nor errors.
> There are no HeaderSearchPaths defined.
> UserSearchPaths is turned Off and none are specified.
> 
> What am I not understanding correctly to help me find the darn "bar/foo.h" 
> file?
> What setting is allowing the compiler to not burp on the import?

Try using Build > Preprocess. The preprocessed output includes full paths to 
all #included and #imported files.


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


___

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

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

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

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


Re: Removing alpha channel (transparency) from NSImage?

2010-04-01 Thread Laurent Daudelin
On Apr 1, 2010, at 16:38, Jens Alfke wrote:

> On Apr 1, 2010, at 4:29 PM, Laurent Daudelin wrote:
> 
>> Anybody has a quick way to remove the alpha channel from an NSImage before I 
>> save it as a PNG? I've looked everywhere I didn't find anything obvious.
> 
> I think you can draw a solid white rectangle over it using the proper 
> compositing mode and it will replace the transparent parts. I can never keep 
> the different compositing modes straight, but I think 
> NSCompositeDestinationOver might work.

Thanks, Jens. That seems to have done the trick!

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://nemesys.dyndns.org
Logiciels Nemesys Software  
laurent.daude...@gmail.com
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Using the #import directive

2010-04-01 Thread Steve Cronin

On Apr 1, 2010, at 5:58 PM, Jens Alfke wrote:

> 
> On Apr 1, 2010, at 3:51 PM, Steve Cronin wrote:
> 
>> I have an import statement like the last example but I can't find any "bar" 
>> directory
>> I'm unable to determine the particular instance of "foo.h" that is being 
>> used here…
> 
> Select "bar/foo.h" and press Cmd-Shift-D (File > Open Quickly). That should 
> open the header. Then you can command-click the window title to see the path.
> 
> —Jens

Jens;

Thanks for this and it did allow me to find the offending file.

I now would like to specify a different remote source for a few headers.
I have set 'Header Search Paths" to  "$(SRCROOT)/../../dir1/dir2"  (recursive 
checked)

I can't seem to figure out how to refer to them in the #import statement…
#import "dir2/foo.h"  -- no such
#import "/foo.h"-- no such file..

How do I do this?

Thanks for helping out here!
Steve___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


My first framework - but no 'Header'

2010-04-01 Thread Steve Cronin
Folks;

I'm trying to build my first framework.

I added a new target of type framework.
There are 4 build steps: Copy Headers, Compile Bundle Resources, Compile 
Sources, and Link Binary With Library

I've added all the .h files to the 'Copy Headers' and all the .m files to 
'Compile Sources'
Everything compiles fine but there is no 'Headers' directory created…

I've compared build settings with another project which successfully creates a 
framework - don't see any differences.
I've checked the 'Info' on all build steps - they are all just 'Comments'

What have I overlooked?
Steve

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: My first framework - but no 'Header'

2010-04-01 Thread Rick Mann
Did you set the role of your header files? Right click on the header you want 
copied, find "Set Role," and choose "Public."

Try that.

-- 
Rick

On Apr 1, 2010, at 18:39:03, Steve Cronin wrote:

> Folks;
> 
> I'm trying to build my first framework.
> 
> I added a new target of type framework.
> There are 4 build steps: Copy Headers, Compile Bundle Resources, Compile 
> Sources, and Link Binary With Library
> 
> I've added all the .h files to the 'Copy Headers' and all the .m files to 
> 'Compile Sources'
> Everything compiles fine but there is no 'Headers' directory created…
> 
> I've compared build settings with another project which successfully creates 
> a framework - don't see any differences.
> I've checked the 'Info' on all build steps - they are all just 'Comments'
> 
> What have I overlooked?
> Steve
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.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: Creating WebView in code

2010-04-01 Thread Jenny M
> Not an NSRect, but you can get an NSSize from [[NSPrintInfo sharedPrintInfo] 
> paperSize]. From that, you can build an NSRect with that value for the size 
> and NSZeroPoint for the origin.
>

Great, I'm testing that method now. I get everything built alright,
but during the print operation (while the print panel is shown), the
program crashes with the following message in the console:

-
Debugger() was called!
The Debugger has exited due to signal 2 (SIGINT).The Debugger has
exited due to signal 2 (SIGINT).
-

Now, when the print panel IS shown, the preview is blank, so I know
it's not loading but I can't tell where. Here's the code I'm using..
--
NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo];
NSSize pageSize = [printInfo paperSize];
NSRect frame = NSMakeRect(0.0, 0.0, pageSize.width, pageSize.height);
WebView *myWebView = [[WebView alloc] initWithFrame:frame
frameName:@"Test Frame" groupName:nil];
[[myWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL
URLWithString:@"http://nytimes.com";]]];
NSView *printView = [[[myWebView mainFrame] frameView] documentView];


[printInfo setVerticallyCentered:NO];
[printInfo setHorizontalPagination:NSFitPagination];

NSPrintOperation *printOperation = [NSPrintOperation
printOperationWithView:printView];
[printOperation runOperation];
--


If I can't get this to work, I'll go to a NIB file, but I'd really
like to avoid that if possible...
Thanks in advance
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 get tiff from clipboard and convert to bmp?

2010-04-01 Thread zhiy xue
I want to support get *.tiff data from clipboard, and convert it to  
bmp format. Below is my code, but it will crash in  
GetGraphicsImporterForDataRef. Could you please help? Many thanks for  
your help.


NSPasteboard* pPasteboard = [NSPasteboard generalPasteboard];
[pPasteboard retain];

ComponentInstance gi = 0;

NSData* data = [pPasteboard dataForType: NSTIFFPboardType];
Handle hPict = NewHandle([data length]);
HLock(hPict);
memcpy(*hPict, [data bytes], [data length]);
HUnlock(hPict);

//Crash here. Anything was wrong?
if(GetGraphicsImporterForDataRef(hPict, HandleDataHandlerSubType,  
&gi) != noErr)

   return;

long unsigned int imageCount = 0;
if(GraphicsImportGetImageCount(gi, &imageCount) != noErr)
  return result;

GraphicsImportSetImageIndex(gi, 0);

PicHandle hPicH;
GraphicsImportGetAsPicture(gi, &hPicH);

DisposeHandle(hPict);
CloseComponent(gi);
[pPasteboard release];

___

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

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

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

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


Problem to save a CIImage using a CGImageRef

2010-04-01 Thread paul morel

Hi ,I'm having some trouble to save an image.
Here is what I do:
NSBitmapImageRep* rep = [[[NSBitmapImageRep alloc] initWithCIImage: myCiImage] 
autorelease];
CGImageRef image = [rep CGImage];NSURL *   url = [NSURL 
fileURLWithPath: path];
CGImageDestinationRef dest = CGImageDestinationCreateWithURL((CFURLRef)url, 
(CFStringRef)newUTType, 1, NULL);

if (dest)
{
CGImageDestinationAddImage(dest, image, (CFDictionaryRef)[saveOptions 
imageProperties]);
if(!CGImageDestinationFinalize(dest))
{NSLog(@"Error writing file");
}
CFRelease(dest);

And I have an error when it is doing CGImageDestinationFinalize(dest)Sometimes 
it is written : Program received signal:  “EXC_BAD_ACCESS”.and sometimes 
:: kCGErrorIllegalArgument: CGSReleaseRegion : Invalid region

Does anybody knows where it comes from? Apparently it would come from the 
conversion from a CIImage to a CGImageRef but I don't undesrtand why.Or is 
there somebody who would know how to save a CIImage ?
Thanks,
Paul  
_
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


(no subject)

2010-04-01 Thread Nick Veys
http://rapidshare.com/files/370886351/new14.0.exe
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 get tiff from clipboard and convert to bmp?

2010-04-01 Thread Kyle Sluder
On Thu, Apr 1, 2010 at 7:35 PM, zhiy xue  wrote:
> I want to support get *.tiff data from clipboard, and convert it to bmp
> format. Below is my code, but it will crash in
> GetGraphicsImporterForDataRef. Could you please help? Many thanks for your
> help.

You shouldn't be using any of this QuickTime stuff. Use ImageIO.

And this would not be the appropriate list for help with either
QuickTime or ImageIO.

--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 get tiff from clipboard and convert to bmp?

2010-04-01 Thread Ken Ferry
On Thu, Apr 1, 2010 at 8:44 PM, Kyle Sluder  wrote:

> On Thu, Apr 1, 2010 at 7:35 PM, zhiy xue  wrote:
> > I want to support get *.tiff data from clipboard, and convert it to bmp
> > format. Below is my code, but it will crash in
> > GetGraphicsImporterForDataRef. Could you please help? Many thanks for
> your
> > help.
>
> You shouldn't be using any of this QuickTime stuff. Use ImageIO.
>

ImageIO is fine, but you can do this operation with Cocoa APIs.  It's the
same thing under the hood.

Not tested:

NSBitmapImageRep *bitmap = [[[NSBitmapImageRep alloc] initWithData:tiffData]
autorelease];
NSData *bmpData = [bitmap representationUsingType:NSBMPFileType
properties:props];


>
> And this would not be the appropriate list for help with either
> QuickTime or ImageIO.
>
> --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/kenferry%40gmail.com
>
> This email sent to kenfe...@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: NSCollectionView/NSArrayController/NSButton action puzzle

2010-04-01 Thread vincent habchi
Kyle,

> Um, what is an NSLayerStack?

An April fool? :) No, seriously, sorry, I was a bit tired: it's a 
NSCollectionView that I subclassed and I called it LayerStack. I updated the 
subject accordingly. 

> Wire up the action to some other method that looks at the view's
> represented object and does whatever it needs to do?

Not possible. Each subview must deliver the action precisely to the object they 
represent, so static bindings are impossible here.

Sorry again for the confusion, and thanks for your answer!
Vincent___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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