Re: Question about matrix of possibilities

2013-10-16 Thread Marco Tabini
On Oct 16, 2013, at 12:48 PM, Eric E. Dolecki wrote: > I've been asked to make a tableview with 8 rows. Each row has a UISwitch. > Based on a combination of switch values, the result would be a different > image displayed to the right of the table (this is for iPad). > > How would I best go abo

Re: Third time I ask - please help. How to trace visible change in a UIView (UIWebView)

2013-04-24 Thread Marco Tabini
> I seem to have a loose end though -- when I examine the UIWebView's > scrollView property, it initially has a non-nil delegate. I don't know if I > should "interpose" as delegate and after taking my snapshot, call the > original delegate, or only set myself as a delegate instead of the origin

Re: Third time I ask - please help. How to trace visible change in a UIView (UIWebView)

2013-04-22 Thread Marco Tabini
On 2013-04-22, at 9:04 AM, Motti Shneor wrote: > To be very precise --- I'd like to know how to be notified about ANY UIView > visual change. It somehow seems very obvious to me that such "delegate call" > must exist. Maybe I'm overlooking something very basic here. I think I had completely m

Re: Third time I ask - please help. How to trace visible change in a UIView (UIWebView)

2013-04-22 Thread Marco Tabini
On 2013-04-22, at 3:26 AM, Motti Shneor wrote: > Hello everyone. I asked this several times before, but no one gave any hint > -- I'd like to know if anyone here has any clue, at least where to search for > an answer. > > I need to observe the visible contents of a UIWebView dIsplayed in my i

Re: How to implement readonly property

2012-11-12 Thread Marco Tabini
> This is completely the wrong way to implement a property. The static > variable will be shared between all instances. Here's how you should be > doing a lazy loaded var: > > @implementation MyClass > { >NSDictionary *_someDictionary > } > > - (NSDictionary *)someDictionary > { >stat

Re: How to implement readonly property

2012-11-12 Thread Marco Tabini
Looking at the docs, dispatch_once takes care of the synchronization for you: https://developer.apple.com/library/mac/ipad/#documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html It should therefore be thread safe to use without any additional synchronization code. Se

Re: ARC issue

2012-11-07 Thread Marco Tabini
I wonder if the problem might be that data is an autoreleased object, which automatically gets dealloc'ed at the end of the autorelease pool (as explained in the docs). Have you tried replacing *error = data with *error = [data copy] and seeing what happens? On 2012-11-07, at 8:05 AM, Andrea

[ANN]: Beeblex - Free IAP verification service for iOS

2012-07-18 Thread Marco Tabini
validation against Apple's IAP services through our own services. It is really free—we don't even collect any information we don't absolutely need to run it. You can find it here: http://www.beeblex.com/ Thanks! Marco Tabini 416

Re: KVG generic enough?

2012-07-18 Thread Marco Tabini
On 2012-07-18, at 9:08 AM, William Squires wrote: > Okay, after reading some of the documentation on KVC coding, I understand (I > think) that the point is to allow me to specify a property of an object with > an NSString, then set/get that property value using KVC (i.e. valueForKey: or > se

Re: How to implement an object whose properties are really dictionary entries.

2012-07-11 Thread Marco Tabini
On 2012-07-11, at 10:03 AM, Dave DeLong wrote: > It sounds like the OP is looking for a model object that uses an > NSMutableDictionary as the backing store for its properties, as opposed to > individual ivars. You can do this. > > You declare all your properties, and you declare a single NS

Re: Dynamic modification of text search results

2012-07-04 Thread Marco Tabini
On 2012-07-04, at 1:01 PM, Martin Hewitson wrote: > > On 4, Jul, 2012, at 03:22 PM, Marco Tabini wrote: > >>> Does anyone have any good suggestions as to how to update my search results >>> when the underlying source text changes? Do I have to listen for all >

Re: Dynamic modification of text search results

2012-07-04 Thread Marco Tabini
> Does anyone have any good suggestions as to how to update my search results > when the underlying source text changes? Do I have to listen for all changes > from the underlying text objects and try to adapt, or is there a better > pattern for doing this? Xcode does this nicely: no matter what

Using Instruments to profile UITableView drawing

2012-04-26 Thread Marco Tabini
I wonder if someone could point me to the right way to profile poorly-performing custom-drawn UITableView cells. I've come across this problem several times, and usually manage to figure out how to solve it, but my process is not very scientific—there's far too much trial and error involved, and

Re: iOS App - crash when clearing a UITableDetailView

2012-04-03 Thread Marco Tabini
Hi David— On 2012-04-03, at 6:33 AM, David Delmonte wrote: > After changing a setting and removing a subview from a UITableDetailView, I > get crashes when I accidentally swipe the detail view. Can you reduce this down to a code sample? There is no such thing as a UITableDetailView (I used to

Re: Passing data through a segue

2012-04-02 Thread Marco Tabini
On 2012-04-02, at 7:15 AM, Rick Mann wrote: > Thanks for the quick response. > > I think I'm okay with sending stuff through the sender parameter, although I > do agree it's a bit ugly. > > Problem is, my didSelectRowAtIndexPath isn't getting called... :-( The > delegate is set correctly, so

Re: Question about UIImage, scaling, and UIGraphicsBeginImageContextWithOptions

2012-03-27 Thread Marco Tabini
Hi Ray— > But this seems kludgy and it's using programmer's knowledge, so to speak. I > watched WWDC2010 session 134 "Optimize your iPhone App for the Retina > Display" again, searched stackoverflow etc. but I can't find a more elegant > solution. What would be a more thorough approach? Maybe i

UIBezierPath stroke oddity

2012-03-20 Thread Marco Tabini
In an attempt to figure out how well gesture recognizers work, I've built a very simple app that uses a UIPanGestureRecognizer and using them to construct a UIBezierPath that I then stroke, but I am getting strange artifacts on the resulting drawing operation (see http://cl.ly/0N2R411O1t1x3w2N3Q

Re: How to get Mac codesign certificate?

2012-03-17 Thread Marco Tabini
> Can you not just use a free provider, like http://www.startssl.com/? I'm not an expert, but I think the free cert they provide cannot be used for code signing. One other alternative may be the Developer ID initiative that Apple has announced as part of OS X 10.8 Mountain Lion, but I can't fig

Re: How to get Mac codesign certificate?

2012-03-17 Thread Marco Tabini
On 2012-03-17, at 9:18 AM, Gerriet M. Denkmann wrote: > But I want to codesign my OS X apps. > So how do I get the necessary certificate? You need to buy it from a certificate authority, like Thawte or Verisign (or one of the myriad resellers) and they will all be happy to sell you one at price

Re: Why so many public properties all up in my grizzle?

2012-03-16 Thread Marco Tabini
> That time has passed now, so you can now completely specify IBOutlets (and > IBActions) in your implementation file and hide the details from the outside > world. If you want properties, you can use a class extension like so to add > them: Sorry to hijack this conversation, but I've been mean

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

Re: Finding object array index when iterating through array

2012-03-07 Thread Marco Tabini
> 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? [array indexOfObject:object] should do the trick, t

Re: JSON validator for Xcode

2012-03-07 Thread Marco Tabini
> BOOL isTurnableToJSON = [NSJSONSerialization isValidJSONObject: responseData]; > NSLog(@"Is legit for JSON: %d", isTurnableToJSON ); > NSLog(@"Is legit for JSON: %@", isTurnableToJSON ? @"YES" : @"NO"); // > this is how we handle a bool :/ Are you sure that you are using isTurnable

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: Question on handling very large images

2012-03-03 Thread Marco Tabini
> The problem is that if you do this in a naive way, with a single huge pixmap, > you will have poor locality of reference. Once you get to 1024 RGBA pixels > across, every scan-line will occupy its own memory page. So any operation > that crosses lots of scan lines but only uses a small fractio

Question on handling very large images

2012-03-02 Thread Marco Tabini
Hi Everyone, I find myself in the situation of having to manipulate and display a few very large images in an app running on iOS (potentially in the tens of megapixels at 24 bits/pixel), and I am trying to figure out what the correct pattern for doing so is. I've Googled for solutions, but the

Re: Suggestions for forcing NSSlider to some values, without tickmarks

2012-03-01 Thread Marco Tabini
On 2012-03-01, at 4:18 PM, Sean McBride wrote: > Hi all, > > I have a continuous linear NSSlider who's range is -180 to 180 degrees. I > don't want tick marks because any value is acceptable. However, the value > zero is important, and I need for the user to be able to get to exactly 0.0 > (

Re: ARC in Snow Leopard?

2012-02-11 Thread Marco Tabini
On 2012-02-11, at 6:25 PM, William Squires wrote: > is ARC a Lion-only feature or will an ARC-compiled app work on 10.6.8 > assuming no other Lion features are used? According to Apple, ARC-compiled apps run on SL, but they must be compiled on Lion, because the SL version of Xcode doesn't inclu

Re: How do you run an app on the device with Instruments?

2012-01-30 Thread Marco Tabini
On 2012-01-30, at 5:10 PM, G S wrote: > So... no one knows how to launch an app on the device with Instruments? Launch Instruments Select an iOS instrument Click “All Processes,” select your device from the list Click “All Processes” again, choose “Attach to Progress” is the app is already runn

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Marco Tabini
On 2012-01-27, at 2:14 PM, Jens Alfke wrote: > I'm really used to using -performSelector:withObject:afterDelay: to make > something happen later. But I'd much rather use a block than a target/action. > I can't find any API for this, however. Am I missing something? What I want > is basically li

Re: ARC and blocks

2012-01-26 Thread Marco Tabini
On 2012-01-26, at 6:09 PM, Jeff Kelley wrote: > Without ARC, you would use __block to prevent the block from retaining the > object and causing the retain cycle. With ARC, however, the object is > retained when you put it into the variable, so to avoid a retain cycle, you > have to declare it l

Re: ARC and blocks

2012-01-26 Thread Marco Tabini
On 2012-01-26, at 3:51 PM, Jan E. Schotsman wrote: > Hello, > > This code is given in the "Transitioning to ARC Release Notes" as an example > of accomodating blocks in an ARC environment: > > __block MyViewController *myController = [[MyViewController alloc] init…]; > // ... > myController.com

Re: Angle of touch point from center of view?

2012-01-08 Thread Marco Tabini
On 2012-01-05, at 1:49 PM, Eric E. Dolecki wrote: > I'd like to calculate the angle from a center point of a view to a touch > point. > > 0º behind top of screen, 180º being bottom of screen. > > Calculating from touchesMoved. I think you can just retrieve the arctangent between the x axis and

Re: Saving PNG files from NSImage

2011-08-29 Thread Marco Tabini
Hi Martin— On 2011-08-29, at 8:18 AM, Martin Linklater wrote: > Can anyone point me in the right direction as to how to save my NSImage to a > PNG file ? Or some documentation which actually describes how to convert the > NSCGImageSnapshotRep into something I can save out ? I've spent a few hou