Re: SSL NSURLConnection to fake-cert server?

2012-03-19 Thread Conrad Shultz
There's probably a way to do this on a per-connection basis, but the easiest workaround is to install your signing certificate on the device. I usually just email my certificate to myself. Mobile Mail understands certificate attachments and will prompt for installation permission. Note that t

SSL NSURLConnection to fake-cert server?

2012-03-19 Thread Rick Mann
I'm connecting to my dev server which has a self-signed cert. When I do this, NSURLConnection complains with: NSLocalizedDescription = "An SSL error has occurred and a secure connection to the server cannot be made."; NSLocalizedRecoverySuggestion = "Would you like to connect to the server

How to get max size of view according to constraints?

2012-03-19 Thread Charles Srstka
As everyone knows, if you have a view with a bunch of subviews and you’ve got NSLayoutConstraints set up for everything, in many cases you might end up with a minimum or maximum size for the view beyond which the constraints are impossible to satisfy, and if you try to resize the view outside th

Re: const correctness

2012-03-19 Thread Ian Joyner
Really const correctness in the first place belonged in the Objective-C group. If you read the rest of my post I'm talking about immutability and const correctness, so although this comment on popularity came first it was just a subtopic and you have picked on this as a sub topic of the post ra

Re: const correctness

2012-03-19 Thread Ian Joyner
On 20 Mar 2012, at 02:43, Nick Zitzmann wrote: > On Mar 19, 2012, at 5:51 AM, Ian Joyner wrote: > >> Actually NSArray. Note NSMutableArray inherits from NSArray because it adds >> extra functionality in methods that can change the object. You can assign an >> NSMutableArray object to an NSArray

Re: creating a favorites bar

2012-03-19 Thread Mark Munz
You might check out the AMButtonBar code from harmless Cocoa. Sounds like it may be what you're after or at least get you a ways there. http://www.harmless.de/cocoa-code.php On Mon, Mar 19, 2012 at 5:33 PM, Rick C. wrote: > Great thanks and yes I suppose scope bar is the more correct term... >

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

2012-03-19 Thread Charles Srstka
On Mar 19, 2012, at 7:28 PM, William Squires wrote: > The fact that the header declares your IBOutlets and IBActions is > intentional, otherwise your design would be too-tightly coupled; this isn't > good... Not only does IB need to know where the outlets and actions are, so > do any other desi

Static table view cell no longer loads?

2012-03-19 Thread Rick Mann
I've been experimenting with the static table view cell stuff in iOS 5. It was working fine, 'till I connected my table view's data source and delegate outlets to my controller. This caused the static content to stop loading. Fine, I realize why that's the case. So I undid those connections. But

Re: creating a favorites bar

2012-03-19 Thread Rick C.
Great thanks and yes I suppose scope bar is the more correct term... On Mar 20, 2012, at 2:23 AM, David Riggle wrote: > I wanted something similar recently (especially the drag & drop rearranging). > I didn't find anything suitable on the web and had to implement it all from > scratch. Despit

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

2012-03-19 Thread William Squires
On Mar 16, 2012, at 4:00 PM, Brian Lambert wrote: > I’ve been developing iOS applications full-time for about 6 months now and > I love it. I feel pretty strong on the platform now. > > I have a lingering question about something that’s really been bugging the > heck out of me, though, that I th

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread Roland King
On Mar 20, 2012, at 7:27 AM, G S wrote: > Yep, thanks. Someone pointed that out. > > I went through my whole project and audited every file for memory management, > reinstating properties for everything. After forgetting not to use > properties in the init and dealloc methods and having to c

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread Eeyore
On Mar 19, 2012, at 4:27 PM, G S wrote: > That reminds me of another question, though: Someone earlier mentioned the > need to release elements loaded from the nib, in dealloc. I didn't think > this was necessary, so I don't do it. And there are no apparent leaks as a > result. What's the stor

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread Charles Srstka
On Mar 19, 2012, at 6:27 PM, G S wrote: > That reminds me of another question, though: Someone earlier mentioned the > need to release elements loaded from the nib, in dealloc. I didn't think > this was necessary, so I don't do it. And there are no apparent leaks as a > result. What's the st

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread G S
> > Are you using NSViewController or NSWindowController? UIViewController and derivatives. ___ 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

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread Nick Zitzmann
On Mar 19, 2012, at 5:27 PM, G S wrote: > That reminds me of another question, though: Someone earlier mentioned the > need to release elements loaded from the nib, in dealloc. I didn't think > this was necessary, so I don't do it. And there are no apparent leaks as a > result. What's the stor

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread Greg Parker
On Mar 19, 2012, at 4:27 PM, G S wrote: > That reminds me of another question, though: Someone earlier mentioned the > need to release elements loaded from the nib, in dealloc. I didn't think > this was necessary, so I don't do it. And there are no apparent leaks as a > result. What's the story

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread Greg Parker
On Mar 19, 2012, at 3:58 PM, G S wrote: > I will convert to ARC when I have time, but I'm using a couple of open-source > libraries that I don't want to convert right now. ARC supports that. As long as everybody follows Cocoa's naming conventions, you can compile some files with ARC and other f

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread G S
Yep, thanks. Someone pointed that out. I went through my whole project and audited every file for memory management, reinstating properties for everything. After forgetting not to use properties in the init and dealloc methods and having to correct that, the app is running great and there's not

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread Charles Srstka
On Mar 19, 2012, at 5:58 PM, G S wrote: > I will convert to ARC when I have time, but I'm using a couple of > open-source libraries that I don't want to convert right now. You can call non-ARC code from ARC, though. Libraries, even other source files within your own project. That’s the beauty of

Re: How to support larger NSView hierarchy?

2012-03-19 Thread Keith Knauber
On Mar 15, 2012, at 11:29 PM, Kyle Sluder wrote: On Wed, Mar 14, 2012, at 08:15 PM, Keith Knauber wrote: >> The goal is to update this cocoa GUI app at up to 30 fps, with as little >> impact on my real-time thread and a separate apps' video frame rate as >> possible. > > I must ask, what the hec

Re: How to support larger NSView hierarchy?

2012-03-19 Thread Keith Knauber
On Mar 15, 2012, at 11:29 PM, Kyle Sluder wrote: On Wed, Mar 14, 2012, at 08:15 PM, Keith Knauber wrote: >> The goal is to update this cocoa GUI app at up to 30 fps, with as little >> impact on my real-time thread and a separate apps' video frame rate as >> possible. > > I must ask, what the hec

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread G S
On Mon, Mar 19, 2012 at 3:47 PM, Roland King wrote: > And do you now understand why you are releasing the wrong thing? > Well, I understand why my code just happens to be releasing the right thing, but easily couldn't. Obviously the getter might be coded to return anything, including a wholly d

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread Roland King
And do you now understand why you are releasing the wrong thing? if not please go read the replies from Eeyore and I again, you cannot release the result of a method call which returns an object you don't own. Your code as written is a hack, it happens to work because the property is a simple re

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread David Duncan
On Mar 19, 2012, at 5:18 AM, G S wrote: > self.imagePicker = [[UIImagePickerController alloc] init]; > > [self.imagePicker release]; > > I do this in many places, but in a few of them the analyzer says: > > *Property returns an Objective-C object with a +0 retain count* > *Incorrect decrement o

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread G S
On Mon, Mar 19, 2012 at 6:18 AM, Roland King wrote: > No, the analyzer is right and your code is somewhat confused. I'm trying > to figure out how you ended up with code like that, did you find you had an > extra retain somewhere and need to get rid of it? Yes. The allocated object has a retai

Moving connections to new object

2012-03-19 Thread Rick C.
Hi again, I'm recoding some older projects and I wanted to know in IB (Xcode 4) if I have an object of one type (let's say NSView) and I want to change it to a different type (let's say NSObject with blue cube) is there any way to automatically move over the connections as well? Or do I have t

Re: The use of UIActionSheet mysteriously disables our app with a white screen after memory warning.

2012-03-19 Thread G S
On Mon, Mar 19, 2012 at 9:29 AM, Rhythmic Fistman wrote: > I have this problem too. I have a small non-storyboard project that > reproduces it & a TSI in progress. > > Woah, finally, someone else emerges! Please let us know what you discover! Does your scenario have anything in common with the o

Re: Device/Resolution independent positioning of GUI items on iOS

2012-03-19 Thread Conrad Shultz
On 3/19/12 2:46 PM, Brian Lambert wrote: > I think this would be insanely cool. It would allow one to build ONE XIB > with N modes for iPhone Portrait, iPhone Landscape, iPad Portrait, iPad > Landscape, LTR, RTL, and so on, all sharing a base set of controls, views, > and connections to outlets an

Re: Device/Resolution independent positioning of GUI items on iOS

2012-03-19 Thread Alex Zavatone
FWIW, I agree. This would allow any programmer (or even a non programmer) to lay out their screen, then switch to the rotated view and simply drag the items to where they think they should be. Viola. Both orientations are laid out. Sort of an approach of, "portrait is the default orientation

Re: Device/Resolution independent positioning of GUI items on iOS

2012-03-19 Thread Brian Lambert
Imagine now if someone at Apple working on Interface Builder conjured up the notion of adding "modes" for a view design. This is the coolest idea ever for Interface Builder. :-) And I don't even think it would be *all that hard* to do. I add a new UIViewController subclass to my project, select

Re: There's obviously something I don't understand about autorelease.

2012-03-19 Thread Matt Neuburg
On Mar 19, 2012, at 1:08 PM, Quincey Morris wrote: > On Mar 19, 2012, at 11:48 , Matt Neuburg wrote: > >> As long as we're just dreaming up our own linguistic world, I'd suggest that >> instead of "owning" we say "owning-copying". I've never liked the way "copy" >> implies "retain". The word "

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

2012-03-19 Thread Matt Neuburg
On Mar 19, 2012, at 12:45 PM, Brian Lambert wrote: > ivars in the .H file of my Foo class, which no one other than me will ever > use, should be relatively OK. After all, I'm not trying to prevent myself > from knowing anything about my implementation of Foo. I'm just trying to > ensure that

Re: Device/Resolution independent positioning of GUI items on iOS

2012-03-19 Thread Brian Lambert
In Interface Builder all coordinates are expressed in terms of a non-Retina device, and scaled on Retina devices. So running a XIB on non-Retina and Retina "just works". The same holds true for doing it in code (generally). I'll give you an example. One of the projects I'm working on right now

Re: Device/Resolution independent positioning of GUI items on iOS

2012-03-19 Thread Alex Zavatone
On Mar 19, 2012, at 4:43 PM, Sebastian Celis wrote: > viewDidLayoutSubviews (iOS-5-only). > * When you layout your subviews, do so given the current size of your > superview. Don't hardcode your view's width to be 320 just because you > are doing iPhone development and you know your subview takes

Re: Device/Resolution independent positioning of GUI items on iOS

2012-03-19 Thread Alex Zavatone
Well, let's put it this way; there are other things that need to be cleaned up - like 900 lines of code that are called on viewWillAppear in one class, 8 printed pages of warnings as well as a mix of XML, JSON and comma delimited data structures that are fetched ala http on startup. Looking at

Re: Device/Resolution independent positioning of GUI items on iOS

2012-03-19 Thread Brian Lambert
That's a good point. It's really a matter of tradeoffs. I find that in some cases the XIB is adding nothing but overhead and just do everything in code. Especially when the view is simple (contains a small number of controls and views). In other cases, the XIB is useful. Especially when there ar

Re: Device/Resolution independent positioning of GUI items on iOS

2012-03-19 Thread glenn andreas
On Mar 19, 2012, at 3:22 PM, Brian Lambert wrote: > Hi Alex, > > Regarding you having to "repair" code where "UI elements that have been > hardcoded in place with the approach of: Just define the CGRect and we're > all good." I think you're seeing things as being "gross" when they are not. > >

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

2012-03-19 Thread Greg Parker
On Mar 19, 2012, at 12:27 PM, Brian Lambert wrote: > Regarding this: > >In the chapter called "Defining a Class", not only is declaring >an ivar in the .m file covered, but doing it in the .h file is downright >discouraged (rightly so). In practice, this feature of Objective-C... > >

Re: Device/Resolution independent positioning of GUI items on iOS

2012-03-19 Thread Brian Lambert
Hi Alex, Regarding you having to "repair" code where "UI elements that have been hardcoded in place with the approach of: Just define the CGRect and we're all good." I think you're seeing things as being "gross" when they are not. "Just define the CGRect and we're all good" is what IB does. A X

Re: Need a progress indicator in my cell-based NSTableView

2012-03-19 Thread Seth Willits
On Mar 19, 2012, at 9:43 AM, Michael Crawford wrote: > Basically, I want the horizontal barber pole animation in my cell-based > table-view, in order to represent work-in-progress for some operation queue > activity in the app. If anyone knows of a drop-in solution something with a > name like

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

2012-03-19 Thread Charles Srstka
On Mar 19, 2012, at 2:27 PM, Brian Lambert wrote: > Is there a way to declare ivars in the .M file AND have them accessible > from Objective-C Category files for the class? Use an extension instead of a category? Charles ___ Cocoa-dev mailing list (Co

Re: There's obviously something I don't understand about autorelease.

2012-03-19 Thread Quincey Morris
On Mar 19, 2012, at 11:48 , Matt Neuburg wrote: > As long as we're just dreaming up our own linguistic world, I'd suggest that > instead of "owning" we say "owning-copying". I've never liked the way "copy" > implies "retain". The word "retain" tells you something very important, > namely that t

Device/Resolution independent positioning of GUI items on iOS

2012-03-19 Thread Alex Zavatone
In the current project that I'm tasked to repair from the previous two programmers, I've come across a load of UI elements that have been hardcoded in place with the approach of: Just define the CGRect and we're all good. Nothing is laid out in an xib file and sometimes the views are hardcoded o

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

2012-03-19 Thread Brian Lambert
One final note: ivars in the .H file of a public framework is *obviously stupid* as it leaks implementation details. ivars in the .H file of my Foo class, which no one other than me will ever use, should be relatively OK. After all, I'm not trying to prevent myself from knowing anything about my

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

2012-03-19 Thread Brian Lambert
I'd like an argument, please. Regarding this: In the chapter called "Defining a Class", not only is declaring an ivar in the .m file covered, but doing it in the .h file is downright discouraged (rightly so). In practice, this feature of Objective-C... I can't stand thus sort of subt

Re: There's obviously something I don't understand about autorelease.

2012-03-19 Thread Matt Neuburg
On Sat, 17 Mar 2012 21:06:49 -0700, Quincey Morris said: >I shouldn't have suggested that property declarations didn't need memory >management attributes, but all of the current attributes are "wrong" (because >they do double-duty as ivar reference attributes). I *think* the "right" >property

Re: There's obviously something I don't understand about NSDate.

2012-03-19 Thread Matt Neuburg
On Sat, 17 Mar 2012 15:38:20 -0700, G S said: >I have a member variable to hold an NSDate: > >NSDate* _firstBadAccuracyTime; > >At some point, something happens and I set this value to "now": > >_firstBadAccuracyTime = [NSDate date]; > >On my next trip through this function, I calculate ho

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

2012-03-19 Thread Matt Neuburg
On Fri, 16 Mar 2012 17:11:24 -0400, Marco Tabini said: >> 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 >>

Re: creating a favorites bar

2012-03-19 Thread Peter Teeson
Did you look at NSToolbar and NSToolbar item? Also the sample code SimpleToolbar or ToolbarSample? If that isn't what you need perhaps you can expand bit more on what you need? respect…. Peter On 2012-03-19, at 12:20 PM, Rick C. wrote: > Hi, > > Any tips on how I might create a favorites bar

Re: creating a favorites bar

2012-03-19 Thread David Riggle
I wanted something similar recently (especially the drag & drop rearranging). I didn't find anything suitable on the web and had to implement it all from scratch. Despite being mentioned in the Apple HIG, there is no OS support for scope bars. http://developer.apple.com/library/mac/documentatio

Re: const correctness

2012-03-19 Thread Peter Teeson
Amen. On 2012-03-19, at 11:55 AM, Jens Alfke wrote: > I don’t mean to be rude, but I’m about at my personal limit of patience with > the amount of off-topic stuff one has to wade through on the Apple lists > lately (especially xcode-users, but here too.)

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

2012-03-19 Thread Matt Neuburg
On Sat, 17 Mar 2012 01:45:33 -0700, G S said: >> >> This pattern is pretty questionable though in terms of OO — you have one >> class (NSNib, UINib, etc.) directly setting instance variables in another >> class (your view controller) and using runtime functions to hack around >> things like @priva

Re: Need a progress indicator in my cell-based NSTableView

2012-03-19 Thread Ken Thomases
On Mar 19, 2012, at 11:43 AM, Michael Crawford wrote: > Basically, I want the horizontal barber pole animation in my cell-based > table-view, in order to represent work-in-progress for some operation queue > activity in the app. If anyone knows of a drop-in solution something with a > name lik

Re: UIFont system font on Retina displays

2012-03-19 Thread Jens Alfke
On Mar 19, 2012, at 9:55 AM, Jon Brooks wrote: > My question is: Why is the system font now excluded from the array of > familyNames? Does the dot in front denote some kind of private status? A “.” or “%” prefix on a font name has always (literally back to 1984) meant that the font is not us

UIFont system font on Retina displays

2012-03-19 Thread Jon Brooks
On Retina display devices, such as the 3rd generation iPad, I found that the system font returned by [UIFont systemFontOfSize:] is a font whose family name is not included in the array of font families returned by [UIFont familyNames]. The family name that is returned is ".HelveticaNeueUI" No

Re: The use of UIActionSheet mysteriously disables our app with a white screen after memory warning.

2012-03-19 Thread Rhythmic Fistman
I have this problem too. I have a small non-storyboard project that reproduces it & a TSI in progress. I'd love to sort it out. RF. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the l

Need a progress indicator in my cell-based NSTableView

2012-03-19 Thread Michael Crawford
Basically, I want the horizontal barber pole animation in my cell-based table-view, in order to represent work-in-progress for some operation queue activity in the app. If anyone knows of a drop-in solution something with a name like NSProgressIndicatorCell, that I can use for this, that would

creating a favorites bar

2012-03-19 Thread Rick C.
Hi, Any tips on how I might create a favorites bar similar to what Mail.app features? Thanks, rc ___ 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 co

Re: const correctness

2012-03-19 Thread Jens Alfke
On Mar 19, 2012, at 4:51 AM, Ian Joyner wrote: > Popularity is more a proof of mass stupidity rather than quality. The cult of > C followed on from what Bob Barton called the cult of FORTRAN in 1963 and > also noted that systems programmers are high priests of a low cult. Please take this off-

Re: const correctness

2012-03-19 Thread Nick Zitzmann
On Mar 19, 2012, at 5:51 AM, Ian Joyner wrote: > Actually NSArray. Note NSMutableArray inherits from NSArray because it adds > extra functionality in methods that can change the object. You can assign an > NSMutableArray object to an NSArray reference, thereby making it unchangeable > via that

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread Eeyore
First, what Roland said. In addition to that, keep in mind that when you code self.imagePicker = aPicker; ... anotherPicker = self.imagePicker; it is best to assume that aPicker and anotherPicker are different objects (even if ... is empty, there may be other threads, or the setPicker code may d

Re: How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread Roland King
No, the analyzer is right and your code is somewhat confused. I'm trying to figure out how you ended up with code like that, did you find you had an extra retain somewhere and need to get rid of it? Again you are misunderstanding ownership. @property( nonatomic, retain ) UIImagePickerControlle

How is this an "incorrect decrement of a reference count"?

2012-03-19 Thread G S
I have this in my header file: * ** @property (nonatomic, retain) UIImagePickerController* imagePicker; ** * The analyzer is complaining about lines like this (but not always): * self.imagePicker = [[UIImagePickerController alloc] init]; [self.imagePicker release]; * I do this in many place

Re: const correctness

2012-03-19 Thread Ian Joyner
On 19 Mar 2012, at 09:31, Shawn Bakhtiar wrote: > "...subtly why C and C++ are poor languages..." > > 1) Is that why most modern operating systems, especially the ones that run in > data centers are written in C? > Popularity is more a proof of mass stupidity rather than quality. The cult of C