Re: copyWithZone archive/unarchive

2015-01-30 Thread David Rowland
It’s best to use ARC uniformly in a project and not mix with non-ARC modules. Xcode has a tool to upgrade projects to ARC. I have used it a number of times, and it seems to do a very good job. David > On Jan 30, 2015, at 8:15 PM, Jerry Krinock wrote: > > >> On 2015 Jan 30, at 10:08, Trygve

Re: No sound through speaker

2015-04-17 Thread David Rowland
Check Apple’s documentation for Audio Sessions, https://developer.apple.com/library/ios/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Introduction/Introduction.html

Re: Rotate a standard Cocoa control?

2015-05-07 Thread David Rowland
In iOS I have used the “transform” property of UIView to rotate a slider. David > On May 7, 2015, at 1:11 PM, Jerry Krinock wrote: > > I would like to subclass NSSlider to make it work like the "volume control" > on a mid 19th-century radio receiver. That is, I want the minimum value to be >

Re: NSDate / NSXMLParser

2009-11-03 Thread David Rowland
On Nov 3, 2009, at 10:04 AM, Chunk 1978 wrote: have you tried it on your device? Yes. The device and the Simulator behave the same way. On Tue, Nov 3, 2009 at 11:26 AM, David Rowland wrote: The SeismicXML sample code uses NSXMLParser to extract data from a file downloaded from the

Re: NSDate / NSXMLParser

2009-11-03 Thread David Rowland
On Nov 3, 2009, at 10:37 AM, Nick Zitzmann wrote: On Nov 3, 2009, at 9:26 AM, David Rowland wrote: No doubt my inexperience with the parser or NSDate is at fault. How do I get the parser to recognize that the time really is UTC? If you're using NSDateFormatter, you set the time zo

Re: NSDate / NSXMLParser

2009-11-03 Thread David Rowland
Thanks to all for this useful discussion. I think I have solved my problem by taking the data from the parser as is and then applying a correction for my offset from GMT when I do my arithmetic. Like this, int offset = [[NSTimeZone localTimeZone] secondsFromGMT]; NSDate *today = [NSDate d

NSDate / NSXMLParser

2009-11-03 Thread David Rowland
The SeismicXML sample code uses NSXMLParser to extract data from a file downloaded from the USGS. The time of an event appears in the file like this, .12:34:32Z According to rfc 822 'Z' means UTC (or GMT if you prefer). I find that the NSDate from the parser is tagged as being in the

Re: NSDate / NSXMLParser

2009-11-03 Thread David Rowland
On Nov 3, 2009, at 12:19 PM, Nick Zitzmann wrote: On Nov 3, 2009, at 1:15 PM, David Rowland wrote: It still gets the hours right but tags the time zone as -0800 (Pacific). If you're basing that off of the description of the NSDate, then of course it does; NSDate objects ha

Re: NSDate / NSXMLParser

2009-11-04 Thread David Rowland
On Nov 4, 2009, at 1:49 AM, Ingvar Nedrebo wrote: The easiest way is to set the timezone on the formatter: [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; Yes! That works. I'm sure I tried it, but I must have misinterpreted the results. _

Re: NSDate / NSXMLParser

2009-11-04 Thread David Rowland
On Nov 4, 2009, at 2:48 AM, Alexander Spohr wrote: The parser CAN parse the timezone and adjust the date accordingly. To parse this date: 20091021T121942+0200 I use this format: MMdd'T'HHmmssZZZ and it works fine. The only thing you need is to find the right timezone format string. Yours

Re: real beginner question

2009-11-16 Thread David Rowland
On Nov 16, 2009, at 12:18 AM, Luca Ciciriello wrote: Hi All. I'm a real beginner in Objective-C/Cocoa developing and I have two questions. First of all I want to ask to you if exists a list dedicated to beginners as I am. This in order to not bother the real programmers in this develo

Re: Best book for learning Objective c and cocoa

2010-03-31 Thread David Rowland
Apple's materials are usually very good, and they are free. In particular see, http://developer.apple.com/iphone/library/referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/index.html#//apple_ref/doc/uid/TP40007594 http://developer.apple.com/iphone/library/documentation/cocoa/Conceptual

Re: "iPhone Programming For OS X Coders"?

2010-04-06 Thread David Rowland
On Apr 6, 2010, at 3:29 PM, Jens Alfke wrote: > I have to confess that I haven't yet learned UIKit. The bits of iPhone > development I've done so far have used networking and crypto APIs, and > CoreAnimation, but hardly any of the UIKit classes. > > What would be the best book for me to learn

Re: iPad Programming Tutorial

2010-04-26 Thread David Rowland
On Apr 26, 2010, at 8:15 AM, ML wrote: > > How about a good book that explains what IB does, how to set delegates, first > responders, connect things up, etc > > I think that misunderstanding prevents me from using IB as much as I really > should. > > - Original Message - > From: "Ma

Re: Getting time zone abbreviations

2010-06-18 Thread David Rowland
On Jun 18, 2010, at 6:38 PM, Rick Mann wrote: > iPhone > > Hi. I need to display the time zone in which a particular time is displayed. > The time zone is created from its full POSIX name (i.e. "Asia/Oral"), but > when I ask the NSTimeZone for its abbreviation, I often get abbreviations in >

Re: Getting time zone abbreviations

2010-06-18 Thread David Rowland
On Jun 18, 2010, at 9:19 PM, Rick Mann wrote: > On Jun 18, 2010, at 21:15:58, David Rowland wrote: > >> >> On Jun 18, 2010, at 6:38 PM, Rick Mann wrote: >> >>> iPhone >>> >>> Hi. I need to display the time zone in which a particular time i

Re: Getting time zone abbreviations

2010-06-18 Thread David Rowland
On Jun 18, 2010, at 6:38 PM, Rick Mann wrote: > Is there any way to get short abbreviations for a TimeZone? I need it > short due to limited space. I need a common abbreviation due to users not > knowing POSIX timezone names. this works for me: NSTimeZone* t

Re: NSTimeZone abbreviations

2010-06-23 Thread David Rowland
And I reported it. On Jun 23, 2010, at 4:52 PM, Rick Mann wrote: > I've reported this bug, and sent Apple sample code to reproduce it. It's an > awful change, and I hope just an oversight that gets fixed in the next iOS 4 > update. > > On Jun 23, 2010, at 15:51:31, August Hahn wrote: > >> On

Re: Selecting UIButtons with code

2011-09-29 Thread David Rowland
This line, >UIButton *button = (UIButton *)[self.view viewWithTag:tag]; is returning something that is not a UIButton, and it won't respond to setSelected. On Sep 29, 2011, at 5:52 AM, Eric E. Dolecki wrote: > I am missing something simple here. The following code doesn't work. I ha

Re: Retain/Release and Properties clarification

2011-10-13 Thread David Rowland
However, if the property is readonly I think you must use direct access to set an initial value. The setter does not exist. David Rowland On Oct 13, 2011, at 10:54 AM, Bayes Scott F wrote: > Thank you, David. > > Sounds like safety first for my code: always use the setter/g

Re: -viewDidUnload not always called?

2011-10-13 Thread David Rowland
My understanding is this, a diagram I made to visualize the process, http://drowland.net/iOS%20Class/View%20Controller%20unloading.pdf On Oct 13, 2011, at 8:02 AM, Fritz Anderson wrote: > On 12 Oct 2011, at 5:39 PM, Rick Mann wrote: > >> I can't tell from the docs for -viewDidUnload if it is

Re: -viewDidUnload not always called?

2011-10-14 Thread David Rowland
Well, thank you. If you are interested, here is the companion diagram for view controller loading, http://drowland.net/iOS%20Class/View%20Controller%20loading.pdf David On Oct 14, 2011, at 8:59 AM, Jon Sigman wrote: > On Oct 13, 2011, at 8:02 AM, Fritz Anderson wrote: > > >My understandin

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread David Rowland
I usually prefer the more explicit form (of any expression) because it more obviously describes what is happening. That is your second example. However, anyone who works with any variant of C quickly becomes comfortable with the first form, so I consider it quite acceptable. There is another fo

Re: [ANN] Cong 0.7

2011-02-11 Thread David Rowland
I have two apps in the store now. I run Cong and drag the release version of either one from the Build folder onto Cong. It gives me one report -- "./Contents folder not found". Earlier versions of these have been accepted and put on the store. What is it telling me? Am I using it wrong?

iPhone double oddity

2011-02-18 Thread David Rowland
I have my appdelegate set up as the delegate for the accelerometer, @interface GLSpriteAppDelegate : NSObject { I declare the method - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration; I implement it in the .m file, - (void)accelerometer:(UIAc

MPVolumeView

2011-02-26 Thread David Rowland
Apple seems to have made it impossible for an app to control the system volume. The user can use the physical buttons, and an app can contain an MPVolumeView which lets the user control the volume, but there is no programmed access to that setting. I want a volume control that looks and behave

Re: MPVolumeView

2011-02-27 Thread David Rowland
o "capture" the button before I can move it. David On Feb 27, 2011, at 1:29 AM, Laurent Cerveau wrote: > Can't you just do what you want using directly CoreAudio? > > laurent > > On Feb 27, 2011, at 12:08 AM, David Rowland wrote: > >> Apple seems to ha

Re: MPVolumeView

2011-02-27 Thread David Rowland
Well, fan my brow, so it does. Except it is very erratic. Only about a third of the time does it respond. Also, I would like it to jump on touchdown, not touchup. D On Feb 27, 2011, at 12:19 PM, Matt Neuburg wrote: > On Sun, 27 Feb 2011 09:58:03 -0800, David Rowland > said: >&g

iPhone animation puzzle

2011-03-19 Thread David Rowland
This works. It fades the label to invisibility. label.alpha = 1.0; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:2.5]; label.alpha = 0; [UIView commitAnimations]; and so does this, label.alpha = 1.0; [UIView animateWithDuration:2.5 animations:^{label.alpha

Re: iPhone animation puzzle

2011-03-20 Thread David Rowland
ks, David On Mar 19, 2011, at 5:08 PM, Roland King wrote: > UIViewAnimationOptionAllowUserInteraction ? > > > > On Mar 20, 2011, at 5:42, David Rowland wrote: > >> This works. It fades the label to invisibility. >> >> label.alpha = 1.0; &

Re: iOS: getting the shakes

2011-05-31 Thread David Rowland
It's an iOS device, not a computer. No mouse, no keyboard. I think you want, - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event You make a subclass of UIView, instantiate it, and implement the above within that subclass. David On May 31, 2011, at 8:42 PM, Eli Bach wro

Re: iOS: getting the shakes

2011-05-31 Thread David Rowland
That should be a subclass of UIResponder. You don't need a UIView, but I suppose you could use an existing one. D On May 31, 2011, at 8:55 PM, David Rowland wrote: > It's an iOS device, not a computer. No mouse, no keyboard. > > I think you want, > > - (void)mo

Re: Good and updated book for iPhone development

2011-06-03 Thread David Rowland
I like "Programming iOS4" by Matt Neuburg (O'Reilly) David On Jun 2, 2011, at 1:37 AM, Wilker wrote: > Hi Guys, > > I have some general experience on programming (8 years) but I'm just > starting on Cocoa / Objective-C world now. > Currently I'm reading the: Cocoa Programming by Pragmatic > Pr

Change in animation?

2011-07-29 Thread David Rowland
I have a routine that presents and then fades a label and a button, - (void)fadeView:(UIView *)theView { theView.alpha = 1.0; infoButton.hidden = FALSE; [UIView animateWithDuration:2.5 animations:^{theView.alpha = 0.0;} completion:^(BOOL finished){infoBu

Re: Change in animation?

2011-07-30 Thread David Rowland
n. Don't > know why changing to Lion would have made a difference however as I think > that option has been off by default in all versions of iOS 4.x, so it should > never have worked. > > On Jul 30, 2011, at 12:44 PM, David Rowland wrote: > >> I have a routine

Re: NSNumber stringValue

2009-12-12 Thread David Rowland
On Dec 12, 2009, at 9:32 AM, Ben Haller wrote: You should not compare floating point numbers for equality in most cases. This is true of any language on any platform. Indeed, some floating-point numbers (such as the one represented by the integer 0x7fc0) will compare as not equal to th

Re: [Moderator] Do not discuss iPad or updated iPhone OS here

2010-01-27 Thread David Rowland
On Jan 27, 2010, at 11:30 AM, Scott Anguish wrote: A pre-emptive note. Do not discuss the iPad product or any updated version of the iPhone OS here. It is not allowed. If you do, you’ll be moderated. Is that like, uuhh, "fixed"? ___ Cocoa-

Re: sine wave

2010-01-31 Thread David Rowland
On Jan 31, 2010, at 6:22 PM, Chunk 1978 wrote: > i'm searching for a general algorithm to produce a cartesian sine wave > that outputs numbers, which i suppose would be based on maximum > distance (range) from Y while using a timer. //Make the transition from buffer to buffer seamless, and a

Re: Carbon is C++?

2010-02-28 Thread David Rowland
On Feb 28, 2010, at 7:24 PM, Erik Buck wrote: > I disagree. I have written very low latency device drivers in Objective-C. > Why do you think Objective-C has too much "latency" for audio? When properly > used, Objective-C programs are no more likely to be preempted than any other > kind of

Re: Carbon is C++?

2010-02-28 Thread David Rowland
On Feb 28, 2010, at 7:35 PM, Paul Bruneau wrote: > That is excellent and I really like the sound of it. Someone please inform > the authors of Apple's iPhone sample code so that I won't have to deal with > C++ anymore! (I'm looking at YOU, SpeakHere!) SpeakHere displays one of the things I lik

[iPhone] MapKit link irregularity

2010-08-12 Thread David Rowland
I'm putting MapKit into my iPhone/iPad app, and the link stage is giving me an error I don't understand. When I direct it to the Simulator all is well. When I choose the Device I get a link error, "_OBJC_CLASS_$_MKMapView", referenced from: objc-class-ref-to-MKMapView in MapViewController.o ld:

GestureRecognizer puzzle.

2010-10-21 Thread David Rowland
In my iPhone app I use beginTrackingWithTouch, etc. to handle a swipe and rotate an OpenGL object. I wanted to add pinch and rotate gestures to do the obvious things. I created a UIRotationGestureRecognizer and a UIPinchGestureRecognizer, added them to the control view and wrote the action meth

Re: $ to Jobs ?

2010-11-23 Thread David Rowland
On Nov 23, 2010, at 2:25 PM, k...@highrolls.net wrote: > I wanted to run an iPhone app I wrote 2 years ago. It would not run. I > plugged the iPhone into iTunes to update software and saw a message that the > apps provisioning certificate had expired. > > Do I have to pay Jobs an annual fee?

accelerometer puzzle

2010-11-29 Thread David Rowland
I have a class defined like this, @interface GAppDelegate : NSObject { and inside that class I have implemented this, // UIAccelerometerDelegate method, called when the device accelerates. - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration;

Re: iOS: erratic compass behaviour

2010-11-29 Thread David Rowland
I believe this is true: Under 4.1 the reading is updated only when the heading changes. Under 4.2 it is updated at the rate requested. My test app was highly erratic until the new OS, now it acts (more or less) the way I expect. What I find strange is that when I bring a magnet near the iPhone,

iPhone puzzle about rotation

2011-01-31 Thread David Rowland
I create a minimal view-based app from an Xcode template, and I implement these UIViewController methods, - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterface

Re: iOS app launching speed

2012-05-15 Thread David Rowland
"Lazy loading" is the usual answer. Don't load a resource until the user needs it. View controllers are built this way. "viewDidLoad" (or loadView if you prefer) should summon the resources and build the view. Look around for other opportunities to delay initialization. David On May 15, 20

Re: Pinching an iPad

2012-05-15 Thread David Rowland
Have you turned on "Multitasking Gestures" in the iPad General Settings? D On May 14, 2012, at 9:26 PM, Gerriet M. Denkmann wrote: > I have an app which can be pinched and zoomed on an iPhone and on the iPhone > Simulator. > > But it can not be zoomed or pinched on iPad or iPad Simulator. >

Re: sync drawing an ever-increasing path

2012-10-23 Thread David Rowland
This worked for me. When initializing your UIView, add an instance variable "shapeLayer" and do this, shapeLayer = [CAShapeLayer layer]; [[self layer] addSublayer:shapeLayer]; In drawRect, set up your path and do this, CABasicAnimation *pathAnimation = [CABasicAnimation an

Re: sync drawing an ever-increasing path

2012-10-23 Thread David Rowland
On Oct 23, 2012, at 1:25 PM, David Duncan wrote: > > On Oct 23, 2012, at 12:34 PM, David Rowland wrote: > >> This worked for me. When initializing your UIView, add an instance variable >> "shapeLayer" and do this, >> >> shapeLayer = [C

Re: iOS books, etc for experienced OSX programmers

2013-02-22 Thread David Rowland
I like Matt Neuburg's book, and I recommend it to iOS classes I teach. Its first person style suits me, and I turn to it for answers and often find something extra. However, it is dense and not for everyone. Some of my students wish there were more examples, but Neuburg explicitly avoids HelloWo

Re: Adding toolbar items only works in viewWillAppear: (?)

2013-03-19 Thread David Rowland
viewWillAppear occurs every time the view reappears, which may be frequently and has nothing to do with the creation and initialization of the view. Each time it appears you are recreating the button and setting in self.prevButton, e.g. which will release the former button and install an identic

Re: Adding toolbar items only works in viewWillAppear: (?)

2013-03-19 Thread David Rowland
, 2013, at 8:36 PM, Koen van der Drift wrote: > > On Mar 19, 2013, at 11:28 PM, David Rowland wrote: > >> viewWillAppear occurs every time the view reappears, which may be frequently >> and has nothing to do with the creation and initialization of the view. Each >&

Re: Adding toolbar items only works in viewWillAppear: (?)

2013-03-20 Thread David Rowland
> view controller's navigation item in conjunction with the creation of its > view is not a good idea, because the circumstances under which the view is > needed are not identical to the circumstances under which the navigation item > is needed. (However, Apple's own code

Re: Combining pan, zoom, and rotate gestures into one?

2013-06-14 Thread David Rowland
Isn't it a matter of implementing this delegate method? - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return YES; } David On Jun 14, 2013, at 5:41 PM, Rick Mann wr

Re: iOS OpenGL ES woes

2013-07-02 Thread David Rowland
I found it helpful to start with a working sample code app. GLSprite was my mentor. David On Jul 2, 2013, at 12:46 PM, Vincent Habchi wrote: > On 2 juil. 2013, at 17:54, Vincent Habchi wrote: > >> Uh, I just realized I had overlooked the call to EAGLContext >> presentRenderbuffer. It shou

Re: IOS floating point performance

2013-08-07 Thread David Rowland
I have written an app that does astronomical calculations like that , Sun and Moon rise and set and location and….. I never saw a problem with speed. I was very impressed with how much it can do. However, are you using Objective C methods for the calculations? The run time dispatch in Objective

Re: IOS floating point performance

2013-08-08 Thread David Rowland
I wrote an app that calculates the positions of Sun and Moon and other information as well. The heart of the Moon calculation is this. I added a loop around it and called a stopwatch at the beginning and end. startTime(); for (int jj = 0; jj<100;++jj) { //in radians double lambda = 3.

Re: IOS floating point performance

2013-08-08 Thread David Rowland
Thomas Wetmore wrote: > >> David, >> >> Those are lightening speeds. So I agree with you wholeheartedly -- there is >> no sense in working on a custom table-driven approach. The current approach >> must already be table-based with speeds like that. >>

Re: IOS floating point performance

2013-08-08 Thread David Rowland
Mac OSX only. > > Tom Wetmore > > On Aug 8, 2013, at 3:59 PM, David Rowland wrote: > >> I ran it in Debug mode which should turn off most optimizations. I ran the >> loop 100 times and then 200 times. The latter took almost exactly twice the >> time as the form

frame puzzle

2013-08-22 Thread David Rowland
CGRect tframe = CGRectMake(12, 12, 100, 100); [appDelegate.buttonController.rotationControl setFrame:tframe]; CGRect qframe = appDelegate.buttonController.rotationControl.frame; buttonController is a UIViewController, rotationControl is a UIControl. When this is executed qframe is report

Re: frame puzzle

2013-08-22 Thread David Rowland
n Thu, Aug 22, 2013 at 4:05 PM, David Rowland wrote: > >> >> >> CGRect tframe = CGRectMake(12, 12, 100, 100); >> [appDelegate.buttonController.rotationControl setFrame:tframe]; >> CGRect qframe = appDelegate.buttonController.rotationControl.frame; >> &

Re: frame puzzle

2013-08-22 Thread David Rowland
, at 3:19 PM, Quincey Morris wrote: > On Aug 22, 2013, at 13:42 , David Rowland wrote: > >> Good suggestion, but such is not the case. Most strange is that when I set a >> breakpoint and use control-click to print a description of rotationControl >> to the log, it show

Re: How to properly flip a UIView's coordinate system

2013-09-22 Thread David Rowland
On Sep 22, 2013, at 4:20 AM, Dave wrote: > > On 21 Sep 2013, at 21:38, Markus Spoettl wrote: > >> Hi, >> >> I have a UIView on iOS that shares (a lot of) code with an NSView I have on >> OSX. That code relies on a LLO (lower left origin) coordinate system and >> it's not an option to chang

Re: iOS7 Controls

2013-09-24 Thread David Rowland
I'm happy to embrace iOS7, but Apple's own software offers a caution. The weather app is almost unreadable - tiny, thin type in white on a light blue background. The calendar won't present a list view unless you are searching. The calculator in scientific mode uses tiny type on "buttons" that ca