Binding alignment property of NSTextField

2012-10-27 Thread Luc Van Bogaert
Hi,

I'm using bindings to set various properties of a textfield object in a nib 
file, eg. Font, TextColor, Hidden, etc. These textfield properties are all 
bound to the nib's File's Owner, which is a viewcontroller. This all works 
fine, except for the alignment property.

The textfield alignment is bound to an enum property of the viewcontroller. The 
strange thing is that, when I create a *new* viewcontroller object from the 
nib, the textfield alignment is set correctly based on the current enum 
property value. So, it seems that the binding indeed works, but

when I set the enum property of an existing viewcontroller object to some other 
value, the textfield alignment is not adjusted accordingly.

-- 
Luc Van Bogaert



___

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

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

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

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


Re: Binding alignment property of NSTextField

2012-10-27 Thread Ken Thomases
On Oct 27, 2012, at 4:26 AM, Luc Van Bogaert wrote:

> The textfield alignment is bound to an enum property of the viewcontroller. 
> The strange thing is that, when I create a *new* viewcontroller object from 
> the nib, the textfield alignment is set correctly based on the current enum 
> property value. So, it seems that the binding indeed works, but
> 
> when I set the enum property of an existing viewcontroller object to some 
> other value, the textfield alignment is not adjusted accordingly.

This suggests that your are modifying the property in a non-KVO-compliant 
manner.  Are you calling the setter or are you directly changing the instance 
variable?

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


How to check if the app is sandboxed and what entitlements it has got?

2012-10-27 Thread Oleg Krupnov
Hi,

I'm writing a component which I intend to use in several my apps. Some
of the apps may be sandboxed. I'd like to turn off some functionality
in case if the app is sandboxed and there are no entitlements that I
need.

I'd be happy with either compile-time or run-time solution.

I've googled a solution
http://oleb.net/blog/2012/02/checking-code-signing-and-sandboxing-status-in-code/
but it's using a rather obscure Security framework and it doesn't
check particular entitlements. Generally it looks like a hacky
workaround. I wonder if there is a simpler straightforward solution.

Thanks!
___

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

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

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

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


Re: App rejection due to app-sandboxing invalid entitlement

2012-10-27 Thread Shane Stanley
On 27/10/2012, at 5:11 PM, Quincey Morris  
wrote:

> I don't recall if the session has the entitlements needed for your specific 
> case, but I think it is worth watching. (IIRC it did use Mail as an example 
> scripting target, so it might well have exactly your answer.)

Interestingly the slides use com.apple.Mail rather than com.apple.mail -- so it 
may not be all that reliable. 

-- 
Shane Stanley 
'AppleScriptObjC Explored' 


___

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

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

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

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


Sandbox, security bookmarks and trash

2012-10-27 Thread Simone Tellini
Hello,

I need to handle an "export" function in a document-based application.

When the user creates the document, he can also choose a couple of path where 
to save different exported results (e.g. "~/Documents/exporteddata.xml"). The 
document contains security bookmarks that point to those files, so that when 
the user reopens the document, he can simply hit "export" to generated them 
again, overwriting the previous data.

Problem is, if the user moves one of those files to the trash, the next time 
the application resolves the security bookmark it will point to the deleted 
file (ie. something like ".../.Trash/..."). I'd rather like the application to 
keep on re-creating the file at the path the user has chosen in the first place 
(ie. "~/Documents/exporteddata.xml").

Is it possible? Or how do you handle this scenario in an user-friendly way?

-- 
Simone Tellini
http://tellini.info




___

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

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

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

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


Re: Binding alignment property of NSTextField

2012-10-27 Thread Luc Van Bogaert
Yes, I'm using a synthesised setter to change the property value. I am also 
observing the property (to redraw the controller's view whenever something 
changes) and this way I can confirm that the property is indeed changed in a 
KVO compliant manner.

One thing I forgot to mention is that I'm using a NSValueTransformer with the 
binding to translate the enum property values to the proper alignment setting 
for the textfield. 


On 27 Oct 2012, at 11:58, Ken Thomases  wrote:

> On Oct 27, 2012, at 4:26 AM, Luc Van Bogaert wrote:
> 
>> The textfield alignment is bound to an enum property of the viewcontroller. 
>> The strange thing is that, when I create a *new* viewcontroller object from 
>> the nib, the textfield alignment is set correctly based on the current enum 
>> property value. So, it seems that the binding indeed works, but
>> 
>> when I set the enum property of an existing viewcontroller object to some 
>> other value, the textfield alignment is not adjusted accordingly.
> 
> This suggests that your are modifying the property in a non-KVO-compliant 
> manner.  Are you calling the setter or are you directly changing the instance 
> variable?
> 
> Regards,
> Ken
> 

-- 
Luc Van Bogaert
luc.van.boga...@me.com
http://www.rixhon.be



___

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

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

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

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


Re: Scalability of CALayers

2012-10-27 Thread Richard Somers
On Oct 25, 2012, at 6:18 PM, Graham Cox  wrote:

> I'm wondering how scalable the Core Animation layer model is.

Look at the WWDC 2006 video around the 0:50 mark. Scott Forstall introduces 
Core Animation and discusses its scalability. He show a demo of the iTunes 
album screen saver app written to show case the power of Core Animation but 
running in real time. (But of course the real reason Apple wrote Core Animation 
was not for an iTunes album commercial but for the iPhone which would be 
released the following year.)

http://www.youtube.com/watch?v=w6SXMtmUsX0

--Richard Somers


___

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

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

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

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


Warning message using stringWithContentsOfFile:encoding:error:

2012-10-27 Thread Paul Johnson
I get a compiler warning message at the following line of code:

NSString *text = [NSString stringWithContentsOfFile:fullPath encoding:
NSUTF8StringEncoding error:&error];

The warning message is:

Class method '+stringWithContentsOfFile:encoding:Rf_error' not found
(return type defaults to 'id')


I've found many code examples that have the same as my code and nothing
I've tried gets rid of the warning message. Can someone please enlighten me?
___

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

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

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

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


[ANN] zipzap -- zip file I/O library

2012-10-27 Thread Glen Low
Hi All

Announcing my new zip file I/O library -- zipzap. zipzap is easy to use (just 3 
public classes!) and efficient, being highly optimized for low memory overhead 
and reduced disk I/O. I believe it makes the zip file format a no-brainer 
choice of container for Cocoa-based compound documents.

Poke a stick at it here:

https://github.com/pixelglow/zipzap

All feedback, comments, brickbats or bouquets are welcome.

Cheers

Glen Low
Pixelglow Software
___

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

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

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

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


Re: Warning message using stringWithContentsOfFile:encoding:error:

2012-10-27 Thread Nick Zitzmann

On Oct 27, 2012, at 4:04 PM, Paul Johnson  wrote:

> I get a compiler warning message at the following line of code:
> 
> NSString *text = [NSString stringWithContentsOfFile:fullPath encoding:
> NSUTF8StringEncoding error:&error];
> 
> The warning message is:
> 
> Class method '+stringWithContentsOfFile:encoding:Rf_error' not found
> (return type defaults to 'id')
> 
> 
> I've found many code examples that have the same as my code and nothing
> I've tried gets rid of the warning message. Can someone please enlighten me?

Check the headers. Is there anything that is #defining error to Rf_error?

Nick Zitzmann





___

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

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

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

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


Re: Warning message using stringWithContentsOfFile:encoding:error:

2012-10-27 Thread Paul Johnson
Nick, I can't find any headers that #define 'Rf_error'.

The warning message seems to be complaining about assigning to the type
'NString *' when type 'id' is expected, though.

I'm not sure where Rf_error is defined, but it must be in the Cocoa headers.

Thanks for your reply.

On Sat, Oct 27, 2012 at 5:37 PM, Nick Zitzmann  wrote:

>
> On Oct 27, 2012, at 4:04 PM, Paul Johnson  wrote:
>
> > I get a compiler warning message at the following line of code:
> >
> > NSString *text = [NSString stringWithContentsOfFile:fullPath encoding:
> > NSUTF8StringEncoding error:&error];
> >
> > The warning message is:
> >
> > Class method '+stringWithContentsOfFile:encoding:Rf_error' not found
> > (return type defaults to 'id')
> >
> >
> > I've found many code examples that have the same as my code and nothing
> > I've tried gets rid of the warning message. Can someone please enlighten
> me?
>
> Check the headers. Is there anything that is #defining error to Rf_error?
>
> Nick Zitzmann
> 
>
>
>
>
___

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

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

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

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


Re: [ANN] zipzap -- zip file I/O library

2012-10-27 Thread Gene Crucean
Very cool Glen. Thanks for sharing!


On Saturday, October 27, 2012, Glen Low wrote:

> Hi All
>
> Announcing my new zip file I/O library -- zipzap. zipzap is easy to use
> (just 3 public classes!) and efficient, being highly optimized for low
> memory overhead and reduced disk I/O. I believe it makes the zip file
> format a no-brainer choice of container for Cocoa-based compound documents.
>
> Poke a stick at it here:
>
> https://github.com/pixelglow/zipzap
>
> All feedback, comments, brickbats or bouquets are welcome.
>
> Cheers
>
> Glen Low
> Pixelglow Software
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com )
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> https://lists.apple.com/mailman/options/cocoa-dev/emailgeneonthelist%40gmail.com
>
> This email sent to emailgeneonthel...@gmail.com 
>


-- 
Gene Crucean - Emmy winning - Oscar nominated VFX Supervisor / iOS-OSX
Developer / Filmmaker / Photographer
** *Freelance for hire* **
www.genecrucean.com

~~ Please use my website's contact form on www.genecrucean.com for any
personal emails. Thanks. I may not get them at this address. ~~
___

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

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

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

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


variable problem is driving me nuts

2012-10-27 Thread H Miersch
hi.

in my current project i have this line in the header for the app delegate: 

NSMutableArray *clients;

in the app delegate itself, there's this line, in applicationDidFinishLaunching:

clients = [[NSMutableArray alloc] init];

that works as expected. so far so good. but later, in another method in the app 
delegate, there's this line:

int count = [clients count];

and by the time that line is executed, clients is nil. @property/@synthesize or 
not makes no difference, ARC on or off makes no difference. WTF? what am i 
doing wrong? can someone point me in the right direction? thanks.
___

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

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

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

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


Re: variable problem is driving me nuts

2012-10-27 Thread M Pulis

clients is not (yet) a proper NSMutableArray..

Try one of the init methods within the NSMutableArray.

gary

On Oct 27, 2012, at 4:51 PM, H Miersch wrote:


hi.

in my current project i have this line in the header for the app  
delegate:


NSMutableArray *clients;

in the app delegate itself, there's this line, in  
applicationDidFinishLaunching:


clients = [[NSMutableArray alloc] init];

that works as expected. so far so good. but later, in another method  
in the app delegate, there's this line:


int count = [clients count];

and by the time that line is executed, clients is nil. @property/ 
@synthesize or not makes no difference, ARC on or off makes no  
difference. WTF? what am i doing wrong? can someone point me in the  
right direction? thanks.

___

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

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

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/toothpic%40fastq.com

This email sent to tooth...@fastq.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Warning message using stringWithContentsOfFile:encoding:error:

2012-10-27 Thread Gary L. Wade
What you think you're calling is the NSString class method 
+stringWithContentsOfFile:encoding:error: but due to an unexpected definition, 
you're actually calling the NSString class method 
+stringWithContentsOfFile:encoding:Rf_error: Apple does not have a publicly 
defined selector of that name, so that's why you're getting that warning. What 
you need to find is where "error" is being defined, not Rf_error. Because C 
provides for concatenation using the ## operator, you may not find that string. 
I'm guessing you're using someone else's headers, framework, or project, 
possible where error is redefined for some purpose, possibly debugging or 
mapping to another set of code.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

On Oct 27, 2012, at 4:21 PM, Paul Johnson  wrote:

> Nick, I can't find any headers that #define 'Rf_error'.
> 
> The warning message seems to be complaining about assigning to the type
> 'NString *' when type 'id' is expected, though.
> 
> I'm not sure where Rf_error is defined, but it must be in the Cocoa headers.
> 
> Thanks for your reply.
> 
> On Sat, Oct 27, 2012 at 5:37 PM, Nick Zitzmann  wrote:
> 
>> 
>> On Oct 27, 2012, at 4:04 PM, Paul Johnson  wrote:
>> 
>>> I get a compiler warning message at the following line of code:
>>> 
>>> NSString *text = [NSString stringWithContentsOfFile:fullPath encoding:
>>> NSUTF8StringEncoding error:&error];
>>> 
>>> The warning message is:
>>> 
>>> Class method '+stringWithContentsOfFile:encoding:Rf_error' not found
>>> (return type defaults to 'id')
>>> 
>>> 
>>> I've found many code examples that have the same as my code and nothing
>>> I've tried gets rid of the warning message. Can someone please enlighten
>> me?
>> 
>> Check the headers. Is there anything that is #defining error to Rf_error?
>> 
>> Nick Zitzmann
>> 
> 

___

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

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

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

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


Re: variable problem is driving me nuts

2012-10-27 Thread Andy Lee
You're sure the later method is being called before clients is set? What if you 
put NSLog statements next to each of the two statements you showed?

Any chance you have another variable called "clients" somewhere?

Any chance you have two instances of your app delegate class? In the NSLog 
statements, try printing the address of self.

--Andy

On Oct 27, 2012, at 7:51 PM, H Miersch  wrote:

> hi.
> 
> in my current project i have this line in the header for the app delegate: 
> 
> NSMutableArray *clients;
> 
> in the app delegate itself, there's this line, in 
> applicationDidFinishLaunching:
> 
> clients = [[NSMutableArray alloc] init];
> 
> that works as expected. so far so good. but later, in another method in the 
> app delegate, there's this line:
> 
> int count = [clients count];
> 
> and by the time that line is executed, clients is nil. @property/@synthesize 
> or not makes no difference, ARC on or off makes no difference. WTF? what am i 
> doing wrong? can someone point me in the right direction? thanks.
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com
> 
> This email sent to ag...@mac.com

___

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

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

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

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


Re: variable problem is driving me nuts

2012-10-27 Thread Jens Alfke

On Oct 27, 2012, at 4:51 PM, H Miersch  wrote:

> in the app delegate itself, there's this line, in 
> applicationDidFinishLaunching:
> 
> clients = [[NSMutableArray alloc] init];
> 
> that works as expected. so far so good. but later, in another method in the 
> app delegate, there's this line:
> 
> int count = [clients count];

Set a breakpoint on both the lines you quoted above, and see which one gets hit 
first. -applicationDidFinishLaunching: is not necessarily the first method 
invoked on the application delegate; it gets instantiated when the nib loads, 
and there can be activity during nib loading that ends up calling methods in 
the delegate.

In general, initialization code like this in a nib-loaded object should go into 
its -awakeFromNib method, which is [almost] guaranteed to be the first method 
invoked on that object.

—Jens
___

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

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

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

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