defining NSColor constants

2009-08-06 Thread Arie Pieter Cammeraat
In my app, I use several colors many times. I'd like to define them  
in a separate file or class.


Is there another way to do this than:
	#define kNiceBlueColor [NSColor colorWithRed: 20 green: 20 blue: 240  
alpha:1];


I would like a more obj-c style, like
globals.h:
extern NSColor * const kNiceBlueColor

globals.m:
#import globals.h

	NSColor * const kNiceBlueColor = [NSColor colorWithRed: 20 green: 20  
blue: 240 alpha:1];




I found some examples of this kind for defining a NSString using the  
@"foo"-syntax. With NSColor, it doesn't seem to work. I get the error  
"initializer element is not constant". Anyone any thoughts on this?


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


Re: NSMenuItem addTarget & retain

2009-08-06 Thread Remko Tronçon
Hi Graham,

> Yes, NSMenuItem does not retain its target.
> From the docs: "

That's exactly the documentation I was looking for, but couldn't find. Thanks!

cheers,
Remko
___

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

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

2009-08-06 Thread Arie Pieter Cammeraat

you might:

* change the buttons programmatically every time.

* drag 2 UIBarButtonItems in your InterfaceBuilder file, set the  
connections and the captions in IB. Then in XCode, you can change the  
buttons by using


NSArray * topLevelObjs = nil;
topLevelObjs = [[NSbundle mainBndle] loadNibName@"yourNibFile"  
owner:"nameOfNIBFilesOwner" options: nil];
UIBarButtonItem * barButton1 = (UIBarButtonItem *)[topLevelObjs  
objectAtIndex: indexNumber];


you could build in some error checking, like checking the class and  
the tag of the UIBarButtonItem.


Feel free to comment on this!

Op 6-aug-2009, om 7:47 heeft Agha Khan het volgende geschreven:


Hi:
I have a UINavigationBar where I would like to place 2 buttons. I  
was looking UINavigationBar.h for its implementation and didn't see  
the way we could add more than 2 buttons(Right hand side and left  
hand siderightBarButtonItem ) but my both buttons are  
rightBarButtonsItems where one of them is always hidden. I need 2  
buttons because they point to 2 different click functions and  
different captions.



You might have better idea?

Best regards
Agha___

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

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

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


This email sent to cocoa-...@yaranga.nl


___

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

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


resolving addresses for the system framework

2009-08-06 Thread Arnab Ganguly
Hi All,
Sorry if the mail is not in correct group. Is it possible to resolve the
system framework addresses for a binary  (Addressbook, SyncServices)? Like
can we use some tools like atos on basis of addresses would like to get the
function information etc...If the crash reporter is not able to resolve
symbols for the System framework what could be the issue ?
Thanks in advance.
Arnab
___

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

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

2009-08-06 Thread James Lin
How does Bonjour handle the task of introducing 2 iPhones (located in  
2 parts of the world) to each other?


The documentations i've found so far all point to Bonjour working on  
local network only, (even on Apple's website).
Can you please point me to the documentation where it explains how  
Bonjour works over the "internet"?


My goal:

1. 1 iPhone running my app working as a server waiting for connection  
from another iPhone from the "internet".
2. Another iPhone running my app working as a client connects to the  
server iPhone and send a string "hi, I am James".
3. The server iPhone, upon receiving this string reply with user's  
choice of either String A or String B back to the client iPhone.


From the comment below...if an iPhone is never going to have a public  
IP address...

How do I make 1 iPhone connect to another?


Sorry for the repeating question...I am just getting more and more  
confused instead so far...


Thank you in advance...

James

On 2009/8/5, at 上午 2:13, Luke the Hiesterman wrote:



On Aug 4, 2009, at 11:10 AM, James Lin wrote:


Bonjour is for local area network, right?


No, Bonjour is applicable to any networking, local or wide area.  
Here's some sample code.


http://developer.apple.com/iphone/library/samplecode/BonjourWeb/index.html

Luke



On 2009/8/6, at 上午 7:58, glenn andreas wrote:



On Aug 4, 2009, at 4:42 PM, Shawn Erickson wrote:

On Tue, Aug 4, 2009 at 11:13 AM, Luke the Hiesterman> wrote:


On Aug 4, 2009, at 11:10 AM, James Lin wrote:


Bonjour is for local area network, right?


No, Bonjour is applicable to any networking, local or wide area.  
Here's some

sample code.

http://developer.apple.com/iphone/library/samplecode/BonjourWeb/index.html


Well ad-hoc discovery only works on the local sub-net or across
bridged sub-nets. To do service discovery across sub-nets would
require a known DNS server publishing the existence of services and
how to contact them via public IP addresses.



Of course, in the context of the original question (re: iPhone  
networking), the iPhone is almost never going to have a public IP  
address (being hidden behind WiFi or cell phone NATs).



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: [iPhone] networking

2009-08-06 Thread Roland King



James Lin wrote:
How does Bonjour handle the task of introducing 2 iPhones (located in  2 
parts of the world) to each other?




it basically doesn't. Bonjour can work over network segments which have 
been bridged for multicast dns (I think) but in general it doesn't work 
outside a LAN.


The documentations i've found so far all point to Bonjour working on  
local network only, (even on Apple's website).
Can you please point me to the documentation where it explains how  
Bonjour works over the "internet"?


I've never seen any. I assume that as well as multicast dns there are 
ways to configure bonjour to point to some central DNS server which 
would enable something like that to work but I've not seen documentation 
as to how, and I went looking for it a while ago when I was on a 'what 
the hell is bonjour' discovery quest.




My goal:

1. 1 iPhone running my app working as a server waiting for connection  
from another iPhone from the "internet".
2. Another iPhone running my app working as a client connects to the  
server iPhone and send a string "hi, I am James".
3. The server iPhone, upon receiving this string reply with user's  
choice of either String A or String B back to the client iPhone.


 From the comment below...if an iPhone is never going to have a public  
IP address...

How do I make 1 iPhone connect to another?



You basically can't, and people have been trying to tell you this for 
some time now, most of the replies to your questions have said exactly 
that, you can't network through NAT, phones don't have public IP 
addresses, or they rarely do.


The comment about IPv6 was quite interesting .. true that if that is 
ever implemented worldwide then possibly every device will have its own 
IP address, but it's not and the growth of NAT-based solutions for the 
limited IP address space seems to have taken the hurry up out of a lot 
of IPv6 initiatives, so I'm not expecting to see it anytime soon.


So what can you do with a phone, well you can connect *to* something, 
but you cannot listen and have someone connect *to* you. So, and this 
has been suggested a number of times too, if you run a central server 
then each phone can individually connect to that, and it can pass 
messages between them for you. That would work. But you need a server, 
on a public IP, that you can run a long-running server process on.


By the way - and I think I said something about this before - in your 
ideal world where phones did have public (although regularly changing) 
IP addresses .. how was phone A going to find phone B in the first 
place? That is hard, that's what phone companies do when you dial 
numbers, they find the phone attached to them, how were you going to do 
it? In that case a server helps you again, you don't NEED to find the 
phone, the phones each find the server, and they know where that is, and 
then that connects them based on .




Sorry for the repeating question...I am just getting more and more  
confused instead so far...


Thank you in advance...

James

On 2009/8/5, at 上午 2:13, Luke the Hiesterman wrote:



On Aug 4, 2009, at 11:10 AM, James Lin wrote:


Bonjour is for local area network, right?



No, Bonjour is applicable to any networking, local or wide area.  
Here's some sample code.


http://developer.apple.com/iphone/library/samplecode/BonjourWeb/index.html 



Luke




On 2009/8/6, at 上午 7:58, glenn andreas wrote:



On Aug 4, 2009, at 4:42 PM, Shawn Erickson wrote:

On Tue, Aug 4, 2009 at 11:13 AM, Luke the 
Hiesterman wrote:




On Aug 4, 2009, at 11:10 AM, James Lin wrote:


Bonjour is for local area network, right?



No, Bonjour is applicable to any networking, local or wide area.  
Here's some

sample code.

http://developer.apple.com/iphone/library/samplecode/BonjourWeb/index.html 




Well ad-hoc discovery only works on the local sub-net or across
bridged sub-nets. To do service discovery across sub-nets would
require a known DNS server publishing the existence of services and
how to contact them via public IP addresses.




Of course, in the context of the original question (re: iPhone  
networking), the iPhone is almost never going to have a public IP  
address (being hidden behind WiFi or cell phone NATs).



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/rols%40rols.org

This email sent to r...@rols.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/U

Re: General approach to networking/server problem?

2009-08-06 Thread Alastair Houghton

On 6 Aug 2009, at 04:16, Graham Cox wrote:

A general question. Suppose I wanted to write a Cocoa application  
that could be accessed via a PHP script running on another machine  
on the local network, what would the general shape of the solution  
look like?


:-)  That's kind of a general question.

It depends on what your app is going to be doing and when this script  
is going to be running.


For instance, an easy solution might be to write a Foundation tool  
that uses CGI (or if you need more performance than that gets you,  
FastCGI) to get its arguments (i.e. via the environment and its  
standard input), then use a conventional web server to do the actual  
networking part.  You could either put arguments into a POST (perhaps  
send a block of XML that you can then parse at the Foundation end), or  
you could stick them in the URL, and so on.


The benefit of that approach is that it's easy, it gives you the  
flexibility of configuration of the webserver without you having to  
implement everything yourself, and on the PHP end you can use fopen()  
or the curl functions or similar.


At the other end of the spectrum is the full custom server approach,  
which isn't too hard either.  You've got a good few choices there  
though---you'd probably want to use launchd to keep your server  
running, but launchd also has a number of features to help write  
server apps.  If you use a non-standard protocol, then at the PHP end  
you can use PHP's socket functions.


There are some sample programs here that you might be interested in:

  

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: [iPhone] networking

2009-08-06 Thread James Lin



My goal:
1. 1 iPhone running my app working as a server waiting for  
connection  from another iPhone from the "internet".
2. Another iPhone running my app working as a client connects to  
the  server iPhone and send a string "hi, I am James".
3. The server iPhone, upon receiving this string reply with user's   
choice of either String A or String B back to the client iPhone.
From the comment below...if an iPhone is never going to have a  
public  IP address...

How do I make 1 iPhone connect to another?


You basically can't, and people have been trying to tell you this  
for some time now, most of the replies to your questions have said  
exactly that, you can't network through NAT, phones don't have  
public IP addresses, or they rarely do.




So, if I cannot make 2 iPhones talk to each other, but I have a php/ 
mysql server.


Can my other option be the following?

1. iPhone A post the message "Hi, I am James" to the php/mysql server  
and specifies the message is for iPhone B.
2. iPhone B running my app keeps querrying the php/mysql server for  
message left for it with a querry to php/mysql server inside a   
NSTimer (say querry once every 30 seconds).
3. iPhone B, upon getting a result that there is a message from iPhone  
B, do whatever it needs to do and post the reply back to the php/mysql  
server.
4. iPhone A, inside a NSTimer, querrys the php/mysql server for result  
of the original posting from B.


Is this my best option given what I want to accomplish?

Thanks in advance...


James
___

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

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

2009-08-06 Thread Keith Duncan


On 6 Aug 2009, at 09:13, Roland King wrote:

I've never seen any. I assume that as well as multicast dns there  
are ways to configure bonjour to point to some central DNS server  
which would enable something like that to work


Yes, you can use regular unicast DNS, and query a specified DNS server  
for SRV records.


Keith
___

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

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

2009-08-06 Thread Alastair Houghton

On 6 Aug 2009, at 07:58, Arie Pieter Cammeraat wrote:


I would like a more obj-c style, like
globals.h:
extern NSColor * const kNiceBlueColor

globals.m:
#import globals.h

	NSColor * const kNiceBlueColor = [NSColor colorWithRed: 20 green:  
20 blue: 240 alpha:1];


I found some examples of this kind for defining a NSString using the  
@"foo"-syntax. With NSColor, it doesn't seem to work. I get the  
error "initializer element is not constant". Anyone any thoughts on  
this?



You can do something like your example above, but because you aren't  
allowed to send messages (or to call functions) from initialisers of  
global variables in C, you'd need to initialise them in some other way  
(for instance from an appropriate +initialize method).


Other alternatives (possibly safer, since you can't rely on the order  
in which +initialize methods are called) include:


-  Adding your new colours as new methods on a category of NSColor.

-  Adding your new colours as new methods on some global object in  
your application.


-  Adding your new colours as new methods on some other appropriate  
object in your app.


In all of these alternative cases, you'd probably actually end up with  
a static NSColor * and implement something like this:


  + (NSColor *)myNiceBlueColour
  {
static NSColor *myNiceBlueColour;

if (!myNiceBlueColour)
  myNiceBlueColour = [[NSColor alloc] initWithRed:0.1 green:0.1  
blue:0.8 alpha:1.0];


return myNiceBlueColour;
  }

(Remember, by the way, that you need to use floating point values  
between 0 and 1, rather than the integers you show in your example  
above.)


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: [iPhone] networking

2009-08-06 Thread Keith Duncan


On 6 Aug 2009, at 09:27, James Lin wrote:


[...]

keeps querrying the php/mysql server for message left for it with a  
querry to php/mysql server inside a  NSTimer (say querry once every  
30 seconds).


[...]

Is this my best option given what I want to accomplish?



I'm afraid it isn't, polling a server is a pretty bad idea, on the  
iPhone in particular; it will drain the battery quickly. It sounds  
like you need some kind of messaging server, to which the clients  
maintain a persistent connection.


Keith
___

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

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

2009-08-06 Thread James Lin

Can you please elaborate a bit more?

What technology option do I have when it comes to a "messaging server"?
What's involved on the iPhone's side?

Thank you in advance...

James

On 2009/8/6, at 下午 4:33, Keith Duncan wrote:



On 6 Aug 2009, at 09:27, James Lin wrote:


[...]

keeps querrying the php/mysql server for message left for it with a  
querry to php/mysql server inside a  NSTimer (say querry once every  
30 seconds).


[...]

Is this my best option given what I want to accomplish?



I'm afraid it isn't, polling a server is a pretty bad idea, on the  
iPhone in particular; it will drain the battery quickly. It sounds  
like you need some kind of messaging server, to which the clients  
maintain a persistent connection.


Keith


___

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

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

2009-08-06 Thread Roland King
is there actually any code for that anywhere? And is there any support 
built into the OSX (or iPhone) Bonjour implementation to do that so you 
could do say (totally made up code on classes which don't exist)


[ CFBonjour useUnicastDNSWithServer:your server here ]

or are you just saying that the protocol just relies on DNS lookups 
(which it does .. although it really is slanted towards broadcast) and 
you could if you wanted implement it like that, but you would actually 
have to write all the code yourself?



Keith Duncan wrote:


On 6 Aug 2009, at 09:13, Roland King wrote:

I've never seen any. I assume that as well as multicast dns there  are 
ways to configure bonjour to point to some central DNS server  which 
would enable something like that to work



Yes, you can use regular unicast DNS, and query a specified DNS server  
for SRV records.


Keith

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Core Data completely unable to find the source object model for migration

2009-08-06 Thread Matteo Manferdini
> Did you create a mapping model?
> If not, did you specify the NSInferMappingModelAutomaticallyOption option?

Yes, I did create one. But I think that the problem is not there,
since not knowing the source model, Core Data cannot infer the correct
mapping model.
For the manual migration I'm sure of this, because the code for the
mapping model is below the one for the source model (that returns
nil). This is my code (for manual migration)

NSString *applicationSupportFolder = [self applicationSupportFolder];
NSError *storeMetadataError = nil;
NSString *persistentStorePath = [applicationSupportFolder
stringByAppendingPathComponent: @"Heicos.sql"];
NSURL *persistentStoreURL = [NSURL fileURLWithPath:persistentStorePath];
NSDictionary *persistentStoreMetadata = [NSPersistentStoreCoordinator
metadataForPersistentStoreOfType:NSSQLiteStoreType
URL:persistentStoreURL error:&storeMetadataError];
if (!persistentStoreMetadata)
   [NSApp presentError:storeMetadataError];

//! If the model isn't compatible with the store, migrates the store
NSManagedObjectModel *destinationModel = [self managedObjectModel]; //
See note below
if (![destinationModel isConfiguration:nil
compatibleWithStoreMetadata:persistentStoreMetadata])
{
   NSManagedObjectModel *sourceModel = [NSManagedObjectModel
mergedModelFromBundles:nil forStoreMetadata:persistentStoreMetadata];
// Returns nil
   NSString *sourceStorePath = [persistentStorePath
stringByAppendingString:@"~"];
   [[NSFileManager defaultManager] movePath:persistentStorePath
toPath:sourceStorePath handler:nil];
   NSMigrationManager *migrationManager = [[NSMigrationManager alloc]
initWithSourceModel:sourceModel destinationModel:destinationModel];
   NSURL *sourceStoreUrl = [NSURL URLWithString:sourceStorePath];
   NSMappingModel *mappingModel = [NSMappingModel
mappingModelFromBundles:nil forSourceModel:sourceModel
destinationModel:destinationModel];
   NSError *migrationManagerError;
   if (![migrationManager migrateStoreFromURL:sourceStoreUrl
type:NSSQLiteStoreType options:nil withMappingModel:mappingModel
toDestinationURL:persistentStoreURL destinationType:NSSQLiteStoreType
destinationOptions:nil error:&migrationManagerError])
   [NSApp presentError:migrationManagerError];
}

Note:
I tried to implement the managedObjectModel: method in three ways, but
none of them works:

1) XCode Core Data template code:

NSMutableSet *allBundles = [[NSMutableSet alloc] init];
[allBundles addObject: [NSBundle mainBundle]];
[allBundles addObjectsFromArray: [NSBundle allFrameworks]];
managedObjectModel = [NSManagedObjectModel
mergedModelFromBundles:[allBundles allObjects]];
return managedObjectModel;

2) Keeping the models in the .xcdatamodeld directory

managedObjectModel = [[NSManagedObjectModel alloc]
initWithContentsOfURL:[NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"MacZone_DataModel" ofType:@"momd"]]];
return managedObjectModel;

3) Moving the models out of the .xcdatamodeld directory, making them
top level resources in the main bundle:

managedObjectModel = [[NSManagedObjectModel alloc]
initWithContentsOfURL:[NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"MacZone_DataModel" ofType:@"mom"]]];
return managedObjectModel;

Thank you.


-- 
Matteo Manferdini
Pawn Software
www.pawn-soft.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: defining NSColor constants

2009-08-06 Thread Graham Cox
Maybe the issue is avoiding a lot of typing for a longish list of  
colours? Back in the day when struct RGBColor was the mechanism, it  
was fairly easy to set up long lists of const values and refer to an  
item by name. Doing this with NSColor is not so straightforward, and  
making each colour a separate method is a lot of duplication. So  
here's a possible solution.


List your colours like this:

const float kNiceBlueColour[] = {0.2, 0.2, 0.9, 1.0};
const float kBrightRed[] = {1.0, 0, 0, 1.0};

etc. Numbers are listed in RGBA order.

Then add a class method to NSColor in a category:

+ (NSColor*)calibratedRGBColorWithValues:(const float*) values;

Then you can write code such as:

NSColor* myColour = [NSColor  
calibratedRGBColorWithValues:kNiceBlueColour];



Naturally the implementation of the category method would go:

+ (NSColor*)calibratedRGBColorWithValues:(const float*) values
{
// sanity checking of  and possible caching omitted for clarity

	return [self colorWithCalibratedRed:values[0] green:values[1]  
blue:values[2] alpha:values[3]];

}

Still too wordy? You could wrap that in a macro to make it even easier:


#define COLOUR( x ) ([NSColor calibratedRGBColorWithValues:x])

usage:

myColor = COLOUR( kLightBlueColour );




--Graham




On 06/08/2009, at 6:32 PM, Alastair Houghton wrote:


On 6 Aug 2009, at 07:58, Arie Pieter Cammeraat wrote:


I would like a more obj-c style, like
globals.h:
extern NSColor * const kNiceBlueColor

globals.m:
#import globals.h

	NSColor * const kNiceBlueColor = [NSColor colorWithRed: 20 green:  
20 blue: 240 alpha:1];


I found some examples of this kind for defining a NSString using  
the @"foo"-syntax. With NSColor, it doesn't seem to work. I get the  
error "initializer element is not constant". Anyone any thoughts on  
this?



You can do something like your example above, but because you aren't  
allowed to send messages (or to call functions) from initialisers of  
global variables in C, you'd need to initialise them in some other  
way (for instance from an appropriate +initialize method).


Other alternatives (possibly safer, since you can't rely on the  
order in which +initialize methods are called) include:


-  Adding your new colours as new methods on a category of NSColor.

-  Adding your new colours as new methods on some global object in  
your application.


-  Adding your new colours as new methods on some other appropriate  
object in your app.


In all of these alternative cases, you'd probably actually end up  
with a static NSColor * and implement something like this:


 + (NSColor *)myNiceBlueColour
 {
   static NSColor *myNiceBlueColour;

   if (!myNiceBlueColour)
 myNiceBlueColour = [[NSColor alloc] initWithRed:0.1 green:0.1  
blue:0.8 alpha:1.0];


   return myNiceBlueColour;
 }

(Remember, by the way, that you need to use floating point values  
between 0 and 1, rather than the integers you show in your example  
above.)


Kind regards,

Alastair.


___

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

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

2009-08-06 Thread Mahaboob
Yeah, you are right.
I did my own code and is working well for me.
My code is :

srandom(time(NULL));
BOOL val;
val = FALSE;
array = [[NSMutableArray alloc]initWithCapacity:15];
firstNo = random()%15+1;
[array addObject:[NSNumber numberWithInt:firstNo]];
for(i=1;i<15;i++){
firstNo = random()%15+1;
for(j=0;j<[array count];j++){

if((firstNo == [[array objectAtIndex:j]intValue] )){
i--;
val = TRUE;
break;
}

}
if(val){   
val = FALSE;
continue;
}
else{  

[array addObject:[NSNumber numberWithInt:firstNo]];

}
}


Thanks


On 8/6/09 1:50 PM, "Alastair Houghton"  wrote:

> On 6 Aug 2009, at 05:59, Mahaboob wrote:
> 
>> Thanks.
>> It is working well.
> 
> I'll say again, off-list, you probably don't want to use Agha Khan's
> code; it generates biased results, which are bad in almost all
> applications.  Take a look at the Wikipedia article I pointed you at,
> here, for (a) an algorithm that works, and (b) some notes on
> generating random numbers:
> 
>
> 
> 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


Accessor methods in Category

2009-08-06 Thread Mahaboob
Is it possible to use accessor methods in category?
I need to add one for UIButton class.
How can I do it?

Thanks in advance 
Mahaboob.


___

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

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

2009-08-06 Thread Graham Cox


On 06/08/2009, at 10:11 PM, Mahaboob wrote:


Is it possible to use accessor methods in category?
I need to add one for UIButton class.
How can I do it?



You can add any methods in a category. What you can't add are  
additional ivars, so if the base class doesn't have the ivar you need,  
you're out of luck. You need to subclass to add ivars.


--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: Accessor methods in Category

2009-08-06 Thread Mahaboob

I subclassed the UIButton class like:

@interface MoveButton : UIButton {
BOOL canMove;
}

@property(readwrite) BOOL canMove;
@end

@implementation MoveButton
@synthesize canMove;

My main class contains a number of UIButton outlets.
How can I use this function with my outlets ?

On 8/6/09 5:49 PM, "Graham Cox"  wrote:

> 
> On 06/08/2009, at 10:11 PM, Mahaboob wrote:
> 
>> Is it possible to use accessor methods in category?
>> I need to add one for UIButton class.
>> How can I do it?
> 
> 
> You can add any methods in a category. What you can't add are
> additional ivars, so if the base class doesn't have the ivar you need,
> you're out of luck. You need to subclass to add ivars.
> 
> --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: Accessor methods in Category

2009-08-06 Thread Graham Cox


On 06/08/2009, at 10:32 PM, Mahaboob wrote:


I subclassed the UIButton class like:

@interface MoveButton : UIButton {
   BOOL canMove;
}

@property(readwrite) BOOL canMove;
@end

@implementation MoveButton
@synthesize canMove;

My main class contains a number of UIButton outlets.
How can I use this function with my outlets ?



[myButtonOutlet1 setCanMove:YES];

BOOL moveable = [myButtonOutlet1 canMove];

???

--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: Accessor methods in Category

2009-08-06 Thread Alastair Houghton

On 6 Aug 2009, at 13:32, Mahaboob wrote:


I subclassed the UIButton class like:

@interface MoveButton : UIButton {
   BOOL canMove;
}

@property(readwrite) BOOL canMove;
@end

@implementation MoveButton
@synthesize canMove;

My main class contains a number of UIButton outlets.
How can I use this function with my outlets ?


Perhaps the missing information here is that you need to set the  
buttons in question to be of your custom class?  You can do this in  
Interface Builder by selecting them, then using the Inspector to  
change their class to MoveButton.  You might also want to change the  
type of your outlets to MoveButton *, otherwise you'll need to cast a  
lot to avoid warnings.


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: [iPhone] networking

2009-08-06 Thread Jeremy Pereira


On 6 Aug 2009, at 09:27, James Lin wrote:



Is this my best option given what I want to accomplish?

Thanks in advance...


Stepping back a little bit.  Are you trying to build some sort of real  
time messaging service?  Or does it matter if the second phone doesn't  
receive the message straight away?


Have you considered sending an SMS message from one phone to the other?

Actually scratch that, there's no official iPhone SMS API according to  
Google.


Or what about setting up a mail server?  iPhone 1 sends the message  
using SMTP and iPhone 2 retrieves it using IMAP.





James
___

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

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

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

This email sent to a...@jeremyp.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: Disabling Exposé in SystemUIMode

2009-08-06 Thread Sean McBride
On 8/5/09 7:39 PM, Pierce Freeman said:

>Which version of OS X are you using?  With the latest of Leopard, it just
>doesn't seem to work.

Are you using the same flags are Ricky?

I use SetSystemUIMode (kUIModeAllSuppressed, 0) and Exposé is allowed
(which I want).  Or do you mean this broke in 10.5.8 (which I haven't
installed yet).

--

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


Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Pierce Freeman
Hi Sean:

Yeah, I completely copied his code and inserted it into my project.  Even
odder, it doesn't allow the Apple-Tab function (which is what it is supposed
to do) but lets Exposé work just fine.

I don't mean that it broke in the latest version of Leopard, as the "old"
version I was using still did not have it enabled.  I was wondering if it
worked on Leopard at all, and based on your reply it does.  So I don't have
much idea as to what to try now.


On 8/6/09 7:56 AM, "Sean McBride"  wrote:

> On 8/5/09 7:39 PM, Pierce Freeman said:
> 
>> Which version of OS X are you using?  With the latest of Leopard, it just
>> doesn't seem to work.
> 
> Are you using the same flags are Ricky?
> 
> I use SetSystemUIMode (kUIModeAllSuppressed, 0) and Exposé is allowed
> (which I want).  Or do you mean this broke in 10.5.8 (which I haven't
> installed yet).
> 
> --
> 
> 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


Re: [iPhone] Webview stringByEvaluatingJavaScriptFromString

2009-08-06 Thread Development
It's always the smallest mistake that can frustrate a person no end.  
Several people caught what I did not. getElementByName was what I  
wanted... getElementsByName is what I typed. Thank you every one for  
the catch and I'm sorry for using up bandwidth over a typo.


On Aug 5, 2009, at 8:44 PM, Andrew Farmer wrote:


On 5 Aug 2009, at 12:08, Development wrote:
NSString * aString =[theWebView  
stringByEvaluatingJavaScriptFromString 
:@"document.getElementsByName(\"encrypted\").value"];



This Javascript will never work correctly, no matter whether it's  
from HTML or from ObjC. getElementsByName returns a collection, not  
an element.


___

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

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

2009-08-06 Thread Sean McBride
On 8/6/09 8:38 PM, Graham Cox said:

>Then add a class method to NSColor in a category:
>
>+ (NSColor*)   calibratedRGBColorWithValues:(const float*) values;

Nitpick: use CGFloat instead of float to match NSColor.  Especially
since you're passing an array of float/doubles.

--

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


Re: [iPhone] networking

2009-08-06 Thread James Lin
well...I guess you can call it some sort of real time messaging  
service...


I just need to send a string from iPhoneA to iPhoneB.
And allow iPhoneB to reply with another string back to iPhoneA.

That's all I am trying to do.
I had no idea it is so difficult and involves so much.

given my state of confusion right now, any suggestion you can give me  
is much appreciated...


Thanx in advance...

James
On 2009/8/6, at 下午 10:18, Jeremy Pereira wrote:



On 6 Aug 2009, at 09:27, James Lin wrote:



Is this my best option given what I want to accomplish?

Thanks in advance...


Stepping back a little bit.  Are you trying to build some sort of  
real time messaging service?  Or does it matter if the second phone  
doesn't receive the message straight away?


Have you considered sending an SMS message from one phone to the  
other?


Actually scratch that, there's no official iPhone SMS API according  
to Google.


Or what about setting up a mail server?  iPhone 1 sends the message  
using SMTP and iPhone 2 retrieves it using IMAP.





James
___

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

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

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

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




___

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

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

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

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


Re: [iPhone] networking

2009-08-06 Thread Dave Camp

On Aug 6, 2009, at 8:30 AM, James Lin wrote:

well...I guess you can call it some sort of real time messaging  
service...


I just need to send a string from iPhoneA to iPhoneB.
And allow iPhoneB to reply with another string back to iPhoneA.

That's all I am trying to do.
I had no idea it is so difficult and involves so much.

given my state of confusion right now, any suggestion you can give  
me is much appreciated...


I think Push Notifications might be what you need. Phone A sends a  
message to the server, which uses Push Notification to send a message  
to Phone B. You can read about Push Notifications on the iPhone dev  
site (off topic for the Cocoa list).


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: Generating random numbers

2009-08-06 Thread Jeremy Pereira

That's a bit convoluted.  How about:

srandom(time(NULL));
array = [[NSMutableArray alloc] init];
while ([array count] < 15)
{
int randomNo = random() % 15 + 1;   // Gives biased results, by the 
way
NSNumber numberToAdd = [NSNumber numberWithInt: randomNo];
if (![array containsObject: numberToAdd])
{
[array addObject: numberToAdd];
}
}

(Written in mail and not compiled or tested).

On 6 Aug 2009, at 13:08, Mahaboob wrote:


Yeah, you are right.
I did my own code and is working well for me.
My code is :

  srandom(time(NULL));
  BOOL val;
  val = FALSE;
  array = [[NSMutableArray alloc]initWithCapacity:15];
  firstNo = random()%15+1;
  [array addObject:[NSNumber numberWithInt:firstNo]];
  for(i=1;i<15;i++){
  firstNo = random()%15+1;
  for(j=0;j<[array count];j++){

  if((firstNo == [[array objectAtIndex:j]intValue] )){
  i--;
  val = TRUE;
  break;
  }

  }
  if(val){
  val = FALSE;
  continue;
  }
  else{

  [array addObject:[NSNumber numberWithInt:firstNo]];

  }
  }


Thanks


On 8/6/09 1:50 PM, "Alastair Houghton" place.net> wrote:



On 6 Aug 2009, at 05:59, Mahaboob wrote:


Thanks.
It is working well.


I'll say again, off-list, you probably don't want to use Agha Khan's
code; it generates biased results, which are bad in almost all
applications.  Take a look at the Wikipedia article I pointed you at,
here, for (a) an algorithm that works, and (b) some notes on
generating random numbers:

 

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/adc%40jeremyp.net

This email sent to a...@jeremyp.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: Generating random numbers

2009-08-06 Thread Mac First
Not strictly Cocoa, but a trick I recently incorporated to remove the  
mod-bias is (email code):


float frand = (random() * 1.0) / (RAND_MAX * 1.0); // gives  
0.0-0.9...

int myRand = frand * 15;  // to get a number from 0-14, inclusive.


On Aug 6, 2009, at 9:12 AM, Jeremy Pereira wrote:

That's a bit convoluted.  How about:

srandom(time(NULL));
array = [[NSMutableArray alloc] init];
while ([array count] < 15)
{
int randomNo = random() % 15 + 1;   // Gives biased results, by the 
way
NSNumber numberToAdd = [NSNumber numberWithInt: randomNo];
if (![array containsObject: numberToAdd])
{
[array addObject: numberToAdd];
}
}



--
Carpe DM -- Seize the Dungeon Master


___

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

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

2009-08-06 Thread Pavel Dudrenov
I dunno about that. Ether give the element an id and use getElementById, or
use getElementsByName(theName)[0].

On Thu, Aug 6, 2009 at 8:20 AM, Development wrote:

> It's always the smallest mistake that can frustrate a person no end.
> Several people caught what I did not. getElementByName was what I wanted...
> getElementsByName is what I typed. Thank you every one for the catch and I'm
> sorry for using up bandwidth over a typo.
>
>
> On Aug 5, 2009, at 8:44 PM, Andrew Farmer wrote:
>
>  On 5 Aug 2009, at 12:08, Development wrote:
>>
>>> NSString * aString =[theWebView stringByEvaluatingJavaScriptFromString:@
>>> "document.getElementsByName(\"encrypted\").value"];
>>>
>>
>>
>> This Javascript will never work correctly, no matter whether it's from
>> HTML or from ObjC. getElementsByName returns a collection, not an element.
>>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/dudrenov%40gmail.com
>
> This email sent to dudre...@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


[OT] Re: Generating random numbers

2009-08-06 Thread Alastair Houghton

On 6 Aug 2009, at 17:21, Mac First wrote:

Not strictly Cocoa, but a trick I recently incorporated to remove  
the mod-bias is (email code):


float frand = (random() * 1.0) / (RAND_MAX * 1.0); // gives  
0.0-0.9...

int myRand = frand * 15;  // to get a number from 0-14, inclusive.


That isn't completely unbiased either.  It is an *improvement*, to be  
sure (though you could do the same thing with integers rather than  
resorting to floating-point).  (Take a look at the link I posted  
previously where it discusses this technique also.)


And as for "Not strictly Cocoa", this entire thread is "Not strictly  
Cocoa", as I may already have mentioned...


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


Change Opacity of Image

2009-08-06 Thread Pierce Freeman
Hi Everyone:

I am looking for an easy way to fade into one photo from another photo.  In
other words, from the middle "point", you can see both of the photos on top
of each other to compare the changes.  I am currently using Quartz to do
this, but am running into a lot of trouble with that, so I am wondering what
you all would suggest.  I would be happy to send over my current project if
you would like - it's based off of Scott Stevenson's tutorial here:
http://cocoadevcentral.com/d/intro_to_quartz_two/.


Thanks for any help.


___

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

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

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

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


How to change to the smoother single-stage animation

2009-08-06 Thread Agha Khan

Hi:
I am getting this message.
Using two-stage rotation animation. To use the smoother single-stage  
animation, this application must remove two-stage method  
implementations.


Any idea how to change to smoother single-stage animation?

Agha

___

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

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

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

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


Re: Change Opacity of Image

2009-08-06 Thread Pavel Dudrenov
Look into NSImage and NSCompositingOperation.

On Thu, Aug 6, 2009 at 10:17 AM, Pierce Freeman  wrote:

> Hi Everyone:
>
> I am looking for an easy way to fade into one photo from another photo.  In
> other words, from the middle "point", you can see both of the photos on top
> of each other to compare the changes.  I am currently using Quartz to do
> this, but am running into a lot of trouble with that, so I am wondering
> what
> you all would suggest.  I would be happy to send over my current project if
> you would like - it's based off of Scott Stevenson's tutorial here:
> http://cocoadevcentral.com/d/intro_to_quartz_two/.
>
>
> Thanks for any help.
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/dudrenov%40gmail.com
>
> This email sent to dudre...@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: Design Question

2009-08-06 Thread Quincey Morris

On Aug 6, 2009, at 07:46, Kaelten wrote:


I guess what I'm wondering then is how do I handle the
following case.  I have several loosely coupled properties which can
read somewhat like this.

(ProjectInstall *)projectInstall {
   return [ProjectInstallController  
projectInstallWithProjectId:projectId];

}

And in some cases it's completely legit for the loose coupled
properties to return nil

What's the right way for this property to be KVO/KVC compliant?  I
really do like bindings and believe that it's absolutely possible to
get it done right I'm just trying to figure it out.


First, I say again, *properties* aren't KVO compliant. *Objects* are  
KVO compliant (or not) for each of their properties. Your question  
can't be answered  without knowing what class implements  
'projectInstall' -- and whether 'projectInstall' is a class or  
instance method, since you dropped the "+" or "-".


Assuming this is an instance method of a class named (say) Project,  
which has an instance variable 'projectId', ask yourself what the  
returned value depends on:


If 'projectId' changes, does that need to trigger an update of the  
value of 'projectInstall' in its observers? (If not, 'projectInstall'  
isn't really a property.) If so, and 'projectId' is itself a KVO- 
compliant property, then you can use  
setKeys:triggerChangeNotificationsForDependentKey: to set up a  
dependency. If 'projectId' isn't a KVO-compliant property, you'll need  
to trigger KVO notifications manually (using will/ 
didChangeValueForKey:@"projectInstall") *wherever* your Project class  
changes the value of projectId.


Does [ProjectInstallController projectInstallWithProjectId:projectId]  
always return the same value for a given value of 'projectId'? If so,  
there's nothing else to do. If not, then you need to make  
'projectInstall' dependent on whatever affects the value returned by  
ProjectInstallController. If you can't determine that, then again  
'projectInstall' isn't really a property.


I have to add that it's a bit suspicious that your 'projectInstall'  
property (of a data model object) apparently has to ask a controller  
object for data. (Let's hope that 'projectInstallWithProjectId:' isn't  
a factory method.) It's hard to know without more context, but this  
suggests your MVC design mightn't be well-formed. If that's true,  
you're likely to have deeper reasons for not being able to ensure KVO  
compliance.


Finally, the question of whether 'projectInstall' sometimes returns  
nil is irrelevant. That has nothing to do with the compliance of the  
Project object.



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Core Data completely unable to find the source object model for migration

2009-08-06 Thread Matteo Manferdini
To further investigate the matter, I logged the contents of both the
NSStoreModelVersionHashesKey dictionary from my store metadata and the
dictionary returned by the entityVersionHashesByName: method of my
source model. I did this both for my working app without versioning
and the not working one with versioning.

What I discovered is that in the first case the hashes are the same
for the model and the store, while in the second case the model has
lost a lot of metadata in the versioning process. Along with my
entities there are also other entities listed in the hashes (to name a
few: CalDAVCalendar, CalendarChangeRequest, LocalGroup, etc). These
entities hashes are lost in the versioned model, while my entities
hashes remain the same.

Any idea of why this is happening? It seems to me that this is an XCode bug.
Thank you.


Thank you very much.
Regards.

Matteo Manferdini
Pawn Software
www.pawn-soft.com
___

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

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

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

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


Re: How to change to the smoother single-stage animation

2009-08-06 Thread Hank Heijink (Mailinglists)
This is new in iPhone OS 3.0. From the documentation for  
UIViewController:


- (void)willAnimateFirstHalfOfRotationToInterfaceOrientation: 
(UIInterfaceOrientation) toInterfaceOrientationduration: 
(NSTimeInterval)duration


[...]

The default implementation of this method does nothing. If you  
override this method (or  
thewillAnimateSecondHalfOfRotationFromInterfaceOrientation:duration:  
method), the view controller always performs rotation animations in  
two steps. To configure animations using the one-step technique,  
override thewillAnimateRotationToInterfaceOrientation:duration: method  
instead.


You have to remove your override for the above method as well as the  
one for the corresponding method for the second half of the rotation.


Best,
Hank

On Aug 6, 2009, at 1:27 PM, Agha Khan wrote:


Hi:
I am getting this message.
Using two-stage rotation animation. To use the smoother single-stage  
animation, this application must remove two-stage method  
implementations.


Any idea how to change to smoother single-stage animation?

Agha

___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/hank.list 
%40runbox.com


This email sent to hank.l...@runbox.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: Two right buttons on UINavigationBar?

2009-08-06 Thread Hank Heijink (Mailinglists)
If one of your buttons is always hidden, why do you need two buttons?  
You can just use one button and change the title, target, and action  
when you need to. If necessary you can even replace the whole button.


Hank

On Aug 6, 2009, at 1:47 AM, Agha Khan wrote:


Hi:
I have a UINavigationBar where I would like to place 2 buttons. I  
was looking UINavigationBar.h for its implementation and didn't see  
the way we could add more than 2 buttons(Right hand side and left  
hand siderightBarButtonItem ) but my both buttons are  
rightBarButtonsItems where one of them is always hidden. I need 2  
buttons because they point to 2 different click functions and  
different captions.



You might have better idea?

Best regards
Agha___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/hank.list 
%40runbox.com


This email sent to hank.l...@runbox.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: adding a sub menu to multiple super menus?

2009-08-06 Thread Jerry Krinock


On 2009 Aug 05, at 22:08, Graham Cox wrote:



On 06/08/2009, at 5:41 AM, David M. Cotter wrote:

in carbon, you can have a sub menu that is used in more than one  
super menu.


is there a trick to get this to go in Cocoa?


As far as I know a menu has to be a distinct instance - you can't  
share them. I think I tried it once and it failed miserably.


I've never tried that, but one thing that would work is to generate  
the menu on the fly when it's needed.  You can use the same method to  
generate each submenu.  For example, I have a contextual menu item  
which contains two items "Copy To ->" and "Move To ->".  The method  
you'll want to use is -menuNeedsUpdate.  The stated purpose of this  
method is for lazy generation of hierarchical menus, but it should  
work for David's purpose also.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: "Could not support development." (after updating iPhone to 3.0.1)

2009-08-06 Thread Dennis Munsie
Kevin --
I've ran into this problem a few times and what ended up fixing it was
rebooting the phone.

It seems to happen more often after I sync my phone with iTunes, but I'm not
100% sure as to if that's the cause or not.

dennis

On Tue, Aug 4, 2009 at 9:28 PM, Kevin Callahan  wrote:

> After updating my iPhone to 3.0.1 and after running:
>
> ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\)
> /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1
>
> I continue to get:
> "Could not support development."
>
> Both dev and ad hoc profiles are showing as good in Organizer.
>
>
> Solution?
>
> Thanks.
> Kevin
> http://www.kevincallahan.org/main/guitarist.html
> http://www.kevincallahan.org/main/composer.html
> http://www.kevincallahan.org/software/accessorizer.html
> http://www.xeniamara.com/Jewelry/Welcome.html
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/dmunsie%40gmail.com
>
> This email sent to dmun...@gmail.com
>



-- 
dennis
___

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

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

2009-08-06 Thread Mark Szymczyk

How are you "adding elements to the XML document"? If you're calling
add... methods on the NSXML... objects, you'd expect the sort of
results you're seeing -- AFAIK the proxy tree maintained by the
NSTreeController has no way of knowing that you changed the underlying
data model, since AFAIK KVO is not in operation for the tree
structure. Did you try constructing the NSXML... objects you want to
add, then tell the NSTreeController to add them?


I was calling the NSXML add methods. Thanks for pointing that out.

I tried creating the NSXML objects I want to add and adding them to  
the tree controller using the add:, addChild:, insert:, and  
insertChild: methods, and I get the same results. The methods canAdd:,  
canAddChild:, canInsert:, and canInsertChild: all return NO.


Mark
___

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

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

2009-08-06 Thread douglas welton

Core Image Filters are your friend.

Check out the CIFilter reference documentation and you'll find bunches  
of filters to handle compositing.



On Aug 6, 2009, at 1:29 PM, Pavel Dudrenov wrote:


Look into NSImage and NSCompositingOperation.

On Thu, Aug 6, 2009 at 10:17 AM, Pierce Freeman 
wrote:



Hi Everyone:

I am looking for an easy way to fade into one photo from another  
photo.  In
other words, from the middle "point", you can see both of the  
photos on top
of each other to compare the changes.  I am currently using Quartz  
to do
this, but am running into a lot of trouble with that, so I am  
wondering

what
you all would suggest.  I would be happy to send over my current  
project if

you would like - it's based off of Scott Stevenson's tutorial here:
http://cocoadevcentral.com/d/intro_to_quartz_two/.


Thanks for any help.


___

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

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

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

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


Re: NSOutlineView Not Updating After Adding Items

2009-08-06 Thread Quincey Morris

On Aug 6, 2009, at 12:19, Mark Szymczyk wrote:


I was calling the NSXML add methods. Thanks for pointing that out.


Well, I gave you the wrong answer. That may have been the correct way  
after all.


I tried creating the NSXML objects I want to add and adding them to  
the tree controller using the add:, addChild:, insert:, and  
insertChild: methods, and I get the same results. The methods  
canAdd:, canAddChild:, canInsert:, and canInsertChild: all return NO.


That was also the wrong answer. These methods don't add an object you  
create. For that, you need to use  
'insertObject:atArrangedObjectIndexPath:'.


But NSXMLElement does claim KVO compliance for 'children', so your  
original approach should have been fine. And, if not, invoking  
'rearrangeObjects' should have taken care of it.


The next step is probably to examine the NSTreeNode structure of the  
NSTreeController's arrangedObjects after you add an element, and  
decide whether the NSTreeController is missing the change, or if the  
NSOutlineView is missing the change.



___

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

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

2009-08-06 Thread Pierce Freeman
Hi Pavel:

Thanks for the suggestion.  How would you suggest I get the NSImage to the
screen, a custom NSView, NSImageWell, etc?


On 8/6/09 10:29 AM, "Pavel Dudrenov"  wrote:

> Look into NSImage and NSCompositingOperation.
> 
> On Thu, Aug 6, 2009 at 10:17 AM, Pierce Freeman 
> wrote:
>> Hi Everyone:
>> 
>> I am looking for an easy way to fade into one photo from another photo.  In
>> other words, from the middle "point", you can see both of the photos on top
>> of each other to compare the changes.  I am currently using Quartz to do
>> this, but am running into a lot of trouble with that, so I am wondering what
>> you all would suggest.  I would be happy to send over my current project if
>> you would like - it's based off of Scott Stevenson's tutorial here:
>> http://cocoadevcentral.com/d/intro_to_quartz_two/.
>> 
>> 
>> Thanks for any help.
>> 
>> 
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/dudrenov%40gmail.com
>> 
>> This email sent to dudre...@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


Mixing Objective-C and C++ classes; How?

2009-08-06 Thread Michael A. Crawford
Should the following work (assuming it is included in an Objective-C  
file with a .mm extension)?


@interface CDBPMDetectOperation : NSOperation 
{
class BPMDetect* bpmDetector; // C++ class as an objective-c  
class member

}

-Michael





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: Mixing Objective-C and C++ classes; How?

2009-08-06 Thread Shawn Erickson
On Thu, Aug 6, 2009 at 1:51 PM, Michael A.
Crawford wrote:
> Should the following work (assuming it is included in an Objective-C file
> with a .mm extension)?
>
> @interface CDBPMDetectOperation : NSOperation 
> {
>    class BPMDetect* bpmDetector; // C++ class as an objective-c class member
> }

/me points at...



-Shawn
___

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

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

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

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


Re: Change Opacity of Image

2009-08-06 Thread Pierce Freeman
Hi Douglas:

Do you have one that you can suggest?  It doesn't have to do much - just
change the opacity.


On 8/6/09 12:46 PM, "douglas welton"  wrote:

> Core Image Filters are your friend.
> 
> Check out the CIFilter reference documentation and you'll find bunches
> of filters to handle compositing.
> 
> 
> On Aug 6, 2009, at 1:29 PM, Pavel Dudrenov wrote:
> 
>> Look into NSImage and NSCompositingOperation.
>> 
>> On Thu, Aug 6, 2009 at 10:17 AM, Pierce Freeman >> wrote:
>> 
>>> Hi Everyone:
>>> 
>>> I am looking for an easy way to fade into one photo from another
>>> photo.  In
>>> other words, from the middle "point", you can see both of the
>>> photos on top
>>> of each other to compare the changes.  I am currently using Quartz
>>> to do
>>> this, but am running into a lot of trouble with that, so I am
>>> wondering
>>> what
>>> you all would suggest.  I would be happy to send over my current
>>> project if
>>> you would like - it's based off of Scott Stevenson's tutorial here:
>>> http://cocoadevcentral.com/d/intro_to_quartz_two/.
>>> 
>>> 
>>> Thanks for any help.
> 


___

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

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

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

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


Re: Disabling Exposé in SystemUIMode

2009-08-06 Thread Ricky Sharp


On Aug 5, 2009, at 9:39 PM, Pierce Freeman wrote:

Which version of OS X are you using?  With the latest of Leopard, it  
just

doesn't seem to work.



When writing my initial response to this thread, it was 10.5.7.

Just tested with 10.5.8 and all is still well (no Expose, no process  
switching).


___
Ricky A. Sharp mailto:rsh...@instantinteractive.com
Instant Interactive(tm)   http://www.instantinteractive.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: Disabling Exposé in SystemUIMode

2009-08-06 Thread Pierce Freeman
Really odd, do you think you could send me a little example to see if your
same code works on my system?


On 8/6/09 2:59 PM, "Ricky Sharp"  wrote:

> 
> On Aug 5, 2009, at 9:39 PM, Pierce Freeman wrote:
> 
>> Which version of OS X are you using?  With the latest of Leopard, it
>> just
>> doesn't seem to work.
> 
> 
> When writing my initial response to this thread, it was 10.5.7.
> 
> Just tested with 10.5.8 and all is still well (no Expose, no process
> switching).
> 
> ___
> Ricky A. Sharp mailto:rsh...@instantinteractive.com
> Instant Interactive(tm)   http://www.instantinteractive.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: Disabling Exposé in SystemUIMode

2009-08-06 Thread Ricky Sharp


On Aug 6, 2009, at 10:10 AM, Pierce Freeman wrote:

Yeah, I completely copied his code and inserted it into my project.   
Even
odder, it doesn't allow the Apple-Tab function (which is what it is  
supposed

to do) but lets Exposé work just fine.

I don't mean that it broke in the latest version of Leopard, as the  
"old"
version I was using still did not have it enabled.  I was wondering  
if it
worked on Leopard at all, and based on your reply it does.  So I  
don't have

much idea as to what to try now.



Hmm, I wonder if it has something to do with how I create my windows?

I create "blanking" windows and put one of those on each screen  
(borderless window covers entire screen).  Then, I create a content  
window (also borderless) that is then set to appropriate size (1024 x  
768 in my case), centered on, and made a child of, the blanking window  
on the main screen.


The call to SetSystemUIMode is made in applicationDidFinishLaunching:  
before I create windows.


Both the blanking and content windows are subclasses of NSWindow.

Blanking window's designated initializer is just a thin wrapper around  
NSWindow's initWithContentRect:styleMask:backing:defer:


- styleMask is NSBorderlessWindowMask
- backing is NSBackingStoreBuffered
- defer is NO

I then set these additional attributes:

- hidesOnDeactivate (YES)
- releasedWhenClosed (NO)
- movableByWindowBackground (NO)
- hasShadow (NO)
- optimizedDrawing (YES)
- opaque (YES)

I also override canBecomeKeyWindow (returns NO) and  
canBecomeMainWindow (also returns NO).



In my content window subclass, same setup as blanking window (in terms  
of attributes listed above).  And, overrides to canBecomeKeyWindow and  
canBecomeMainWindow return YES.



___
Ricky A. Sharp mailto:rsh...@instantinteractive.com
Instant Interactive(tm)   http://www.instantinteractive.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: Mac OS X 10.5.8 update breaks tokenize function in -[NSXMLNode objectsForXQuery:error:]

2009-08-06 Thread Michael Link
After some more investigation I've discovered that XQuery was updated  
in Mac OS X 10.5.8 as part of a security vulnerability in the PCRE  
library which it includes.


http://support.apple.com/kb/HT3757 (scroll to bottom of page)

Which also explains why all XQuery functions using regular expressions  
are also broken. Digging into the PCRE portion of the XQuery code  
reveals the following PCRE error string after trying to compile a  
regular expression:


"this version of PCRE is not compiled with PCRE_UTF8 support"

#0  0x0010f430 in pcre_compile
#1  0x00100495 in -[XQueryRegEx initExpr:withFlags:]
#2  0x000ff944 in +[XQueryRegEx regExp:withFlags:]
#3  0x000ce8e3 in fn_tokenize
#4  0x000db9cd in -[XQueryFunctionCall evaluateWithContext:]
#5  0x000f62b5 in -[XQueryExprList evaluateWithContext:]
#6	0x00102a9a in -[XQueryContext  
evaluateXQuery:constants:contextItem:error:]

#7  0x92201d98 in -[NSXMLNode objectsForXQuery:constants:error:]
#8  0x92303338 in -[NSXMLNode objectsForXQuery:error:]
#9  0x1d04 in -[Bug7037807 performXQuery:] at Bug7037807.m:40
#10 0x1c15 in -[Bug7037807 awakeFromNib] at Bug7037807.m:27
#11 0x9310f7f5 in -[NSSet makeObjectsPerformSelector:]
#12	0x910d2d8e in -[NSIBObjectData  
nibInstantiateWithOwner:topLevelObjects:]

#13 0x910c8fba in loadNib
#14	0x910c891c in +[NSBundle(NSNibLoading)  
_loadNibFile:nameTable:withZone:ownerBundle:]
#15	0x910c855f in +[NSBundle(NSNibLoading)  
loadNibFile:externalNameTable:withZone:]

#16 0x910c849d in +[NSBundle(NSNibLoading) loadNibNamed:owner:]
#17 0x910c814c in NSApplicationMain
#18 0x1ae8 in main at main.m:13

Dump of assembler code for function pcre_compile:
0x0010f3fb :  push   %ebp
0x0010f3fc :  mov%esp,%ebp
0x0010f3fe :  sub$0x28,%esp
0x0010f401 :  mov0x18(%ebp),%eax
0x0010f404 :  movl   $0x0,0x8(%esp)
0x0010f40c : mov%eax,0x14(%esp)
0x0010f410 : mov0x14(%ebp),%eax
0x0010f413 : mov%eax,0x10(%esp)
0x0010f417 : mov0x10(%ebp),%eax
0x0010f41a : mov%eax,0xc(%esp)
0x0010f41e : mov0xc(%ebp),%eax
0x0010f421 : mov%eax,0x4(%esp)
0x0010f425 : mov0x8(%ebp),%eax
0x0010f428 : mov%eax,(%esp)
0x0010f42b : call   0x10eb91 
0x0010f430 : leave
0x0010f431 : ret
End of assembler dump.
(gdb) x/i $eip
0x10f430 :   leave

(gdb) p *(int*)($ebp + 16)
$26 = -1073745996
(gdb) p *$26
$27 = 1254561
(gdb) x/s $27
0x1324a1 :	 "this version of PCRE is not compiled  
with PCRE_UTF8 support"


Did someone forget to turn on a compile flag?

--
Michael
___

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

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

2009-08-06 Thread Pierce Freeman
That's definitely a possibility.  However, I am basically creating my
windows the same way that you are.  The only difference is, I didn't set any
of those attributes and my main window just appears by "Cocoa default".


On 8/6/09 3:10 PM, "Ricky Sharp"  wrote:

> 
> On Aug 6, 2009, at 10:10 AM, Pierce Freeman wrote:
> 
>> Yeah, I completely copied his code and inserted it into my project.
>> Even
>> odder, it doesn't allow the Apple-Tab function (which is what it is
>> supposed
>> to do) but lets Exposé work just fine.
>> 
>> I don't mean that it broke in the latest version of Leopard, as the
>> "old"
>> version I was using still did not have it enabled.  I was wondering
>> if it
>> worked on Leopard at all, and based on your reply it does.  So I
>> don't have
>> much idea as to what to try now.
> 
> 
> Hmm, I wonder if it has something to do with how I create my windows?
> 
> I create "blanking" windows and put one of those on each screen
> (borderless window covers entire screen).  Then, I create a content
> window (also borderless) that is then set to appropriate size (1024 x
> 768 in my case), centered on, and made a child of, the blanking window
> on the main screen.
> 
> The call to SetSystemUIMode is made in applicationDidFinishLaunching:
> before I create windows.
> 
> Both the blanking and content windows are subclasses of NSWindow.
> 
> Blanking window's designated initializer is just a thin wrapper around
> NSWindow's initWithContentRect:styleMask:backing:defer:
> 
> - styleMask is NSBorderlessWindowMask
> - backing is NSBackingStoreBuffered
> - defer is NO
> 
> I then set these additional attributes:
> 
> - hidesOnDeactivate (YES)
> - releasedWhenClosed (NO)
> - movableByWindowBackground (NO)
> - hasShadow (NO)
> - optimizedDrawing (YES)
> - opaque (YES)
> 
> I also override canBecomeKeyWindow (returns NO) and
> canBecomeMainWindow (also returns NO).
> 
> 
> In my content window subclass, same setup as blanking window (in terms
> of attributes listed above).  And, overrides to canBecomeKeyWindow and
> canBecomeMainWindow return YES.
> 
> 
> ___
> Ricky A. Sharp mailto:rsh...@instantinteractive.com
> Instant Interactive(tm)   http://www.instantinteractive.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: Core Data completely unable to find the source object model for migration

2009-08-06 Thread mmalc Crawford


On Aug 6, 2009, at 10:37 AM, Matteo Manferdini wrote:


What I discovered is that in the first case the hashes are the same
for the model and the store, while in the second case the model has
lost a lot of metadata in the versioning process. Along with my
entities there are also other entities listed in the hashes (to name a
few: CalDAVCalendar, CalendarChangeRequest, LocalGroup, etc). These
entities hashes are lost in the versioned model, while my entities
hashes remain the same.

Any idea of why this is happening? It seems to me that this is an  
XCode bug.



It's unlikely to be a bug.
When you merge your models at runtime, you're including models from  
other frameworks.  Make sure you only include your app's model by  
specifying the main bundle in mergedModelFromBundles:...

Which OS version are you using?

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: Core Data completely unable to find the source object model for migration

2009-08-06 Thread Adam Swift


On Aug 6, 2009, at 10:37 AM, Matteo Manferdini wrote:


To further investigate the matter, I logged the contents of both the
NSStoreModelVersionHashesKey dictionary from my store metadata and the
dictionary returned by the entityVersionHashesByName: method of my
source model. I did this both for my working app without versioning
and the not working one with versioning.

What I discovered is that in the first case the hashes are the same
for the model and the store, while in the second case the model has
lost a lot of metadata in the versioning process. Along with my
entities there are also other entities listed in the hashes (to name a
few: CalDAVCalendar, CalendarChangeRequest, LocalGroup, etc). These
entities hashes are lost in the versioned model, while my entities
hashes remain the same.

Any idea of why this is happening? It seems to me that this is an  
XCode bug.

Thank you.

This can happen as a side effect of the old template code that merges  
a model using all managed object models from the application resources  
as well as all frameworks linked into the application.  If you've got  
the calendar store framework linked into your project (directly or  
indirectly), you'll get the entities you discovered in the version  
hash metadata merged into your model at run time, and those entities  
will be included in the store file created from the merged model.


It sounds like your original (non-versioned) app and store file are  
pulling in all of these extra entities, but your new (versioned) app  
does not.  Unless you're using those entities, you really don't want  
them in your store file or your run-time model.


if you can't just dump your old store file and start fresh (if you  
need to migrate your customer's data), what you'll want to do is  
create a source datamodel that includes the calendar store entities  
that were merged in previously as your source datamodel.  I'd suggest  
creating another version of your "pure" source data model exclusively  
for this purpose and then add the entities from the calendar store  
data model (using Xcode->Design->Data Model->Import...), you'll need  
to copy the compiled calendar store model from /System/Library/ 
Frameworks/CalendarStore.framework/Resources/CalendarStore.calmom to a  
new file with the file extension ".mom" so the data model import will  
recognize the file type as valid.


Then create a mapping model from that 'merged' source model to the  
real destination model.


Hope that helps,
- adam



Thank you very much.
Regards.

Matteo Manferdini
Pawn Software
www.pawn-soft.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/aswift%40apple.com

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


___

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

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

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

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


Re: Mixing Objective-C and C++ classes; How?

2009-08-06 Thread Michael A. Crawford
Problem solved.  As it turns out the problem was that the class is  
declared in a C++ namespace.  I did not properly scope the class nor  
was I using a 'using namespace' statement.


-Michael
--
The united stand.  The divided get played.

-- Bernie MAC


On Aug 6, 2009, at 4:59 PM, Shawn Erickson wrote:


On Thu, Aug 6, 2009 at 1:51 PM, Michael A.
Crawford wrote:
Should the following work (assuming it is included in an Objective- 
C file

with a .mm extension)?

@interface CDBPMDetectOperation : NSOperation 
{
  class BPMDetect* bpmDetector; // C++ class as an objective-c  
class member

}


/me points at...




-Shawn




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: Disabling Exposé in SystemUIMode

2009-08-06 Thread Eric Schlegel


On Aug 6, 2009, at 8:10 AM, Pierce Freeman wrote:


Hi Sean:

Yeah, I completely copied his code and inserted it into my project.   
Even
odder, it doesn't allow the Apple-Tab function (which is what it is  
supposed

to do) but lets Exposé work just fine.


Pierce, how are you entering Exposé: function key, mouse button, or  
screen hot corner? SetSystemUIMode attempts to disable Exposé as best  
it can, but only the function key and mouse button methods are  
disabled. Screen hot corners are still enabled so you'd have to  
disable those manually in System Prefs.


-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: Disabling Exposé in SystemUIMode

2009-08-06 Thread Pierce Freeman
Hi Eric:

I am using the four finger swipe gesture on a Unibody MacBook Pro and the
key.  Neither of which SetSystemUIMode over rides.  Maybe there is a way to
just set a window to be at the edges of the screen all the time, and then
put the main window in front of that?


On 8/6/09 3:59 PM, "Eric Schlegel"  wrote:

> 
> On Aug 6, 2009, at 8:10 AM, Pierce Freeman wrote:
> 
>> Hi Sean:
>> 
>> Yeah, I completely copied his code and inserted it into my project.
>> Even
>> odder, it doesn't allow the Apple-Tab function (which is what it is
>> supposed
>> to do) but lets Exposé work just fine.
> 
> Pierce, how are you entering Exposé: function key, mouse button, or
> screen hot corner? SetSystemUIMode attempts to disable Exposé as best
> it can, but only the function key and mouse button methods are
> disabled. Screen hot corners are still enabled so you'd have to
> disable those manually in System Prefs.
> 
> -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: Disabling Exposé in SystemUIMode

2009-08-06 Thread Eric Schlegel


On Aug 6, 2009, at 4:03 PM, Pierce Freeman wrote:


Hi Eric:

I am using the four finger swipe gesture on a Unibody MacBook Pro  
and the

key.  Neither of which SetSystemUIMode overrides.


Yes, that's the problem. SetSystemUIMode doesn't prevent entering  
Exposé via that method. Please file a bug about that; we have the  
infrastructure in place finally in SnowLeopard to fix this, so we  
should be able to address the problem in a future release.


 Maybe there is a way to just set a window to be at the edges of the  
screen all the time, and then

put the main window in front of that?


I don't think I understand what you're proposing. In general, I don't  
think there's a way to prevent Exposé from occurring in this case,  
without just disabling the gesture in System Prefs.


-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


Custom Table View Cells and String Text Alignment and Breaking

2009-08-06 Thread Grant Erickson
I am implementing a non-editable custom table view cell (a bit similar to
the network connection listing in the System Preferences Network preference
pane) in a single-column, no header NSTableView.

The cell consists of an image, another image, two stacked strings (left
aligned), another string (right aligned) and a custom-drawn graphic:

  .--..--.   .--.
  .--.|  ||  |.-.|  |
  !__!|  ||--|!_!|  |
  !__!!__!   !__!

  Img  Image   StringsString  Drawn

At this point, I've all the icons and graphics drawing correctly and the
text displaying with attributes (i.e. inverting when selected, etc.) using
drawAtPoint:withAttributes:.

However, with regard to the strings, particularly concerning the
right-alignment of the non-stacked string, nudging around the X points to
achieve the proper right-alignment seems like the wrong way to approach this
and that I should be specifying NSTextAlignment in some way when the string
is drawn.

In addition, paragraph style attributes (NSRightTextAlignment or
NSLineBreakByTruncatingMiddle) seem (perhaps unsurprisingly) to not apply to
drawAtPoint:withAttributes:.

Do I need to create or should I instead be creating three NSTextViews, one
for each string, and adding them as subviews to my custom cell's view rather
than trying to use drawAtPoint:withAttributes:?

Regards,

Grant Erickson


___

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

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

2009-08-06 Thread Pierce Freeman
Hi Eric:

I'll make sure to file a big about that - hopefully it can get resolved
before shipment.  But, when using the key, it should stop Exposé, shouldn't
it?  I have also tested this and it still doesn't work.  Any ideas?


On 8/6/09 5:02 PM, "Eric Schlegel"  wrote:

> 
> On Aug 6, 2009, at 4:03 PM, Pierce Freeman wrote:
> 
>> Hi Eric:
>> 
>> I am using the four finger swipe gesture on a Unibody MacBook Pro
>> and the
>> key.  Neither of which SetSystemUIMode overrides.
> 
> Yes, that's the problem. SetSystemUIMode doesn't prevent entering
> Exposé via that method. Please file a bug about that; we have the
> infrastructure in place finally in SnowLeopard to fix this, so we
> should be able to address the problem in a future release.
> 
>>  Maybe there is a way to just set a window to be at the edges of the
>> screen all the time, and then
>> put the main window in front of that?
> 
> I don't think I understand what you're proposing. In general, I don't
> think there's a way to prevent Exposé from occurring in this case,
> without just disabling the gesture in System Prefs.
> 
> -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: Disabling Exposé in SystemUIMode

2009-08-06 Thread Pierce Freeman
And is there any way to make reproduce the "display capture effect" without
using this or SetSystemUIMode.  I am attempting to make a full screen app,
and don't want the user to have to disable this in the system preferences.


On 8/6/09 5:02 PM, "Eric Schlegel"  wrote:

> 
> On Aug 6, 2009, at 4:03 PM, Pierce Freeman wrote:
> 
>> Hi Eric:
>> 
>> I am using the four finger swipe gesture on a Unibody MacBook Pro
>> and the
>> key.  Neither of which SetSystemUIMode overrides.
> 
> Yes, that's the problem. SetSystemUIMode doesn't prevent entering
> Exposé via that method. Please file a bug about that; we have the
> infrastructure in place finally in SnowLeopard to fix this, so we
> should be able to address the problem in a future release.
> 
>>  Maybe there is a way to just set a window to be at the edges of the
>> screen all the time, and then
>> put the main window in front of that?
> 
> I don't think I understand what you're proposing. In general, I don't
> think there's a way to prevent Exposé from occurring in this case,
> without just disabling the gesture in System Prefs.
> 
> -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: Custom Table View Cells and String Text Alignment and Breaking

2009-08-06 Thread Quincey Morris

On Aug 6, 2009, at 17:08, Grant Erickson wrote:


However, with regard to the strings, particularly concerning the
right-alignment of the non-stacked string, nudging around the X  
points to
achieve the proper right-alignment seems like the wrong way to  
approach this
and that I should be specifying NSTextAlignment in some way when the  
string

is drawn.

In addition, paragraph style attributes (NSRightTextAlignment or
NSLineBreakByTruncatingMiddle) seem (perhaps unsurprisingly) to not  
apply to

drawAtPoint:withAttributes:.


So why wouldn't you use drawInRect:withAttributes: instead?


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Custom Table View Cells and String Text Alignment and Breaking

2009-08-06 Thread Grant Erickson
On 8/6/09 5:08 PM, Grant Erickson wrote:
> I am implementing a non-editable custom table view cell (a bit similar to the
> network connection listing in the System Preferences Network preference pane)
> in a single-column, no header NSTableView.
> 
> The cell consists of an image, another image, two stacked strings (left
> aligned), another string (right aligned) and a custom-drawn graphic:
> 
>   .--..--.   .--.
>   .--.|  ||  |.-.|  |
>   !__!|  ||--|!_!|  |
>   !__!!__!   !__!
> 
>   Img  Image   StringsString  Drawn
> 
> At this point, I've all the icons and graphics drawing correctly and the text
> displaying with attributes (i.e. inverting when selected, etc.) using
> drawAtPoint:withAttributes:.
> 
> However, with regard to the strings, particularly concerning the
> right-alignment of the non-stacked string, nudging around the X points to
> achieve the proper right-alignment seems like the wrong way to approach this
> and that I should be specifying NSTextAlignment in some way when the string is
> drawn.
> 
> In addition, paragraph style attributes (NSRightTextAlignment or
> NSLineBreakByTruncatingMiddle) seem (perhaps unsurprisingly) to not apply to
> drawAtPoint:withAttributes:.
> 
> Do I need to create or should I instead be creating three NSTextViews, one for
> each string, and adding them as subviews to my custom cell's view rather than
> trying to use drawAtPoint:withAttributes:?

It would appear that drawInRect:withAttributes: does the trick, respecting
both alignment and line breaking.

Regards,

Grant


___

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

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


embedding framework in Application bundle?

2009-08-06 Thread Michael Link
I'm trying to work around a problem where the latest update of Mac OS  
X (10.5.8) has a broken XQuery.framework. I've discovered that  
replacing the XQuery.framework on Mac OS X 10.5.8 with a version from  
Mac OS X 10.5.7 solves all the problems.


I'd like to embed the XQuery.framework from Mac OS X 10.5.7 in my  
application and force it to be used over the faulty system version on  
Mac OS X 10.5.8. I've managed to get it into the application bundle  
and setting the environment variables DYLD_PRINT_LIBRARIES and  
DYLD_PRINT_LIBRARIES_POST_LAUNCH show that it's being loaded but it  
doesn't appear that the framework is being used. GDB also shows that  
the symbols are loaded, I can create breakpoints on functions in the  
XQuery.framework. I'm wondering why when I call -[NSXMLNode  
objectsForXQuery:error:] it doesn't call out to the corresponding  
functions in the XQuery.framework unless it's been loaded from /System/ 
Library/PrivateFrameworks?


dyld: loaded: /Users/mlink/Code/code-cocoaref/Bug7037807/build/Debug/ 
Bug7037807.app/Contents/MacOS/Bug7037807
dyld: loaded: /Developer/Applications/Xcode.app/Contents/Resources/../ 
PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/ 
PBGDBIntrospectionSupport.A.dylib
dyld: loaded: /System/Library/Frameworks/Cocoa.framework/Versions/A/ 
Cocoa
dyld: loaded: /Users/mlink/Code/code-cocoaref/Bug7037807/build/Debug/ 
Bug7037807.app/Contents/MacOS/../Frameworks/XQuery.framework/Versions/ 
A/XQuery

dyld: loaded: /usr/lib/libgcc_s.1.dylib
...

(gdb) info break
Num Type   Disp Enb AddressWhat
1   breakpoint keep y   0x00116df6 
2   breakpoint keep y   0x00116587 
3   breakpoint keep y   0x0010efab 
4   breakpoint keep y   0x000dee6e <-[XQueryFunctionCall  
evaluateWithContext:]+6>

(gdb) info sym 0x00116df6
pcre_compile + 6 in section LC_SEGMENT.__TEXT.__text of /Users/mlink/ 
Code/code-cocoaref/Bug7037807/build/Debug/Bug7037807.app/Contents/ 
Frameworks/XQuery.framework/Versions/A/XQuery

(gdb) info sym 0x000dee6e
-[XQueryFunctionCall evaluateWithContext:] + 6 in section  
LC_SEGMENT.__TEXT.__text of /Users/mlink/Code/code-cocoaref/Bug7037807/ 
build/Debug/Bug7037807.app/Contents/Frameworks/XQuery.framework/ 
Versions/A/XQuery


Anyone know how I might be able to get this to work?

--
Michael
___

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

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

2009-08-06 Thread Ken Thomases

On Aug 6, 2009, at 12:29 PM, Quincey Morris wrote:

Finally, the question of whether 'projectInstall' sometimes returns  
nil is irrelevant. That has nothing to do with the compliance of the  
Project object.


Except, check out "Bug Fix in KVO's Dependency Mechanism" in the  
Leopard Foundation Release Notes .


The bug mentioned was fixed in Leopard, but since Bryan said he's  
targeting Tiger, he may be getting bit by it.


Regards,
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: Change Opacity of Image

2009-08-06 Thread Rob Keniger


On 07/08/2009, at 7:10 AM, Pierce Freeman wrote:

Do you have one that you can suggest?  It doesn't have to do much -  
just

change the opacity.



Just use an NSImage and -drawAtPoint:fromRect:operation:fraction:  and  
set a value for the fraction (i.e. the opacity).


--
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: Disabling Exposé in SystemUIMode

2009-08-06 Thread Ken Thomases

On Aug 6, 2009, at 7:18 PM, Pierce Freeman wrote:

And is there any way to make reproduce the "display capture effect"  
without

using this or SetSystemUIMode.


I'm not quite clear on what you're saying here.  When you say "without  
using this", do you mean without actually capturing the display?  Why  
don't you want to use the display capture API[1] if you're looking to  
achieve the capture of the display?


Regards,
Ken

[1] 


___

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

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


iCal Notifications

2009-08-06 Thread Chris Purcell
I asked this question a while back, didn't get an answer.  Figured I'd  
give it another shot.  Is there any access to these notifications  
through the calendar API?  Or is there another way to get access to it?


Here is an example of what the notifications are: 
http://images.apple.com/hk/en/server/macosx/features/images/ical_notifications20090608.jpg

Thanks!

--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: Disabling Exposé in SystemUIMode

2009-08-06 Thread Eric Schlegel


On Aug 6, 2009, at 5:13 PM, Pierce Freeman wrote:


Hi Eric:

I'll make sure to file a big about that - hopefully it can get  
resolved
before shipment.  But, when using the key, it should stop Exposé,  
shouldn't

it?  I have also tested this and it still doesn't work.  Any ideas?


Hmm, yes, the keystroke to invoke Exposé should still be blocked. I  
can't say offhand why it wouldn't be.


And is there any way to make reproduce the "display capture effect"  
without
using this or SetSystemUIMode.  I am attempting to make a full  
screen app,
and don't want the user to have to disable this in the system  
preferences.


You can actually capture the display with the CGDisplayCapture API -  
Exposé can't be invoked when the display is captured. Otherwise, I  
don't think so.


-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


[iPhone] Action sheet on ViewDidLoad

2009-08-06 Thread Sven

Hello,

I have a view with a toolbar in which I show an action sheet in 
viewDidLoad. When the view loads however the action sheet sits slightly 
too high, revealing about 20-30 pixels of the toolbar at the bottom.


If I show the action sheet from a button press in the same view however, 
it's perfectly aligned to the bottom.
Is showing an actionsheet in viewDidLoad a bit too premature for 
everything to align correctly or is it something else that I'm doing 
wrong?

This happens both on the simulator and device.

Thanks

./Sven
___

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

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

2009-08-06 Thread Chilton Webb

Hi Eric,

On Aug 7, 2009, at 12:46 AM, Eric Schlegel wrote:

Hmm, yes, the keystroke to invoke Exposé should still be blocked. I  
can't say offhand why it wouldn't be.


I filed a bug on this originally in 2005 (it is still open), radar://4376456
In that specific case, Front Row can bypass kiosk mode, if the remote  
control is not deactivated in the System Prefs. I sent in a follow-up  
when Exposé shipped, because that also overrode kiosk mode. I don't  
see a radar for that one though, so it was probably sent in as a  
either a DTS incident, or an email to one of the engineers that wrote  
back regarding that radar bug.


My point here is that while I realize these are fairly specific  
issues, it can become an issue for anyone writing software that will  
be used in a kiosk-like environment.


I'd LOVE to see these resolved. Maybe there is still time to see that  
in Snow Leopard? ;-)


Thank you!
-Chilton Webb___

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

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