Re: Was using SnowLeopard, Xcode 4.2, iOS 5.0.1... now storyboard won't update

2012-03-09 Thread Roland King
Have you tried clean builds and removing the app from the simulator entirely 
then rerunning? I've had cases in the past where the new version of the app 
wasn't uploaded until I removed it first. 



On 10 Mar, 2012, at 9:31, R  wrote:

> I switched to Lion, XCode 4.3.1, iOS 5.1.  I run my properly
> functioning app on the 5.1 iPhone simulator and the changes I make to
> the storyboard don't show up in the run.  I'm totally perplexed and
> frustrated.  I literally disconnected a segue and removed buttons and
> they still appear in the test run and on the iPhone.  It seems that a
> previous  storyboard is being accessed.
> 
> Any input would be appreciated.
> 
> Ron
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post 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/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/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Was using SnowLeopard, Xcode 4.2, iOS 5.0.1... now storyboard won't update

2012-03-09 Thread R
I switched to Lion, XCode 4.3.1, iOS 5.1.  I run my properly
functioning app on the 5.1 iPhone simulator and the changes I make to
the storyboard don't show up in the run.  I'm totally perplexed and
frustrated.  I literally disconnected a segue and removed buttons and
they still appear in the test run and on the iPhone.  It seems that a
previous  storyboard is being accessed.

Any input would be appreciated.

Ron
___

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

Please do not post 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: Can't log in to Developer Centre

2012-03-09 Thread Patrick
Pretty sure that'd be devprogr...@apple.com.

On Fri, Mar 9, 2012 at 2:51 PM, Peter Hudson  wrote:
> I can't log in to my Dev Centre account.
> Does anyone know who to email about this ?
>
> Peter
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/gibblertron%40gmail.com
>
> This email sent to gibblert...@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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Releasing WSMethodInvocationInvoke()

2012-03-09 Thread Gus Mueller
On Mar 6, 2012, at 5:24 PM, Sean McBride wrote:

> On Mon, 5 Mar 2012 13:44:24 -0800, Gus Mueller said:
> 
>> That's because it's missing a CF_RETURNS_RETAINED in the header for that
>> method, which the analyzer needs to know what's going on.  I'm not sure
>> there's any way around this other than filing a bug and hoping Apple
>> updates the headers in the next release.
>> 
>> (Another example of this is SecTransformExecute in Securty.framework)
> 
> You sure about SecTransformExecute?  Its docs don't say anything about 
> needing to CFRelease the return value...

Yep- check out this (Mountain Lion Dev Preview) forum post for clarification:
https://devforums.apple.com/message/625749

-gus

--  

August 'Gus' Mueller
Flying Meat Inc.
http://flyingmeat.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: ivar access during -finalize

2012-03-09 Thread jonat...@mugginsoft.com
> 
> On 8 Mar 2012, at 16:58, Quincey Morris wrote:
> 
>> 
>>> A more robust solution is a probably a separate -dispose method.
>> 
>> Yes, though knowing when to call it can be a puzzle in itself, if there are 
>> multiple references to the object. In general, you'll probably need to 
>> invent a reference counting mechanism to keep track of when it's OK for your 
>> dispose method to actually dispose of things. That sounds ironic in a GC 
>> environment, but there's nothing wrong with reference counting when you need 
>> to keep count. :)
> 

It turns out that chasing my objects around trying to figure out when to safely 
dispose of their object resources is indeed a puzzle.
I have implemented the following category to provide a reference counting 
mechanism for disposable resources.
Using a category makes it easy to add this functionality to an existing class 
hierarchy.

Some brief commentary and the code repo is at 
http://github.com/mugginsoft/MGSDisposable
 
Regards

Jonathan Mitchell
Mugginsoft LLP

#import 

@interface NSObject (MGSDisposable)

- (void)mgsMakeDisposable;
- (BOOL)isMgsDisposable;
- (NSUInteger)mgsDisposalCount;
- (BOOL)isMgsDisposed;
- (void)mgsRetainDisposable;
- (void)mgsReleaseDisposable;
- (void)mgsDispose;
- (BOOL)isMgsDisposedWithLogIfTrue;
- (void)mgsAssociateValue:(id)value withKey:(void *)key;
- (void)mgsWeaklyAssociateValue:(id)value withKey:(void *)key;
- (id)mgsAssociatedValueForKey:(void *)key;
- (void)mgsLogSelector:(SEL)sel;
@end

#import "NSObject+MGSDisposable.h"
#import 

// enable logging
#define MGS_DISPOSAL_LOG

// disable logging
// comment the line below to enable logging
#undef MGS_DISPOSAL_LOG

static char mgsDisposableKey;
NSString * const MGSAllowDisposalKey = @"MGSAllowDisposal";
NSString * const MGSAllowDisposaValue = @"Yes";

@implementation NSObject (MGSDisposable)

/*
 
 - mgsMakeDisposable
 
 */
- (void)mgsMakeDisposable
{

#ifdef MGS_DISPOSAL_LOG
[self mgsLogSelector:_cmd];
#endif 

// check if already disposable
if ([self isMgsDisposable]) {
return;
}

// assign an initial reference count of 1
NSNumber *refCount = [NSNumber numberWithUnsignedInteger:1];
[self mgsAssociateValue:refCount withKey:&mgsDisposableKey];
}

/*
 
 - isMgsDisposable
 
 */
- (BOOL)isMgsDisposable
{
return ([self mgsDisposalCount] == NSUIntegerMax ? NO : YES);
}

/*
 
 - mgsDisposalCount
 
 */
- (NSUInteger)mgsDisposalCount
{
NSNumber *refCount = [self mgsAssociatedValueForKey:&mgsDisposableKey];
if (!refCount) {
return NSUIntegerMax;
}

return [refCount unsignedIntegerValue];
}

/*
 
 - isMgsDisposed
 
 */
- (BOOL)isMgsDisposed
{
NSUInteger refCount = [self mgsDisposalCount];
return (refCount == 0 ? YES : NO);
}

/*
 
 - mgsRetainDisposable
 
 */
- (void)mgsRetainDisposable
{

#ifdef MGS_DISPOSAL_LOG
[self mgsLogSelector:_cmd];
#endif 

if (![self isMgsDisposable]) return;
if ([self isMgsDisposed]) return;

NSUInteger refCount = [self mgsDisposalCount];
if (refCount == NSUIntegerMax) {
return;
}

[self mgsAssociateValue:[NSNumber numberWithUnsignedInteger:++refCount] 
withKey:&mgsDisposableKey];
}

/*
 
 - mgsReleaseDisposable
 
 */
- (void)mgsReleaseDisposable
{

#ifdef MGS_DISPOSAL_LOG
[self mgsLogSelector:_cmd];
#endif   

if (![self isMgsDisposable]) return;
if ([self isMgsDisposed]) return;

NSUInteger refCount = [self mgsDisposalCount];
if (refCount == NSUIntegerMax) {
return;
}

// dispose when reference count == 1
if (refCount == 1) {
[self mgsAssociateValue:MGSAllowDisposaValue 
withKey:MGSAllowDisposalKey];
[self mgsDispose];
} else {
[self mgsAssociateValue:[NSNumber numberWithUnsignedInteger:--refCount] 
withKey:&mgsDisposableKey];
}
}

/*
 
 - mgsDispose
 
 */
- (void)mgsDispose
{

#ifdef MGS_DISPOSAL_LOG
[self mgsLogSelector:_cmd];
#endif

// we must be disposable
if (![self isMgsDisposable]) return;

// log and quit if already disposed
if ([self isMgsDisposedWithLogIfTrue]) return;

// disposal is only valid when the allow disposal key is found
if (![self mgsAssociatedValueForKey:MGSAllowDisposalKey]) {
NSLog(@"Disposal is not valid at this time.");
return;
}

// mark this object as disposed
[self mgsAssociateValue:[NSNumber numberWithUnsignedInteger:0] 
withKey:&mgsDisposableKey];

// remove the allow disposal key
[self mgsAssociateValue:nil withKey:MGSAllowDisposalKey];
}

/*
 
 - isMgsDisposedWithLogIfTrue
 
 */
- (BOOL)isMgsDisposedWithLogIfTrue
{
if (![self isMgsDisposable]) return NO;

BOOL disposed = [self isMgsDisposed];
if (disposed) {
NSLog(@"mgsDispose already called.");
}

return disposed;
}

/*
 
 - mgsAssociateValue
 
 */
- (void)mgsAssociateValue:(id)value withKey:(void *)key
{
objc_setAssociated

Can't log in to Developer Centre

2012-03-09 Thread Peter Hudson
I can't log in to my Dev Centre account.
Does anyone know who to email about this ?

Peter
___

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

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

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

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


Re: Uncaught Exception: NSUnknownKeyException

2012-03-09 Thread Erik Stainsby
You can specify them in IB Don.

In the tree of XIB elements (under the Objects header) locate and select the 
Table Column element. I the Identity Inspector the second heading reads User 
Interface Item Identifier. Set this to the column id you wish to use in your 
code (the variable name perhaps).


Erik Stainsby
erik.stain...@roaringsky.ca
-
Consistently place constants on the LHS of an expression: you cannot 
accidentally assign when you meant to compare.




On 2012-03-09, at 1:32 PM, Donald Hall wrote:

> Thanks to Mike and Graham for the replies.
> 
> I think I figured out where the problem was. I am putting data into an 
> NSTableView, with one ivar from the Action class in each column. My original 
> project was so old that it used nibs instead of xibs, so I redid them all. In 
> the new Xcode there doesn't seem to be a way to specify the column identifier 
> for the xib in the Attributes Inspector, and I forgot about this, so each 
> column has an identifier of nil or null. I believe this explains the error 
> message. Here is the top part of the stack trace:
> 
>   0   CoreFoundation  0x918ded87 __raiseError + 231
>   1   libobjc.A.dylib 0x9b7f1149 objc_exception_throw 
> + 155
>   2   Foundation  0x9548bd78 
> -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 285
>   3   Foundation  0x953b1b97 
> _NSGetUsingKeyValueGetter + 39
>   4   Foundation  0x953b1b68 
> -[NSObject(NSKeyValueCoding) valueForKey:] + 406
>   5   Script Timer0x00014991 -[MyDocument 
> tableView:objectValueForTableColumn:row:] + 3249
>   6   AppKit  0x907c5c71 -[NSTableView 
> _dataSourceValueForColumn:row:] + 69
>   7   AppKit  0x907c55e7 -[NSTableView 
> preparedCellAtColumn:row:] + 420
>   8   AppKit  0x907d6c6c -[NSTableView 
> _drawContentsAtRow:column:withCellFrame:] + 50
> 
> It looks like I'll either have to specify the identifiers in code or 
> implement the new way to handle table columns using bindings. I will study 
> the "NSTableViewBinding" sample project.
> 
> Thanks again, Don
> 
> On 2012-03-09, at 2:35 AM, Graham Cox wrote:
> 
>> 
>> On 09/03/2012, at 5:57 PM, Donald Hall wrote:
>> 
>>> s class is not key value coding-compliant for the key (null).
>> 
>> 
>> The key is nil (null). So the problem is where the key is coming from, not 
>> the operation of the Action class.
>> 
>> --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:
> https://lists.apple.com/mailman/options/cocoa-dev/erik.stainsby%40roaringsky.ca
> 
> This email sent to erik.stain...@roaringsky.ca


___

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

Please do not post 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: Uncaught Exception: NSUnknownKeyException

2012-03-09 Thread Donald Hall
Thanks to Mike and Graham for the replies.

I think I figured out where the problem was. I am putting data into an 
NSTableView, with one ivar from the Action class in each column. My original 
project was so old that it used nibs instead of xibs, so I redid them all. In 
the new Xcode there doesn't seem to be a way to specify the column identifier 
for the xib in the Attributes Inspector, and I forgot about this, so each 
column has an identifier of nil or null. I believe this explains the error 
message. Here is the top part of the stack trace:

0   CoreFoundation  0x918ded87 __raiseError + 231
1   libobjc.A.dylib 0x9b7f1149 objc_exception_throw 
+ 155
2   Foundation  0x9548bd78 
-[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 285
3   Foundation  0x953b1b97 
_NSGetUsingKeyValueGetter + 39
4   Foundation  0x953b1b68 
-[NSObject(NSKeyValueCoding) valueForKey:] + 406
5   Script Timer0x00014991 -[MyDocument 
tableView:objectValueForTableColumn:row:] + 3249
6   AppKit  0x907c5c71 -[NSTableView 
_dataSourceValueForColumn:row:] + 69
7   AppKit  0x907c55e7 -[NSTableView 
preparedCellAtColumn:row:] + 420
8   AppKit  0x907d6c6c -[NSTableView 
_drawContentsAtRow:column:withCellFrame:] + 50

It looks like I'll either have to specify the identifiers in code or implement 
the new way to handle table columns using bindings. I will study the 
"NSTableViewBinding" sample project.

Thanks again, Don

On 2012-03-09, at 2:35 AM, Graham Cox wrote:

> 
> On 09/03/2012, at 5:57 PM, Donald Hall wrote:
> 
>> s class is not key value coding-compliant for the key (null).
> 
> 
> The key is nil (null). So the problem is where the key is coming from, not 
> the operation of the Action class.
> 
> --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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


[solved] Re: Bundled framework not found despite copy build phase and being inside the bundle

2012-03-09 Thread Alexander Reichstadt
I found the problem, the bundled framework being in another project did not 
have the @executable/../Frameworks set as a installation path.

dyld: Library not loaded: 
/Users/Alexander/Library/Frameworks/PGSQLKit.framework/Versions/A/PGSQLKit

Am 09.03.2012 um 22:00 schrieb Alexander Reichstadt:

> Hi,
> 
> having added the PGSQLKit framework when being bundled it is not found. What 
> I did was adding the framework, making sure it is linked against, making sure 
> the copy buildphase with target frameworks is before the link phase. When I 
> check, the built app bundle does contain the Frameworks directory as well as 
> it containing the framework in question. But the app when trying to launch 
> continues to search in ~/Library/Frameworks and works only if the framework 
> is located there, otherwise it stops launching with some dylib error.
> 
> Where do I tell it to not search there but inside the bundle?
> 
> 
> Thanks
> Alex
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post 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/lxr%40mac.com
> 
> This email sent to l...@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


Bundled framework not found despite copy build phase and being inside the bundle

2012-03-09 Thread Alexander Reichstadt
Hi,

having added the PGSQLKit framework when being bundled it is not found. What I 
did was adding the framework, making sure it is linked against, making sure the 
copy buildphase with target frameworks is before the link phase. When I check, 
the built app bundle does contain the Frameworks directory as well as it 
containing the framework in question. But the app when trying to launch 
continues to search in ~/Library/Frameworks and works only if the framework is 
located there, otherwise it stops launching with some dylib error.

Where do I tell it to not search there but inside the bundle?


Thanks
Alex
___

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

Please do not post 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: The current preferred method for fetching HTTP URLs for IOS

2012-03-09 Thread Wade Tregaskis
> FWIW, my view is that it depends on what your requirements are. For a simple 
> request, you can go with an [NSString stringWithContentsOfURL] wrapped in a 
> call to dispatch_async to avoid blocking the main thread. 

But keep in mind that threads are not free and there are a finite number 
available to each concurrent queue.  You can experience unexpected delays if 
you abuse them.  You may even get into deadlock.

I'm not saying not to use that convenience method, but you should consider if 
your usage of it will be sufficiently light.
___

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

Please do not post 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: NSTableView update basics

2012-03-09 Thread Erik Stainsby
A poorly thought out attempt to return the count or zero (I was writing a lot 
of perl the day I coded this). 

I recall reading that there is a race condition when *view*-based tables are 
loaded from nib. This does not obtain in my current case: this is a cell based 
table.  

I removed the errant || 0 and the table is behaving correctly. Thanks for 
proofing my code.


Erik Stainsby
erik.stain...@roaringsky.ca
-
Consistently place constants on the LHS of an expression: you cannot 
accidentally assign when you meant to compare.




On 2012-03-09, at 1:38 AM, Graham Cox wrote:

> 
> On 09/03/2012, at 4:42 PM, Erik Stainsby wrote:
> 
>> - (NSInteger) numberOfRowsInTableView:(NSTableView *)tableView {
>>  return [tableData count] || 0;
>> }
> 
> 
> What is the intention here? You are doing a boolean OR with the value zero, 
> which will promote (in fact demote) the return type to a BOOL. Whatever the 
> number of items, it will only ever return YES, or 1.
> 
> --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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: The current preferred method for fetching HTTP URLs for IOS

2012-03-09 Thread Marco Tabini
> I've been reading (and trying out) a few approaches on HTTP communication 
> using GCD to do a dispatch_sync or dispatch_async to a dispatch queue or 
> using an NSURLRequest.
> 
> Which of these is the preferred method for ingesting strings from HTTP URLs 
> on iOS?  Are there any plusses to one over the other?

FWIW, my view is that it depends on what your requirements are. For a simple 
request, you can go with an [NSString stringWithContentsOfURL] wrapped in a 
call to dispatch_async to avoid blocking the main thread. 

If you require a more sophisticated level of control over the transaction, 
NSURLRequest is obviously a better choice. Personally, I almost always find 
this to be the case, if only because I can cancel a request if necessary.

As for running an NSURLRequest on a thread other than the main thread, I've 
found very little use for it unless you need the download to continue after 
your app has been pushed into the background. Otherwise, it just introduces an 
additional level of complexity that I prefer to avoid if I can :-)


—Mt.
___

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

Please do not post 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

The current preferred method for fetching HTTP URLs for IOS

2012-03-09 Thread Alex Zavatone
I've been reading (and trying out) a few approaches on HTTP communication using 
GCD to do a dispatch_sync or dispatch_async to a dispatch queue or using an 
NSURLRequest.

Which of these is the preferred method for ingesting strings from HTTP URLs on 
iOS?  Are there any plusses to one over the other?

TIA
- Alex Zavatone



___

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

Please do not post 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: background image

2012-03-09 Thread Roland King
Nope. 


On 9 Mar, 2012, at 19:16, Luca Ciciriello  wrote:

> Hi All.
> Is there a way from iOS code to set an UIImage as iPad desktop wallpaper?
> 
> Luca.
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post 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/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/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


background image

2012-03-09 Thread Luca Ciciriello
Hi All.
Is there a way from iOS code to set an UIImage as iPad desktop wallpaper?

Luca.
___

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

Please do not post 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: Convert PDF CGContextRef to NSView for hi-res printing

2012-03-09 Thread Gilles Celli
Wim and Graham,

Thanks for your quick reply…I finally found out how to print vector based 
graphs thanks to Wim's answer:

I created a NSView based class which draws then (via drawRect:) the Coreplot 
graphs with my custom made method renderGraphsInContext:
It works wonderfully.

Cheers,

Gilles


On Mar 5, 2012, at 11:21 PM, Wim Lewis wrote:

> 
> On 5 Mar 2012, at 12:13 PM, Gilles Celli wrote:
>> I'm stuck on a problem on how to print high resolution graphs on Mac OS X, 
>> by using the wonderful CorePlot (1) framework.
>> I've asked on the Coreplot mailing list but no answer...maybe it's too 
>> obvious that I don't see the tree in the forest:
>> 
>> My method produces a CGContextRef (with CGPDFContextCreate) which then 
>> writes the drawing / plotting as a PDF.
>> This works great: The written PDF file doesn't have any jaggies since it is 
>> vector based. [...] So is it possible to print directly a PDF based 
>> CGContextRef ?
> 
> I haven't looked at CorePlot, but from the -exportActiveGraphsToPDF: 
> implementation, it looks like you could print vector PDF by getting the 
> CGContextRef corresponding to the current NSGraphicsContext:
> 
>NSGraphicsContext *nsContext = [NSGraphicsContext currentContext];
>[self renderGraphsInContext:[nsContext graphicsPort]];
> 
> If this is in the -drawRect: method that is called during printing, then 
> [NSGraphicsContext currentContext] will be the graphics context that is 
> writing PDF to the print file, and -renderGraphsInContext: can emit vector 
> output without any extra conversions.
> 
> 


___

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

Please do not post 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: Accessing array in thread safe way

2012-03-09 Thread Roland King

On Mar 9, 2012, at 5:17 PM, CoGe - Tamas Nagy wrote:

> Thanks for the suggestion, its really appreciated! I'll do some tests - 
> actually the GCD way seems to be the forward.
> 
> Anyway, maybe the array contains non-thread safe objects (QCRenderers) - 
> object that should not be bounce between different threads. But with those, I 
> think I can't use GCD, because GCD cannot guarantie operations will perform 
> on the exact same thread - or at least in my understanding.
> 

That would be a problem. As I understand it also the serial GDC queues do not 
guarantee operations run on the same thread. If you want to go down that path 
you'll need to enque information to create the QCRender, but not actually 
create it until your block starts running, so you then create, use and dispose 
of it in the same call.


___

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

Please do not post 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: NSTableView update basics

2012-03-09 Thread Graham Cox

On 09/03/2012, at 4:42 PM, Erik Stainsby wrote:

> - (NSInteger) numberOfRowsInTableView:(NSTableView *)tableView {
>   return [tableData count] || 0;
> }


What is the intention here? You are doing a boolean OR with the value zero, 
which will promote (in fact demote) the return type to a BOOL. Whatever the 
number of items, it will only ever return YES, or 1.

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

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


Re: Uncaught Exception: NSUnknownKeyException

2012-03-09 Thread Graham Cox

On 09/03/2012, at 5:57 PM, Donald Hall wrote:

> s class is not key value coding-compliant for the key (null).


The key is nil (null). So the problem is where the key is coming from, not the 
operation of the Action class.

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

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


Re: Accessing array in thread safe way

2012-03-09 Thread CoGe - Tamas Nagy
Thanks for the suggestion, its really appreciated! I'll do some tests - 
actually the GCD way seems to be the forward.

Anyway, maybe the array contains non-thread safe objects (QCRenderers) - object 
that should not be bounce between different threads. But with those, I think I 
can't use GCD, because GCD cannot guarantie operations will perform on the 
exact same thread - or at least in my understanding.

On Mar 9, 2012, at 9:51 AM, Quincey Morris wrote:

> On Mar 9, 2012, at 00:30 , CoGe - Tamas Nagy wrote:
> 
>> Thanks Quiencey to pointing this out, however, what you suggest instead of 
>> the current implementation? What I use for this class is putting and/or 
>> update  objects into it from different threads, then access it from an other 
>> (reader) thread (via objectAtIndex: and by enumarating).
> 
> It depends on how often the array gets updated and how big it is. One simple 
> approach is to serialize all access to the array through the main thread 
> (e.g. via 'performSelectorOnMainThread'), but you'd have to enumerate a 
> (serially-retrieved) copy of the array each time.
> 
> The most flexible solution might be to use NSOperationQueue (or GCD) to set 
> up some kind of producer/consumer model. But it still depends on the details 
> of what you're trying to do.
> 
> 






___

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

Please do not post 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: @-directives

2012-03-09 Thread Jean-Daniel Dupas

Le 9 mars 2012 à 03:55, Roland King a écrit :

> Good thinking .. 
> 
> OBJC1_AT_KEYWORD(not_keyword)
> OBJC1_AT_KEYWORD(class)
> OBJC1_AT_KEYWORD(compatibility_alias)
> OBJC1_AT_KEYWORD(defs)
> OBJC1_AT_KEYWORD(encode)
> OBJC1_AT_KEYWORD(end)
> OBJC1_AT_KEYWORD(implementation)
> OBJC1_AT_KEYWORD(interface)
> OBJC1_AT_KEYWORD(private)
> OBJC1_AT_KEYWORD(protected)
> OBJC1_AT_KEYWORD(protocol)
> OBJC1_AT_KEYWORD(public)
> OBJC1_AT_KEYWORD(selector)
> OBJC1_AT_KEYWORD(throw)
> OBJC1_AT_KEYWORD(try)
> OBJC1_AT_KEYWORD(catch)
> OBJC1_AT_KEYWORD(finally)
> OBJC1_AT_KEYWORD(synchronized)
> OBJC1_AT_KEYWORD(autoreleasepool)
> 
> OBJC2_AT_KEYWORD(property)
> OBJC2_AT_KEYWORD(package)
> OBJC2_AT_KEYWORD(required)
> OBJC2_AT_KEYWORD(optional)
> OBJC2_AT_KEYWORD(synthesize)
> OBJC2_AT_KEYWORD(dynamic)
> OBJC2_AT_KEYWORD(__experimental_modules_import)
> 
> So I missed compatibilty_alias, defs, encode, selector (!), try, finally and 
> dynamic. Plus possibly not_keyword and __experimental_modules_import, 
> whatever the heck they are. 

Note that unlike other objc1 keywords, @def is not available in modern obj-c.

AFAIK,  not_keyword is a token used internally by the compiler, and cannot be 
used in code and  @__experimental_modules_import is an unfinished feature, and 
they want more time before deciding what syntax would be used.

-- Jean-Daniel





___

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

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

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

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

Re: Accessing array in thread safe way

2012-03-09 Thread Quincey Morris
On Mar 9, 2012, at 00:30 , CoGe - Tamas Nagy wrote:

> Thanks Quiencey to pointing this out, however, what you suggest instead of 
> the current implementation? What I use for this class is putting and/or 
> update  objects into it from different threads, then access it from an other 
> (reader) thread (via objectAtIndex: and by enumarating).

It depends on how often the array gets updated and how big it is. One simple 
approach is to serialize all access to the array through the main thread (e.g. 
via 'performSelectorOnMainThread'), but you'd have to enumerate a 
(serially-retrieved) copy of the array each time.

The most flexible solution might be to use NSOperationQueue (or GCD) to set up 
some kind of producer/consumer model. But it still depends on the details of 
what you're trying to do.


___

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

Please do not post 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: Accessing array in thread safe way

2012-03-09 Thread CoGe - Tamas Nagy

On Mar 8, 2012, at 11:57 PM, Quincey Morris wrote:

> On Mar 8, 2012, at 14:29 , Charles Srstka wrote:
> 
>> For those two examples, it seems like having the default accessor return an 
>> immutable array via copy would solve the issue.
> 
> It wouldn't solve, e.g., the possibly inconsistency between 'array.count' and 
> a subsequent reference, unless it was coded to keep a "consistent" local 
> reference to the copy of the array, in which case you'd want the copy to be 
> explicit in the API so that a reader of the code would be aware, and that 
> would be a non-atomic-level approach anyway.
> 
> I also wanted to point out that there's another defect in Tamas's code: it 
> needs an explicit atomic 'copy' implementation, and therefore an explicit 
> atomic 'mutableCopy' implementation. And who knows what else …
> 
> I'm begging ya to forgeddaboudit. The atomicity solution is a fantasy**. You 
> can't solve thread safety at that level.
> 
> 
> 
> ** However, we don't know the scenario Tamas wrote the code for. It's 
> possible atomicity solved whatever issue he was facing, that wasn't general 
> thread safety. It's also possible he didn't solve anything, but just changed 
> a likely-to-cause-a-crash bug into a 
> impossible-to-crash-but-likely-to-cause-a-rare-and-subtle-but-almost-impossible-to-debug-error
>  bug.
> 


Thanks Quiencey to pointing this out, however, what you suggest instead of the 
current implementation? What I use for this class is putting and/or update  
objects into it from different threads, then access it from an other (reader) 
thread (via objectAtIndex: and by enumarating).



___

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

Please do not post 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