Re: Accessing array in thread safe way

2012-03-06 Thread Dave Zarzycki
On Mar 6, 2012, at 11:51 AM, Jan E. Schotsman wrote: > Hello, > > I have an array of progress values (number objects) for subprojects, from > which I calculate the overall progress . > The array is an atomic property of the project class. > > Is it safe to access this array from multiple thr

Re: Accessing array in thread safe way

2012-03-06 Thread Stephen J. Butler
On Tue, Mar 6, 2012 at 1:51 PM, Jan E. Schotsman wrote: > I have an array of progress values (number objects) for subprojects, from > which I calculate the overall progress . > The array is an atomic property of the project class. > > Is it safe to access this array from multiple threads, using me

Re: JSON validator for Xcode

2012-03-06 Thread Alex Zavatone
I made the mistake that an NSString would be a legit input var for this. Newb error. On Mar 6, 2012, at 5:11 PM, Jens Alfke wrote: > > On Mar 6, 2012, at 10:27 AM, Alex Zavatone wrote: > >> So I added the validation call: >> >> BOOL isTurnableToJSON = [NSJSONSerialization >> isValidJSONObje

Re: JSON validator for Xcode

2012-03-06 Thread Jens Alfke
On Mar 6, 2012, at 10:27 AM, Alex Zavatone wrote: > So I added the validation call: > > BOOL isTurnableToJSON = [NSJSONSerialization > isValidJSONObject: object] > But running this against the imported JSON result and against my JSON, a the > BOOL never returned 1. It was returned 0, even a

Re: Accessing array in thread safe way

2012-03-06 Thread Marco Tabini
On 2012-03-06, at 2:51 PM, Jan E. Schotsman wrote: > Hello, > > I have an array of progress values (number objects) for subprojects, from > which I calculate the overall progress . > The array is an atomic property of the project class. > > Is it safe to access this array from multiple threads,

Re: JSON validator for Xcode

2012-03-06 Thread Tony Parker
Hi Alex, On Mar 6, 2012, at 8:38 AM, Alex Zavatone wrote: > I'm in the middle of converting some data to JSON and have successfully run > my files through the JSONLint validator (http://jsonlint.com/). > > However, when trying to convert these files into serialized JSON in Xcode, > the JSON d

UIKit-additions and class references

2012-03-06 Thread Mikkel Islay
Hello, Does anyone know the reason why the UIKit-additions for NSString, NSValue etc. aren't mentioned in the respective class references in the Apple documentation for iOS? Regards, Mikkel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Plea

Re: JSON validator for Xcode

2012-03-06 Thread Alex Zavatone
I was under the assumption - maybe I can't read documentation - that IsValidJSONObject would check to see if the Foundation object could be turned into a JSON object. From the docs: isValidJSONObject: Returns a Boolean value that indicates whether a given object can be converted to JSON data.

Re: JSON validator for Xcode

2012-03-06 Thread Fritz Anderson
On 6 Mar 2012, at 1:59 PM, Alex Zavatone wrote: > Yeah, I've got the JSON down to this: > > [1] > > and > {"A":1} > > And the code: > BOOL isTurnableToJSON = [NSJSONSerialization isValidJSONObject: responseData]; > NSLog(@"Is legit for JSON: %d", isTurnableToJSON ); > NSLog(@"Is l

Finding object array index when iterating through array

2012-03-06 Thread Prime Coderama
I have an array and I am iterating through it using this technique: > for (id object in array) { > // do something with object > } Is there way to obtain the object's current array index position or do I have to add a counter? Thanks in advance.

Re: JSON validator for Xcode

2012-03-06 Thread Alex Zavatone
Yeah, I've got the JSON down to this: [1] and {"A":1} And the code: BOOL isTurnableToJSON = [NSJSONSerialization isValidJSONObject: responseData]; NSLog(@"Is legit for JSON: %d", isTurnableToJSON ); NSLog(@"Is legit for JSON: %@", isTurnableToJSON ? @"YES" : @"NO"); // this is

Accessing array in thread safe way

2012-03-06 Thread Jan E. Schotsman
Hello, I have an array of progress values (number objects) for subprojects, from which I calculate the overall progress . The array is an atomic property of the project class. Is it safe to access this array from multiple threads, using methods like objectAtIndex and replaceObjectAtIndex?

Re: Efficiency Question...

2012-03-06 Thread R
Thanks to all! Ron On Mar 6, 9:24 am, Kyle Sluder wrote: > On Mar 5, 2012, at 11:21 PM, Graham Cox wrote: > > > > > Is the goal to go from red to blue from left to right? > > > Why not add a single layer with red on the left, alpha = 1, and blue on the > > right, alpha = 1? I don't see why yo

Re: JSON validator for Xcode

2012-03-06 Thread Fritz Anderson
On 6 Mar 2012, at 12:27 PM, Alex Zavatone wrote: > So I added the validation call: > > BOOL isTurnableToJSON = [NSJSONSerialization > isValidJSONObject: object] > > But running this against the imported JSON result and against my JSON, a the > BOOL never returned 1. It was returned 0, even a

Re: JSON validator for Xcode

2012-03-06 Thread Alex Zavatone
So I added the validation call: BOOL isTurnableToJSON = [NSJSONSerialization isValidJSONObject: object] But running this against the imported JSON result and against my JSON, a the BOOL never returned 1. It was returned 0, even against JSON that converted properly. Has anyone gotten this

JSON validator for Xcode

2012-03-06 Thread Alex Zavatone
I'm in the middle of converting some data to JSON and have successfully run my files through the JSONLint validator (http://jsonlint.com/). However, when trying to convert these files into serialized JSON in Xcode, the JSON does not pass the isValidJSONObject test, returning NO. Of course I can

Re: Efficiency Question...

2012-03-06 Thread Kyle Sluder
On Mar 5, 2012, at 11:21 PM, Graham Cox wrote: > > Is the goal to go from red to blue from left to right? > > Why not add a single layer with red on the left, alpha = 1, and blue on the > right, alpha = 1? I don't see why you need to composite two layers. > > Drawing a gradient dynamically is

Re: Efficiency Question...

2012-03-06 Thread Fritz Anderson
On 6 Mar 2012, at 1:21 AM, Graham Cox wrote: > Why not add a single layer with red on the left, alpha = 1, and blue on the > right, alpha = 1? I don't see why you need to composite two layers. > > Drawing a gradient dynamically is probably more efficient than blitting a > PNG, and will be resol

Re: Efficiency Question...

2012-03-06 Thread Graham Cox
On 06/03/2012, at 5:40 PM, R wrote: > I want to blend two colors as a background. I'm adding a layer using > CAGradient layer, starting on the left with blue alpha=1. and ending > on the right with blue alpha=0. > > I then add another layer using red on the left with alpha=0. and > ending on th