Re: NSURLConnection Problem Inside QuickLook Generator

2009-12-09 Thread Dalmazio Brisinda
Alright, well, we may have to reevaluate an alternate approach to this instead 
of via a QuickLook generator. It seems there are other issues over an above 
sandboxing which are more problematic.

Does anyone know if a version of the QuickLook framework with debugging symbols 
is available? I've already checked the debugging frameworks available on the 
Apple developer site for 10.6.2, but, alas, no version with debugging symbols 
is included there.

Perhaps I'm asking for too much. Would be nice though...

Best,
Dalmazio


On 2009-12-08, at 11:30 AM, Kyle Sluder wrote:

> On Tue, Dec 8, 2009 at 10:13 AM, Dalmazio Brisinda  
> wrote:
>> Well, it's the way the system is architected -- we are using QuickLook 
>> plugins for icon badging, and that badging depends on the state of certain 
>> elements of the filesystem which is maintained in a separate server process.
> 
> This seems like a worrisome arrangement.  The Finder's icon cache is
> notoriously temperamental.  There is no guarantee about when your
> QuickLook generator will be called, so you run the risk of displaying
> incorrect information, which is worse than displaying no information
> at all.
> 
> --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: Finding process path from Cocoa?

2009-12-09 Thread Alastair Houghton
On 9 Dec 2009, at 00:14, Nick Zitzmann wrote:

> On Dec 8, 2009, at 5:03 PM, Laurent Daudelin wrote:
> 
>> Is there any way I can find what's the path of a given process running? A 
>> background process, which cannot be retrieved in [[NSWorkspace 
>> sharedWorkspace] launchedApplications]?
> 
> Yes. ([[[NSProcessInfo processInfo] arguments] objectAtIndex:0])

No, no, no and thrice no.

What that gives you is the content of argv[0], which *is not* (necessarily) the 
path to your program.  If you think it is, then to disabuse you of the notion I 
can write a program like this:

  #include 

  int
  main (void) {
execl ("/Applications/YourApp.app/Contents/MacOS/YourApp",
   "This is not my path",
   NULL);
  }

and what you'll discover (probably to your horror) is that the above gives the 
result

  @"This is not my path"

as for that matter would accessing argv[0] from your main() function.

Obviously it's equally possible to substitute any old path rather than the 
string "This is not my path".

It is possible to get the path to your executable using the dyld API, but 
before doing such a thing you need to be very clear as to why you need it and 
what it is that you're going to do with it.  It's very easy to end up with 
major security holes or just plain broken behaviour.

Kind regards,

Alastair.

-- 
http://alastairs-place.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: Finding process path from Cocoa?

2009-12-09 Thread jonat...@mugginsoft.com

On 9 Dec 2009, at 09:53, Alastair Houghton wrote:
> 
> It is possible to get the path to your executable using the dyld API, but 
> before doing such a thing you need to be very clear as to why you need it and 
> what it is that you're going to do with it.  It's very easy to end up with 
> major security holes or just plain broken behaviour.
> 
I have used the following in the past. Just curious to know what the holes and 
dodgy behaviour is likely to be.

Dl_info info;   
int errDlAddr = dladdr( (const void *)__func__, &info );
if(errDlAddr == 0) {
return nil;
}
char *exec_path = (char *)(info.dli_fname);

NSString *path = [NSString stringWithCString:exec_path 
encoding:NSUTF8StringEncoding];


> Kind regards,
> 
> Alastair.
> 
> -- 
> http://alastairs-place.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/jonathan%40mugginsoft.com
> 
> This email sent to jonat...@mugginsoft.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: Finding process path from Cocoa?

2009-12-09 Thread Alastair Houghton
On 9 Dec 2009, at 00:03, Laurent Daudelin wrote:

> Is there any way I can find what's the path of a given process running? A 
> background process, which cannot be retrieved in [[NSWorkspace 
> sharedWorkspace] launchedApplications]?

If we're talking about background processes, to get this kind of information 
you probably need to use sysctl() (or run "ps" in the background and parse its 
output), however I think you'll find that you can only get the contents of the 
argv[] array, which can be set to *anything* by your parent process.

Furthermore, there is no guarantee that the executable will not have moved to a 
different location on the drive, or been replaced by a new (and potentially 
different) executable.

You might be interested in this (which I found using Google just now)

  

which is fine for displaying the information to the user, but I really wouldn't 
recommend using or relying on the pathname of your executable, or anyone else's 
for that matter.

Kind regards,

Alastair.

-- 
http://alastairs-place.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: Finding process path from Cocoa?

2009-12-09 Thread Alastair Houghton
On 9 Dec 2009, at 10:02, jonat...@mugginsoft.com wrote:

> On 9 Dec 2009, at 09:53, Alastair Houghton wrote:
>> 
>> It is possible to get the path to your executable using the dyld API, but 
>> before doing such a thing you need to be very clear as to why you need it 
>> and what it is that you're going to do with it.  It's very easy to end up 
>> with major security holes or just plain broken behaviour.
>> 
> I have used the following in the past. Just curious to know what the holes 
> and dodgy behaviour is likely to be.
> 
> Dl_info info; 
> int errDlAddr = dladdr( (const void *)__func__, &info );
> if(errDlAddr == 0) {
>   return nil;
> }
> char *exec_path = (char *)(info.dli_fname);
>   
> NSString *path = [NSString stringWithCString:exec_path 
> encoding:NSUTF8StringEncoding];

Well it depends what you're going to do with it.

The classic example of a vulnerability due to code of this sort is that someone 
with some kind of elevated privileges uses the path to execute their own 
process again for some reason, but in the meantime some mischievous user has 
managed to substitute another executable somehow.  As a result, this other 
executable gets launched with elevated privileges...

It might seem that this is unlikely to happen for e.g. setuid programs because 
of the difficulty of replacing them, but it's quite common for these kinds of 
APIs to return non-canonical pathnames so it's often possible to use symlinks 
that *are* under your control and then change them immediately after launching 
the child process.

dladdr() doesn't appear to say whether or not the filename it returns is 
canonical, so I wouldn't be inclined to use it without calling realpath() on it 
first, but even then it's best avoided.

So that's the security hole side of things.  The other problem is, of course, 
that someone could legitimately move, replace or even delete the file, which is 
likely to break anything that relies on "knowing" its path.

IMO, the paths returned by the system are suitable for, at most, displaying to 
the end user or putting into a crash log.  Anything more than that is risky and 
can lead to broken behaviour.

Kind regards,

Alastair.

-- 
http://alastairs-place.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: Finding process path from Cocoa?

2009-12-09 Thread jonat...@mugginsoft.com
On 9 Dec 2009, at 09:53, Alastair Houghton wrote:

>> 
>> Yes. ([[[NSProcessInfo processInfo] arguments] objectAtIndex:0])
> 
> No, no, no and thrice no.
> 
> What that gives you is the content of argv[0], which *is not* (necessarily) 
> the path to your program.  If you think it is, then to disabuse you of the 
> notion I can write a program like this:
> #include 
> 
>  int
>  main (void) {
>execl ("/Applications/YourApp.app/Contents/MacOS/YourApp",
>  "This is not my path",
>  NULL);
>  }

The docs for execl(3) do state the convention:

The first argument, by convention, should point to the file name associated 
with the file being executed.

This being a Cocoa list we should expect that all conventions are being 
followed to the letter, by everyone, everywhere (though in this case I wouldn't 
bet the farm on it).___

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

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

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

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


Re: Unable to write in InfoPlist.strings file from cpp

2009-12-09 Thread Uli Kusterer
On 09.12.2009, at 06:11, Parimal Das wrote:
> Thanks a lot Greg.
> Interpret as UTF8 solved the problem.


 Be careful, though: Some MacOS versions have a bug where .strings files had to 
be UTF16 to actually work. I don't think Apple has fixed that yet.

Cheers,
-- Uli Kusterer
"The witnesses of TeachText are everywhere..."



___

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

Please do not post admin requests or moderator comments to the list.
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: Finding process path from Cocoa?

2009-12-09 Thread jonat...@mugginsoft.com
On 9 Dec 2009, at 10:18, Alastair Houghton wrote:

> On 9 Dec 2009, at 10:02, jonat...@mugginsoft.com wrote:
> 
>> On 9 Dec 2009, at 09:53, Alastair Houghton wrote:
>>> 
>>> It is possible to get the path to your executable using the dyld API, but 
>>> before doing such a thing you need to be very clear as to why you need it 
>>> and what it is that you're going to do with it.  It's very easy to end up 
>>> with major security holes or just plain broken behaviour.
>>> 
>> I have used the following in the past. Just curious to know what the holes 
>> and dodgy behaviour is likely to be.
>> 
>> Dl_info info;
>> int errDlAddr = dladdr( (const void *)__func__, &info );
>> if(errDlAddr == 0) {
>>  return nil;
>> }
>> char *exec_path = (char *)(info.dli_fname);
>>  
>> NSString *path = [NSString stringWithCString:exec_path 
>> encoding:NSUTF8StringEncoding];
> 
> Well it depends what you're going to do with it.
> 
> The classic example of a vulnerability due to code of this sort is that 
> someone with some kind of elevated privileges uses the path to execute their 
> own process again for some reason, but in the meantime some mischievous user 
> has managed to substitute another executable somehow.  As a result, this 
> other executable gets launched with elevated privileges...
> 
> It might seem that this is unlikely to happen for e.g. setuid programs 
> because of the difficulty of replacing them, but it's quite common for these 
> kinds of APIs to return non-canonical pathnames so it's often possible to use 
> symlinks that *are* under your control and then change them immediately after 
> launching the child process.
> 
> dladdr() doesn't appear to say whether or not the filename it returns is 
> canonical, so I wouldn't be inclined to use it without calling realpath() on 
> it first, but even then it's best avoided.
> 
> So that's the security hole side of things.  The other problem is, of course, 
> that someone could legitimately move, replace or even delete the file, which 
> is likely to break anything that relies on "knowing" its path.
> 
> IMO, the paths returned by the system are suitable for, at most, displaying 
> to the end user or putting into a crash log.  Anything more than that is 
> risky and can lead to broken behaviour.
> 
In the above example we extract the path to the current process so I am not 
sure if the above concerns would apply.

It could be argued that actively utilising any path to launch another process 
is a security hole.
If your app loads an auxiliary executable from the main bundle then a user with 
admin rights can intervene and modify the target.

Even code signing isn't invincible here. You could check, via codesign(1), for 
the presence of your identifier.
But it's feasible to resign with a different identifier and patch the caller to 
check for the modified id.

Regards

Jonathan

> Kind regards,
> 
> Alastair.
> 
> -- 
> http://alastairs-place.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: Binding and Observers

2009-12-09 Thread Gerriet M. Denkmann

On 9 Dec 2009, at 07:05, mmalc Crawford  wrote:
> 
> On Dec 8, 2009, at 2:17 am, Gerriet M. Denkmann wrote:
> 
>> - (void)windowWillClose:(NSNotification *)notification
>> {
>>  id f = [ ikView observationInfo ];
>>  NSString *oi = [ f description ];
>>  
>>  BOOL ok;
>>  NSString *obs = @"Observer:";
>>  NSString *kpa = @"Key path:";
>>  unsigned long long uuu;
>>  NSString *keyPath1;
>>  
>>  NSScanner *u = [ NSScanner scannerWithString: oi ];
>>  [ u setCharactersToBeSkipped: [ NSCharacterSet 
>> whitespaceAndNewlineCharacterSet ] ];
>>  
>>  ok = [ u scanUpToString: obs intoString: NULL ];
>>  ok = [ u scanString: obs intoString: NULL ];
>>  ok = [ u scanHexLongLong: &uuu ];
>>  ok = [ u scanUpToString: kpa intoString: NULL ];
>>  ok = [ u scanString: kpa intoString: NULL ];
>>  ok = [ u scanUpToString: @"," intoString: &keyPath1 ];
>>  [ myIkView removeObserver: (id)uuu  forKeyPath: keyPath1 ];
>> }
>> 
> 
> 
> ???!!
> What's wrong with unbind:?
> 

Nothing is wrong with unbind. Wrong are only the narrow limits of my knowledge.

Acting upon your kind suggestion, I replaced the clumsy code above with:

- (void)windowWillClose:(NSNotification *)notification
{
[ rotationSlider unbind: @"value" ];
[ zoomSlider unbind: @"value" ];
}

and now everyting works perfectly - no more exceptions, no more EXC_BAD_ACCESS.
In one word: complete bliss (well: two words).

Thanks a lot!

Gerriet.

___

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

Please do not post admin requests or moderator comments to the list.
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: NSURLConnection Problem Inside QuickLook Generator

2009-12-09 Thread lbland

On Dec 9, 2009, at 3:11 AM, Dalmazio Brisinda wrote:

> Alright, well, we may have to reevaluate an alternate approach to this 
> instead of via a QuickLook generator. It seems there are other issues over an 
> above sandboxing which are more problematic.
> 
> Does anyone know if a version of the QuickLook framework with debugging 
> symbols is available? I've already checked the debugging frameworks available 
> on the Apple developer site for 10.6.2, but, alas, no version with debugging 
> symbols is included there.
> 
> Perhaps I'm asking for too much. Would be nice though...

hi-

have you tried:

/usr/bin/qlmanage

man qlmanage

yet?

also ... you will send your message to more quicklook minds on the quicklook 
mail list and not the cocoa list.

You can put NSLog() statements in your QL plugin to see the flow (on the 
console). As mentioned, execution is not serial because the Finder does strange 
things, not exactly right in my opinion, but I don't have the Finder code so I 
can't figure out exactly what is up.

thanks!-

-lance

___

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

Please do not post admin requests or moderator comments to the list.
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: Finding process path from Cocoa?

2009-12-09 Thread Alastair Houghton
On 9 Dec 2009, at 10:18, jonat...@mugginsoft.com wrote:

> The docs for execl(3) do state the convention:
> 
> The first argument, by convention, should point to the file name associated 
> with the file being executed.
> 
> This being a Cocoa list we should expect that all conventions are being 
> followed to the letter, by everyone, everywhere (though in this case I 
> wouldn't bet the farm on it).

Specifically, a potential attacker will deliberately not follow this 
convention.  The Security Server used to get the information for the program 
name in this manner, which created quite an interesting vulnerability since you 
could get it to display an authorisation dialog with *any* name you wanted in 
it.  I blogged about that particular security hole some time ago:

  

There are some other motivations for not following it also; since ps and top 
display that field as the process name, people have occasionally specified 
something other than the path to make the process list output more useful.

Kind regards,

Alastair.

-- 
http://alastairs-place.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: Finding process path from Cocoa?

2009-12-09 Thread Alastair Houghton
On 9 Dec 2009, at 10:40, jonat...@mugginsoft.com wrote:

> It could be argued that actively utilising any path to launch another process 
> is a security hole.
> If your app loads an auxiliary executable from the main bundle then a user 
> with admin rights can intervene and modify the target.

Indeed.  As ever is a conflict between security and utility and so a compromise 
is necessary.

It's good to be aware of the potential issues though.

Kind regards,

Alastair.

-- 
http://alastairs-place.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


Additional action when a view's value changes (Cocoa Bindings)

2009-12-09 Thread Christian Ziegler
Hi all!

I got a NSTextView and an NSStepper binded together, so that the textfield's 
and the stepper's values are in sync. This is very confinient, however I need 
additional things to be done whenever the value changes (basically just a 
method invocation). So far I've accomplished that by not using bindings but 
target/action instead, still I am wondering whether there is a way to do that 
via bindings (overriding a certain method?!) 

Can anybody help me out on this?

Cheers,
Chris
___

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

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

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

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


Re: Additional action when a view's value changes (Cocoa Bindings)

2009-12-09 Thread Christian Ziegler
Sorry I got to correct myself, it's not Cocoa Bindings, but direct 
target/action. So I connected the takeIntegerValue action of both views to each 
other in contrast to connecting it to a controller.


On 09.12.2009, at 14:26, Christian Ziegler wrote:

> Hi all!
> 
> I got a NSTextView and an NSStepper binded together, so that the textfield's 
> and the stepper's values are in sync. This is very confinient, however I need 
> additional things to be done whenever the value changes (basically just a 
> method invocation). So far I've accomplished that by not using bindings but 
> target/action instead, still I am wondering whether there is a way to do that 
> via bindings (overriding a certain method?!) 
> 
> Can anybody help me out on this?
> 
> Cheers,
> Chris
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/chris.ziegler%40me.com
> 
> This email sent to chris.zieg...@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: Big memory/time consumption in NSTreeController KVO GC

2009-12-09 Thread Benjamin Rister
On Dec 8, 2009, at 4:35 PM, Greg Parker wrote:

> Which OS version is this? 10.6.2 fixed a performance problem with garbage 
> collection and large KVO populations. If you still have trouble in 10.6.2+ 
> then you should file a bug report.

On Dec 8, 2009, at 6:38 PM, Rob Keniger wrote:

> Please see my bug report rdar://7139579 which includes a simple sample 
> project. The performance on Snow Leopard is orders of magnitude slower than 
> in 10.5.

As this is on 10.6.2, I’ve filed rdar://problem/7456424, referencing Rob’s 
report.

> ...and I should point out that these issues were bad enough for me to 
> completely abandon NSTreeController for my own lightweight tree controller 
> class. I've never looked back, I spent m0re hours struggling with 
> NSTreeController than I care to think about.

Considering the other issues I’m having with it, I suspect I’m headed down the 
same path. For the record, this will be three for three times I’ve tried to use 
NSTreeController in one of our apps and have been unable to do so.

Thank you, Greg and Rob, for your input. Maybe a fix for this can make 10.6.3, 
with any luck.

Best,
Benjamin___

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

Please do not post admin requests or moderator comments to the list.
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: Big memory/time consumption in NSTreeController KVO GC

2009-12-09 Thread jonat...@mugginsoft.com

On 9 Dec 2009, at 13:58, Benjamin Rister wrote:
> 
> Considering the other issues I’m having with it, I suspect I’m headed down 
> the same path. For the record, this will be three for three times I’ve tried 
> to use NSTreeController in one of our apps and have been unable to do so.
> 
I seem to spend far too much time fighting with 
NSTreeController/NSArrayController trying to get real world reliable 
performance out of them.
I think the bindings + KVO technology is great but with GC, at least, it seems 
easy to contrive a demon. 10.6 especially seems rather toxic.

Maybe it's time to back off on those bindings and try a data source.

Jonathan___

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

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

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

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


UINavigationBar, setTintColor: and UIColor colorWithPatternImage:

2009-12-09 Thread Duccio
Related to "[iPhone] UINavigationController and UINavigationBar".
-

Instantiating a color using colorWithPatternImage:

UIColor *color = [UIColor colorWithPatternImage:[UIImage 
imageNamed:@"image.png"]];

and using it to set the tintColor of a UINavigationBar:

[self.navigationController.navigationBar setTintColor:color];

the navigation bar is all black (with a small light effect on the top, the same 
as [self.navigationController.navigationBar setTintColor:[UIColor blackColor]]) 
with no image on it.

Using instead the color to "fill" the view of my view controller works 
([self.view setBackgroundColor:color]) so UIColor colorWithPatternImage: is 
working.

The UIColor documentation says:

> colorWithPatternImage:
>
> You can use pattern colors to set the fill or stroke color just as you would 
> a solid color.

So, why I can't use on my UINavigationBar?

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: CAShapeLayer and touches?

2009-12-09 Thread Eric E. Dolecki
Hmmm - I just tried this and I am getting this warning:

UITouch *touch = [[event allTouches] anyObject];
if( [self.view.layer hitTest:[touch locationInView:self]] == pointerLayer) {
 NSLog(@"pointer touched");
}

Incompatible Objective-C types 'struct RadioViewController *", expected
'struct UIView *' when passing argument 1 of 'locationInView' from distinct
Objective-C type.




On Tue, Dec 8, 2009 at 4:28 PM, Eric E. Dolecki  wrote:

> I send to you many thanks.
>
>
> On Tue, Dec 8, 2009 at 4:17 PM, David Duncan wrote:
>
>> On Dec 8, 2009, at 12:52 PM, Eric E. Dolecki wrote:
>>
>> > Okay - so how would I use the bounds? I thought I tried that in my
>> initial code sample:
>>
>>
>> Your making this too complicated :).
>>
>> if([self.view.layer hitTest:[touch locationInView:self]] == pointLayer]) {
>>// my shape layer got hit
>> }
>> --
>> David Duncan
>> Apple DTS Animation and Printing
>>
>>
>
>
> --
> http://ericd.net
> Interactive design and development
>



-- 
http://ericd.net
Interactive design and development
___

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

Please do not post admin requests or moderator comments to the list.
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: UINavigationBar, setTintColor: and UIColor colorWithPatternImage:

2009-12-09 Thread Luke the Hiesterman
Do you really expect that a patterned image would work well in this  
case? A tint obviously gets applied to the color that is set to create  
the actual background, and remember that the background of the bar  
gets mirrored in any buttons on the bar, which seems destined to look  
awkward if we're talking about an image other than a tinted color. You  
may want to think hard about why you want an image in the background  
of a nav bar, and remember that you can always have a translucent  
navigationBar.


Luke

On Dec 9, 2009, at 6:34 AM, Duccio wrote:


Related to "[iPhone] UINavigationController and UINavigationBar".
-

Instantiating a color using colorWithPatternImage:

	UIColor *color = [UIColor colorWithPatternImage:[UIImage  
imageNamed:@"image.png"]];


and using it to set the tintColor of a UINavigationBar:

[self.navigationController.navigationBar setTintColor:color];

the navigation bar is all black (with a small light effect on the  
top, the same as [self.navigationController.navigationBar  
setTintColor:[UIColor blackColor]]) with no image on it.


Using instead the color to "fill" the view of my view controller  
works ([self.view setBackgroundColor:color]) so UIColor  
colorWithPatternImage: is working.


The UIColor documentation says:


colorWithPatternImage:

You can use pattern colors to set the fill or stroke color just as  
you would a solid color.


So, why I can't use on my UINavigationBar?

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


launchApplication: giving error -10827 ?

2009-12-09 Thread Uli Kusterer
I'm trying to debug a few changes in Sparkle I made, and I'm having a problem 
where, sometimes at least, I get an error message when Sparkle's relaunch tool 
tries to start up the newly installed application:

[[NSWorkspace sharedWorkspace] openFile: appPath];

When this line is hit, I get the following in the console:

LSOpenFromURLSpec() returned -10827 for application 
/Volumes/Hull/SVN/repo/MyApp2/Output/MyApp DBG.app path (null).

The call returns NO, so it obviously knows it failed. The error seems to be 
kLSNoExecutableErr, which isn't true, because I can see the executable there, 
and I can double-click the app in Finder just fine. Anyone know what the reason 
for this message could be, or even how I can get fix it?

Since I'm launching an app, I also tried to use -launchApplication: instead, 
but the results were identical.

Cheers,
-- Uli Kusterer
"The witnesses of TeachText are everywhere..."



___

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

Please do not post admin requests or moderator comments to the list.
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] UINavigationController and UINavigationBar

2009-12-09 Thread Alex Kac
I haven’t tried this, but could the OP get what he wants by setting a tint 
color of clearColor and then set a background pattern image on the window 
itself?

On Dec 8, 2009, at 5:57 PM, Luke the Hiesterman wrote:

> 
> On Dec 8, 2009, at 3:51 PM, Mike Abdullah wrote:
> 
>> Other alternatives:
>> 
>> - Subclass UINavigationController to return a custom view from 
>> -navigationBar.
>> - Add a custom subview to the nav bar to do your drawing.
> 
> I recommend neither of these. It's already been brought up that 
> UINavigationController shouldn't be subclassed, and it isn't meant as a 
> container for arbitrary views, either. If you really aren't satisfied with 
> using a tint color for the background, file an ER asking for an API to 
> provide a background image.
> 
> Luke___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/alex%40webis.net
> 
> This email sent to a...@webis.net

Alex Kac - President and Founder
Web Information Solutions, Inc.

"I am not young enough to know everything."
--Oscar Wilde




___

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

Please do not post admin requests or moderator comments to the list.
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: Finding process path from Cocoa?

2009-12-09 Thread Todd Heberlein

On Dec 9, 2009, at 4:23 AM, Alastair Houghton wrote:

> Specifically, a potential attacker will deliberately not follow this 
> convention.  The Security Server used to get the information for the program 
> name in this manner, which created quite an interesting vulnerability since 
> you could get it to display an authorisation dialog with *any* name you 
> wanted in it.  I blogged about that particular security hole some time ago:

Drifting far afield from Cocoa... but it seems that there isn't a good Cocoa 
solution for this. Snow Leopard has a very good audit trail system with a live 
audit stream /dev/auditpipe. With a little work, this could potentially be used 
to map process IDs to the disk image they are running.

Todd

___

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

Please do not post admin requests or moderator comments to the list.
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] UINavigationController and UINavigationBar

2009-12-09 Thread Luke the Hiesterman
I hinted at that option in the other thread the OP started by  
mentioning that the bar can be translucent. I haven't tried it either,  
and I'm not sure what happens when clearColor gets tinted. The general  
strategy of going with a translucent bar seems like it might bear  
fruit in this case, though.


Luke

On Dec 9, 2009, at 9:27 AM, Alex Kac wrote:

I haven’t tried this, but could the OP get what he wants by setting  
a tint color of clearColor and then set a background pattern image  
on the window itself?


On Dec 8, 2009, at 5:57 PM, Luke the Hiesterman wrote:



On Dec 8, 2009, at 3:51 PM, Mike Abdullah wrote:


Other alternatives:

- Subclass UINavigationController to return a custom view from - 
navigationBar.

- Add a custom subview to the nav bar to do your drawing.


I recommend neither of these. It's already been brought up that  
UINavigationController shouldn't be subclassed, and it isn't meant  
as a container for arbitrary views, either. If you really aren't  
satisfied with using a tint color for the background, file an ER  
asking for an API to provide a background image.


Luke___

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

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

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

This email sent to a...@webis.net


Alex Kac - President and Founder
Web Information Solutions, Inc.

"I am not young enough to know everything."
--Oscar Wilde






___

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

Please do not post admin requests or moderator comments to the list.
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: Additional action when a view's value changes (Cocoa Bindings)

2009-12-09 Thread Quincey Morris
On Dec 9, 2009, at 05:47, Christian Ziegler wrote:

> Sorry I got to correct myself, it's not Cocoa Bindings, but direct 
> target/action. So I connected the takeIntegerValue action of both views to 
> each other in contrast to connecting it to a controller.
> 
> 
> On 09.12.2009, at 14:26, Christian Ziegler wrote:
> 
>> Hi all!
>> 
>> I got a NSTextView and an NSStepper binded together, so that the textfield's 
>> and the stepper's values are in sync. This is very confinient, however I 
>> need additional things to be done whenever the value changes (basically just 
>> a method invocation). So far I've accomplished that by not using bindings 
>> but target/action instead, still I am wondering whether there is a way to do 
>> that via bindings (overriding a certain method?!) 
>> 
>> Can anybody help me out on this?

Can you restate your question? With your correction, it's no longer clear what 
you're asking.

If you're currently using an action for each of the text and stepper views, 
then in your action methods you can simply call another method that does the 
"additional things". How are you expecting bindings to make this any easier, if 
that's what you're asking?

If you use bindings for the values of the views, then you can override the 
setter method (the 'setXxx:' method of the property "xxx" that the views are 
bound to) and do "additional things" in the setter (as well as setting the 
value of the instance variable that backs the property). If that's what you're 
asking.


___

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

Please do not post admin requests or moderator comments to the list.
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: CAShapeLayer and touches?

2009-12-09 Thread David Duncan
On Dec 9, 2009, at 6:47 AM, Eric E. Dolecki wrote:

> Incompatible Objective-C types 'struct RadioViewController *", expected 
> 'struct UIView *' when passing argument 1 of 'locationInView' from distinct 
> Objective-C type.


I had assumed 'self' was an instance of UIView. I was wrong. Thats what the 
error is telling you :).
--
David Duncan
Apple DTS Animation and Printing

___

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

Please do not post admin requests or moderator comments to the list.
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: Finding process path from Cocoa?

2009-12-09 Thread James Walker

Laurent Daudelin wrote:

Is there any way I can find what's the path of a given process running?
A background process, which cannot be retrieved in 
[[NSWorkspace sharedWorkspace] launchedApplications]?


What kind of a process?  If it's a background-only *application*, you 
can use the Process Manager.


--
  James W. Walker, Innoventive Software LLC
  
___

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

Please do not post admin requests or moderator comments to the list.
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: Finding process path from Cocoa?

2009-12-09 Thread Laurent Daudelin
On Dec 8, 2009, at 16:14, Nick Zitzmann wrote:

> 
> On Dec 8, 2009, at 5:03 PM, Laurent Daudelin wrote:
> 
>> Is there any way I can find what's the path of a given process running? A 
>> background process, which cannot be retrieved in [[NSWorkspace 
>> sharedWorkspace] launchedApplications]?
> 
> Yes. ([[[NSProcessInfo processInfo] arguments] objectAtIndex:0])


That's good if you want to know about your own process but what I was looking 
for was to check another process. Since I had to support 10.5, 
NSRunningApplication was out of question. So, I ended up using some AppleScript 
built programmatically: "tell application \"System Events\" to get (file of 
every process whose name is \"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: Finding process path from Cocoa?

2009-12-09 Thread Sean McBride
On 12/9/09 10:33 AM, Laurent Daudelin said:

>That's good if you want to know about your own process but what I was
>looking for was to check another process. Since I had to support 10.5,
>NSRunningApplication was out of question.

NSRunningApplication is basically a replacement for the Process Manager,
which was the only way to do some things that NSWorkspace could not (in
10.5 and earlier).  Process Manager will list background only apps,
unlike NSWorkspace.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

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

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

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


Question about touchesBegan

2009-12-09 Thread Eric E. Dolecki
I have a main view that uses touchesBegan. I call up and display a subView
on top of the main view, and that subView has it's own touchesBegan.

The subView obstructs the touchesBegan in the main view. Is this expected?



-- 
http://ericd.net
Interactive design and development
___

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

Please do not post admin requests or moderator comments to the list.
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: Finding process path from Cocoa?

2009-12-09 Thread Dave DeLong
I apologize if this has already come up, but what about running `ps x | grep 
'ProcessName'`, and extracting the executable path that way?

Dave

On Dec 9, 2009, at 11:33 AM, Laurent Daudelin wrote:

>  Kinda odd to use AppleScript for that but that was the quickest way I found.


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: Question about touchesBegan

2009-12-09 Thread Alexander Spohr

Am 09.12.2009 um 20:32 schrieb Eric E. Dolecki:

> I have a main view that uses touchesBegan. I call up and display a subView
> on top of the main view, and that subView has it's own touchesBegan.
> 
> The subView obstructs the touchesBegan in the main view. Is this expected?


Yes. Otherwise no subview of the window would ever get any touches...

Sub does not mean below :)

atze


___

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

Please do not post admin requests or moderator comments to the list.
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


Order of [... directoryContentsAtPath:...]

2009-12-09 Thread David Blanton



 NSArray *array = [[NSFileManager defaultManager]  
directoryContentsAtPath:fullPath]];



Will array objects 0 thru n be in dictionary order?  This seems to be  
the case  but not always.  Should one sort array in an  
ascending manner?



Every place I run my code I always see array in dictionary order.   
However, in one customer case the order is not dictionary.


Just information I am looking for.

db


___

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

Please do not post admin requests or moderator comments to the list.
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: Finding process path from Cocoa?

2009-12-09 Thread Laurent Daudelin
On Dec 9, 2009, at 11:51, Dave DeLong wrote:

> I apologize if this has already come up, but what about running `ps x | grep 
> 'ProcessName'`, and extracting the executable path that way?
> 
> Dave
> 
> On Dec 9, 2009, at 11:33 AM, Laurent Daudelin wrote:
> 
>> Kinda odd to use AppleScript for that but that was the quickest way I found.
> ___


That's something I did consider but decided not to get into...

Thanks for the comment, though, means I was on the right path!

-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: Order of [... directoryContentsAtPath:...]

2009-12-09 Thread Quincey Morris
On Dec 9, 2009, at 13:38, David Blanton wrote:

> Will array objects 0 thru n be in dictionary order?  This seems to be the 
> case  but not always.  Should one sort array in an ascending 
> manner?

No, there's no API contract that specifies what order they'll be returned in. 
It may in fact be file system dependent. (The files might, for example, always 
be returned in ascending name order from HFS+, but not from a network file 
system, which means it's a bug you might not find from your local testing.)


___

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

Please do not post admin requests or moderator comments to the list.
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: Question about touchesBegan

2009-12-09 Thread Jack Carbaugh
So in this case, would the SUBview want to send the SUPERview the  
touchesbegan event ?


On Dec 9, 2009, at 4:10 PM, Alexander Spohr wrote:



Am 09.12.2009 um 20:32 schrieb Eric E. Dolecki:

I have a main view that uses touchesBegan. I call up and display a  
subView

on top of the main view, and that subView has it's own touchesBegan.

The subView obstructs the touchesBegan in the main view. Is this  
expected?



Yes. Otherwise no subview of the window would ever get any touches...

Sub does not mean below :)

   atze


___

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

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

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

This email sent to intrn...@aol.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: Finding process path from Cocoa?

2009-12-09 Thread Laurent Daudelin
On Dec 9, 2009, at 10:48, Sean McBride wrote:

> On 12/9/09 10:33 AM, Laurent Daudelin said:
> 
>> That's good if you want to know about your own process but what I was
>> looking for was to check another process. Since I had to support 10.5,
>> NSRunningApplication was out of question.
> 
> NSRunningApplication is basically a replacement for the Process Manager,
> which was the only way to do some things that NSWorkspace could not (in
> 10.5 and earlier).  Process Manager will list background only apps,
> unlike NSWorkspace.


I guess that with Carbon not being ported to 64bits, NSRunningApplication was 
needed. It just makes life a little harder if you have to support both 10.5 
(which doesn't have NSRunningApplication but has Process Manager) and 10.6 
(which has NSRunningApplication but doesn't support Process Manager in 
64bits)...

-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: Question about touchesBegan

2009-12-09 Thread glenn andreas

On Dec 9, 2009, at 4:19 PM, Jack Carbaugh wrote:

> So in this case, would the SUBview want to send the SUPERview the 
> touchesbegan event ?
> 

>From the documentation (iPhone Application Programming Guide > Event Handling 
>> Touch Events > Handling Multi-Touch Events > Forwarding Touch Events):


Forwarding Touch Events
Event forwarding is a technique used by some applications. You forward touch 
events by invoking the event-handling methods of another responder object. 
Although this can be an effective technique, you should use it with caution. 
The classes of the UIKit framework are not designed to receive touches that are 
not bound to them; in programmatic terms, this means that the view property of 
the UITouch object must hold a reference to the framework object in order for 
the touch to be handled. If you want to conditionally forward touches to other 
responders in your application, all of these responders should be instances of 
your own subclasses of UIView.



It's definitely worth reading, and re-reading, those docs - all sorts of nice 
explanations of how touch handling is handled can be found there...


Glenn Andreas  gandr...@gandreas.com 
  wicked fun!
Mad, Bad, and Dangerous to Know

___

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

Please do not post admin requests or moderator comments to the list.
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: Finding process path from Cocoa?

2009-12-09 Thread Nick Zitzmann

On Dec 9, 2009, at 3:49 PM, Laurent Daudelin wrote:

> I guess that with Carbon not being ported to 64bits, NSRunningApplication was 
> needed. It just makes life a little harder if you have to support both 10.5 
> (which doesn't have NSRunningApplication but has Process Manager) and 10.6 
> (which has NSRunningApplication but doesn't support Process Manager in 
> 64bits)...

The Process Manager is supported on 64-bit. The only things that were dropped 
from 64-bit Carbon were  the HIToolbox, non-QTKit QuickTime, and a bunch of 
legacy technologies such as FSSpec and QuickDraw.

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


Re: Finding process path from Cocoa?

2009-12-09 Thread Eric Schlegel

On Dec 9, 2009, at 2:49 PM, Laurent Daudelin wrote:

> 10.6 (which has NSRunningApplication but doesn't support Process Manager in 
> 64bits)...

Actually, the Process Manager is supported for 64-bit apps.

-eric

___

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

Please do not post admin requests or moderator comments to the list.
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: Finding process path from Cocoa?

2009-12-09 Thread Laurent Daudelin
On Dec 9, 2009, at 14:55, Nick Zitzmann wrote:

> 
> On Dec 9, 2009, at 3:49 PM, Laurent Daudelin wrote:
> 
>> I guess that with Carbon not being ported to 64bits, NSRunningApplication 
>> was needed. It just makes life a little harder if you have to support both 
>> 10.5 (which doesn't have NSRunningApplication but has Process Manager) and 
>> 10.6 (which has NSRunningApplication but doesn't support Process Manager in 
>> 64bits)...
> 
> The Process Manager is supported on 64-bit. The only things that were dropped 
> from 64-bit Carbon were  the HIToolbox, non-QTKit QuickTime, and a bunch of 
> legacy technologies such as FSSpec and QuickDraw.


FSSpec is not supported but FSRef still is? I just checked the documentation 
but it's not clear that FSSpec is not ported (or deprecated?). Does deprecated 
means it possibly won't be ported to 64-bit? It's not clear what structures are 
deprecated or not from the Xcode documentation, anybody has a link?

Thanks!

-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: Finding process path from Cocoa?

2009-12-09 Thread Nick Zitzmann

On Dec 9, 2009, at 4:11 PM, Laurent Daudelin wrote:

> FSSpec is not supported but FSRef still is? I just checked the documentation 
> but it's not clear that FSSpec is not ported (or deprecated?). Does 
> deprecated means it possibly won't be ported to 64-bit?

I think the FSSpec structure is actually still defined in the 64-bit headers, 
but all the APIs that actually used it were removed, rendering it quite 
useless. FSRef is still used by a lot of APIs despite the big URL push in Snow 
Leopard, so it's still in the 64-bit libraries.

> It's not clear what structures are deprecated or not from the Xcode 
> documentation, anybody has a link?

Unless the documentation specifically labels a function or method or data 
structure as "not available in 64-bit", it is available for both PPC64 and 
X86-64.

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


Re: Additional action when a view's value changes (Cocoa Bindings)

2009-12-09 Thread mmalc Crawford

On Dec 9, 2009, at 5:47 am, Christian Ziegler wrote:

> Sorry I got to correct myself, it's not Cocoa Bindings, but direct 
> target/action. So I connected the takeIntegerValue action of both views to 
> each other in contrast to connecting it to a controller.
> 
Don't do that.
Both should invoke an action in a controller, which may then update views and 
models appropriately.

You should read 

 and in particular "The Model-View-Controller Design Pattern" 

 which is crucial for all Cocoa development.

mmalc

___

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

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

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

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


Re: Question about touchesBegan

2009-12-09 Thread Eric E. Dolecki
Is there a way to define the touchesBegan in an added sub view to
be constricted to a certain area and not allObjects? Thus leaving a "hole"
to allow touches to be fired on the view below?

On Wed, Dec 9, 2009 at 5:53 PM, glenn andreas  wrote:

>
> On Dec 9, 2009, at 4:19 PM, Jack Carbaugh wrote:
>
> > So in this case, would the SUBview want to send the SUPERview the
> touchesbegan event ?
> >
>
> >From the documentation (iPhone Application Programming Guide > Event
> Handling > Touch Events > Handling Multi-Touch Events > Forwarding Touch
> Events):
>
>
> Forwarding Touch Events
> Event forwarding is a technique used by some applications. You forward
> touch events by invoking the event-handling methods of another responder
> object. Although this can be an effective technique, you should use it with
> caution. The classes of the UIKit framework are not designed to receive
> touches that are not bound to them; in programmatic terms, this means that
> the view property of the UITouch object must hold a reference to the
> framework object in order for the touch to be handled. If you want to
> conditionally forward touches to other responders in your application, all
> of these responders should be instances of your own subclasses of UIView.
>
>
>
> It's definitely worth reading, and re-reading, those docs - all sorts of
> nice explanations of how touch handling is handled can be found there...
>
>
> Glenn Andreas  gandr...@gandreas.com
>   wicked fun!
> Mad, Bad, and Dangerous to Know
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/edolecki%40gmail.com
>
> This email sent to edole...@gmail.com
>



-- 
http://ericd.net
Interactive design and development
___

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

Please do not post admin requests or moderator comments to the list.
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: Question about touchesBegan

2009-12-09 Thread Henry McGilton (Boulevardier)

On Dec 9, 2009, at 5:58 PM, Eric E. Dolecki wrote:

> Is there a way to define the touchesBegan in an added sub view to
> be constricted to a certain area and not allObjects? Thus leaving a "hole"
> to allow touches to be fired on the view below?

If I interpret your question correctly, you want the added sub-view to NOT 
handle touches?

If so, don't implement the touchesBegan/Moved/Ended methods in that sub-view.

Alternatively, simply disable user interaction for that sub-view.

Even more alternatively, I have found in many cases that handling touches in 
the View Controller
that manages the view hierarchy makes life easier.You receive a touch and 
simply ask what
view it landed in.


Cheers,
. . . . . . . .Henry




___

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

Please do not post admin requests or moderator comments to the list.
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: Question about touchesBegan

2009-12-09 Thread Eric E. Dolecki
Well - I wonder if it's possible to enable touches in a sub view but not for
the entire view - just part of it.

I have a view with buttons in it. I call up a sub view that requires touches
for swiping... I want the buttons in the view below to still register touch
events for that entire view.

On Wed, Dec 9, 2009 at 9:32 PM, Henry McGilton (Boulevardier) <
appledevelo...@trilithon.com> wrote:

>
> On Dec 9, 2009, at 5:58 PM, Eric E. Dolecki wrote:
>
> > Is there a way to define the touchesBegan in an added sub view to
> > be constricted to a certain area and not allObjects? Thus leaving a
> "hole"
> > to allow touches to be fired on the view below?
>
> If I interpret your question correctly, you want the added sub-view to NOT
> handle touches?
>
> If so, don't implement the touchesBegan/Moved/Ended methods in that
> sub-view.
>
> Alternatively, simply disable user interaction for that sub-view.
>
> Even more alternatively, I have found in many cases that handling touches
> in the View Controller
> that manages the view hierarchy makes life easier.You receive a touch
> and simply ask what
> view it landed in.
>
>
>Cheers,
> . . . . . . . .Henry
>
>
>
>
>


-- 
http://ericd.net
Interactive design and development
___

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

Please do not post admin requests or moderator comments to the list.
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


Leopard for development / testing.

2009-12-09 Thread Dan Ribe
Hi All,

I want to get a copy of Leopard for development/testing purpose. Can anyone
please let me know.

- Is there anyway to download it from apple's site ?
- Does apple provides Leopard copy for Development/Testing for free or I
have to pay for that ?
- If apple provides free copy of Leopard for development/testing purpose
then what I need to do to get one ?

Please excuse me as my question is not related to cocoa but I thought
someone will be able to answer it in this list. Thanks for your help !

Cheers
-Dan
___

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

Please do not post admin requests or moderator comments to the list.
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


[iPhone] Is there no return or dismiss key if my UITextField.keyboardType = UIKeyboardTypeNumberPad

2009-12-09 Thread Paul Archibald
It seems as though the UITextField/View classes do not allow a return  
or done key when keyboardType is a UIKeyboardTypeNumberPad. Am I  
missing something, or is this a deliberate design?


This seems odd to me and kind of a drag since I have several text and  
numeric controls in my view and I would like them to act pretty much  
the same way. Having the one numeric keypad need an extra button in  
the toolbar seems kind of kludgy. Is that the only solution?

___

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

Please do not post admin requests or moderator comments to the list.
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] Is there no return or dismiss key if my UITextField.keyboardType = UIKeyboardTypeNumberPad

2009-12-09 Thread Dave DeLong
You could have the background of the screen respond to touch events, so that 
when the background receives a touch, it forces the first responder to resign 
that status, thereby causing the keyboard to disappear.

Dave

On Dec 9, 2009, at 9:38 PM, Paul Archibald wrote:

> Is that the only solution?


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

NSCell's mouse tracking method never called

2009-12-09 Thread Martin Cote
Hello,

I'm trying to track the mouse in my custom NSCell subclass, which is
used to display the content of a NSTableView.  For that matter, I
override the following method:

- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame
ofView:(NSView *)controlView untilMouseUp:(BOOL)flag;

The problem is that this method is never called for some reason that eludes me.

Here's more details about the application:
 - I use tracking rects (using NSView's
addTrackingRect:owner:userData:assumeInside: method).  I'm not using
NSTrackingArea because I want this thing to work on pre-Leopard
machines.
 - The mouseEntered:/mouseExited: methods are called properly for the
tracking rects.
 - My NSCell's are copied for tracking (inspired by the PhotoSearch
sample project).  In fact, the whole application resemble the
PhotoSearch project, the main difference being that I use tracking
rects instead of tracking areas.

I'm really perplexed by this.  Any insight would be useful.

Thanks,
Martin Cote
___

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

Please do not post admin requests or moderator comments to the list.
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: Leopard for development / testing.

2009-12-09 Thread Kiel Gillard
On 10/12/2009, at 3:37 PM, Dan Ribe wrote:

> Hi All,
> 
> I want to get a copy of Leopard for development/testing purpose. Can anyone
> please let me know.
> 
> - Is there anyway to download it from apple's site ?

Yes 

I know they offer Snow Leopard download - not sure about Leopard. Maybe someone 
else with the appropriate membership can help?

> - Does apple provides Leopard copy for Development/Testing for free or I
> have to pay for that ?

You have to pay.

Kiel

> - If apple provides free copy of Leopard for development/testing purpose
> then what I need to do to get one ?
> 
> Please excuse me as my question is not related to cocoa but I thought
> someone will be able to answer it in this list. Thanks for your help !
> 
> Cheers
> -Dan
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/kiel.gillard%40gmail.com
> 
> This email sent to kiel.gill...@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: Leopard for development / testing.

2009-12-09 Thread Dan Ribe
I already have snow leopard & developer tools for it. So basically I can
develop application using it on snow leopard for both 10.5 & 10.6.

I am looking for a copy of Leopard so that I can test my software on Leopard
as well. thanks



On Thu, Dec 10, 2009 at 10:18 AM, Evadne Wu  wrote:

> Hi Dan,
>
>If you already have a copy of OS X, you have everything necessary.
>  Pop the DVD in and look for Developer Utilities.  Apple bundles them for
> free with every copy of OS X.  If you’re talking about private betas you’ll
> need to become an ADC member.
>
> ev
>
> On Dec 10, 2009, at 12:37 PM, Dan Ribe wrote:
>
> > Hi All,
> >
> > I want to get a copy of Leopard for development/testing purpose. Can
> anyone
> > please let me know.
> >
> > - Is there anyway to download it from apple's site ?
> > - Does apple provides Leopard copy for Development/Testing for free or I
> > have to pay for that ?
> > - If apple provides free copy of Leopard for development/testing purpose
> > then what I need to do to get one ?
> >
> > Please excuse me as my question is not related to cocoa but I thought
> > someone will be able to answer it in this list. Thanks for your help !
> >
> > Cheers
> > -Dan
> > ___
> >
> > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> > http://lists.apple.com/mailman/options/cocoa-dev/ev%40monoceroi.com
> >
> > This email sent to e...@monoceroi.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: NSCell's mouse tracking method never called

2009-12-09 Thread Graham Cox

On 10/12/2009, at 3:50 PM, Martin Cote wrote:

> I'm trying to track the mouse in my custom NSCell subclass, which is
> used to display the content of a NSTableView.  For that matter, I
> override the following method:
> 
> - (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame
> ofView:(NSView *)controlView untilMouseUp:(BOOL)flag;
> 
> The problem is that this method is never called for some reason that eludes 
> me.
> 
> Here's more details about the application:
> - I use tracking rects (using NSView's
> addTrackingRect:owner:userData:assumeInside: method).  I'm not using
> NSTrackingArea because I want this thing to work on pre-Leopard
> machines.
> - The mouseEntered:/mouseExited: methods are called properly for the
> tracking rects.
> - My NSCell's are copied for tracking (inspired by the PhotoSearch
> sample project).  In fact, the whole application resemble the
> PhotoSearch project, the main difference being that I use tracking
> rects instead of tracking areas.
> 
> I'm really perplexed by this.  Any insight would be useful.


Not really enough to go on. Just this morning I was debugging some custom cell 
code that lives inside a NSOutlineView and this method was indeed called as 
expected.

Are you expecting this method to be invoked by your tracking handler? Normally 
it's called by a mouseDown in the table.

You need to show some code.

--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: Leopard for development / testing.

2009-12-09 Thread Rob Keniger

On 10/12/2009, at 2:58 PM, Dan Ribe wrote:

> I already have snow leopard & developer tools for it. So basically I can
> develop application using it on snow leopard for both 10.5 & 10.6.
> 
> I am looking for a copy of Leopard so that I can test my software on Leopard
> as well. thanks


This question is not Cocoa-related and should be asked elsewhere.

You have two options:

1) find a copy somewhere and buy it (eBay etc)
2) buy a developer membership from Apple. The Select and Premier memberships 
allow you to download all releases of Mac OS X back to Jaguar (10.2).

The developer membership also gives you access to Apple's testing labs, if you 
are close to the locations.

You'd need to ensure that your machine supports booting in Leopard, if your Mac 
shipped with Snow Leopard it probably won't boot in Leopard.

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


Re: Leopard for development / testing.

2009-12-09 Thread Nick Zitzmann

On Dec 9, 2009, at 9:58 PM, Dan Ribe wrote:

> I am looking for a copy of Leopard so that I can test my software on Leopard
> as well.

Did you get Snow Leopard as part of a new computer? If so, then even if you 
acquire Leopard, you might not be able to use it. With a very small handful of 
exceptions, every new computer Apple has made will not run versions of the OS 
older than the OS that comes bundled with the computer. You can get around this 
by using a virtual machine, but then you need Leopard Server instead.

But now we're going OT, so if you want to follow-up, please do so off-list...

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


Problem with Set/Get volume of input device with single channel

2009-12-09 Thread Symadept
Hi,

I am trying to Set/Get Volume level of Input device which has only single
channel but no master channel, then it fails to retrieve the
kAudioDevicePropertyPreferredChannelsForStereo and intermittently
kAudioDevicePropertyVolumeScalar for each channel. But this works well for
Output device.

So is there any difference in setting/getting the volume of input channels?

I am pasting the downloadable link to sample.
http://www.4shared.com/file/169494513/f53ed27/VolumeManagerTest.html

Thanks in advance.

Regards
Mustafa


Tags:  MacOSX, CoreAudio, Objective C.
___

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

Please do not post admin requests or moderator comments to the list.
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: Question about touchesBegan

2009-12-09 Thread Alexander Spohr

Am 10.12.2009 um 04:34 schrieb Eric E. Dolecki:

> Well - I wonder if it's possible to enable touches in a sub view but not for
> the entire view - just part of it.
> 
> I have a view with buttons in it. I call up a sub view that requires touches
> for swiping... I want the buttons in the view below to still register touch
> events for that entire view.

Usually the superview of the buttons would handle swipes.
If you have buttons put them on top (as a subview) of your swipe receiver.

Or - as was pointed out - let the controller catch all touches.

atze

___

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

Please do not post admin requests or moderator comments to the list.
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: Question about touchesBegan

2009-12-09 Thread Alexander Spohr
Um, have to follow up to myself...

Am 10.12.2009 um 08:02 schrieb Alexander Spohr:

> Am 10.12.2009 um 04:34 schrieb Eric E. Dolecki:
> 
>> Well - I wonder if it's possible to enable touches in a sub view but not for
>> the entire view - just part of it.
>> 
>> I have a view with buttons in it. I call up a sub view that requires touches
>> for swiping... I want the buttons in the view below to still register touch
>> events for that entire view.
> 
> Usually the superview of the buttons would handle swipes.
> If you have buttons put them on top (as a subview) of your swipe receiver.
> 
> Or - as was pointed out - let the controller catch all touches.

If your swipe view and buttons are in the same hierarchy

- (void)bringSubviewToFront:(UIView *)view
- (void)sendSubviewToBack:(UIView *)view

should help.

But as these are in the docs of UIView I am sure you already found them. ;)

atze

___

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

Please do not post admin requests or moderator comments to the list.
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