RE: Return values of NSAlert

2014-10-22 Thread Lee Ann Rucker
Even the old selector-based one could return NSModalResponse values - I saw it happen once in some over-paranoid code that had a switch for the resultCode and an assert in the default case. Surprise, it wasn't handling Abort. NSSavePanel doc shows it as just -

iOS table views using multiple cell subclasses.

2014-10-22 Thread Alex Zavatone
On my past two gigs, I've spent a fair amount of time subclassing UITableViews and UITableViewCells. Yesterday another programmer came to me with a question where he wants to plop text of variable lines into a custom footer in his table view. Sure, that will work, but honestly, this looked

Re: iOS table views using multiple cell subclasses.

2014-10-22 Thread Mike Abdullah
On 22 Oct 2014, at 15:19, Alex Zavatone z...@mac.com wrote: On my past two gigs, I've spent a fair amount of time subclassing UITableViews and UITableViewCells. Yesterday another programmer came to me with a question where he wants to plop text of variable lines into a custom footer in

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
On 22 Oct 2014, at 03:17, Greg Parker gpar...@apple.com wrote: On Oct 21, 2014, at 2:44 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: 10.10, Xcode 6.1, using Arc. The following code works fine, with USE_INVOCATION defined or not: [...] Without USE_INVOCATION defined, I

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Kyle Sluder
On Wed, Oct 22, 2014, at 12:46 PM, Gerriet M. Denkmann wrote: This seems to prove your guess that the bug is the call to -getReturnValue:. But how to fix this? Rewrite your API to take an array of blocks instead? --Kyle Sluder ___ Cocoa-dev

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 11:46 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: But how to fix this? Can you actually retain a pointer that ARC expects to be already retained, or would be it a NOOP? Sorry, I only use manual memory management, so my previous reply may have been off-base. --

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
On 23 Oct 2014, at 01:02, Scott Ribe scott_r...@elevated-dev.com wrote: On Oct 22, 2014, at 11:46 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: But how to fix this? ARC expects a retained pointer; I'd retain it. I tried, but got told: error: ARC forbids explicit message send of

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Jonathan Mitchell
On 22 Oct 2014, at 19:10, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: On 23 Oct 2014, at 01:02, Scott Ribe scott_r...@elevated-dev.com wrote: On Oct 22, 2014, at 11:46 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: But how to fix this? ARC expects a retained pointer;

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 12:10 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I tried, but got told: error: ARC forbids explicit message send of 'retain'. Yep, makes sense. Is the method signature's method return type correct? If so, your two options would seem to be: - one of those compiler

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell jonat...@mugginsoft.com wrote: Surely the code that returns the object pointed to by temp has to ensure that the object has been correctly retained? So, maybe __autorelease? -- Scott Ribe scott_r...@elevated-dev.com

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
On 23 Oct 2014, at 01:37, Scott Ribe scott_r...@elevated-dev.com wrote: On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell jonat...@mugginsoft.com wrote: Surely the code that returns the object pointed to by temp has to ensure that the object has been correctly retained? So, maybe

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 1:04 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: So, indeed, __autoreleasing seems to be the answer. ( __autoreleasing is used to denote arguments that are passed by reference (id *) and are autoreleased on return.) Honestly, my read was that it was for

Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Beinan Li
Hi CocoaDev, Not sure if it's the right list to post to. My iOS app is coded in Obj-C++ with the ObjC part using ARC. It seemed to work well with Xcode 6.0.x and iOS 8.0 SDK. However, on Xcode 6.1 and iOS 8.1 SDK it starts to crash right away. And it stops crashing if I turn off ARC. I wonder

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread David Duncan
How is your application crashing? On Oct 22, 2014, at 2:10 PM, Beinan Li li.bei...@gmail.com wrote: Hi CocoaDev, Not sure if it's the right list to post to. My iOS app is coded in Obj-C++ with the ObjC part using ARC. It seemed to work well with Xcode 6.0.x and iOS 8.0 SDK. However,

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Jonathan Mitchell
On 22 Oct 2014, at 22:10, Beinan Li li.bei...@gmail.com wrote: However, on Xcode 6.1 and iOS 8.1 SDK it starts to crash right away. And it stops crashing if I turn off ARC. I reckon we need to see the crash details. Can you post them? Jonathan

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Greg Parker
On Oct 22, 2014, at 12:04 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: On 23 Oct 2014, at 01:37, Scott Ribe scott_r...@elevated-dev.com wrote: On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell jonat...@mugginsoft.com wrote: Surely the code that returns the object pointed to by

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Alex Zavatone
You can add an exception breakpoint and on the bottom of the debug Navigator, drag the little slider all the way to the right to see the code execution path that is causing your crash. A exception breakpoint isn't added to any line in code, but traps when any NS exception is thrown. You

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Beinan Li
It is quite unpredictable. At first it crashes at a dictionary creation line in a .mm implementation like this: - (NSString*) getAVAudioSessionMode:(myAudioSessionMode)modeKey { NSDictionary* modeDict = @{ // Here it crashes @(myAudioSessionModeDefault): AVAudioSessionModeDefault,

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Beinan Li
Note, the initial crashing function is merely translating a C++ enum to the AVFoundation builtin constants. Thanks, Beinan On Wed, Oct 22, 2014 at 5:45 PM, Beinan Li li.bei...@gmail.com wrote: It is quite unpredictable. At first it crashes at a dictionary creation line in a .mm

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 3:45 PM, Beinan Li li.bei...@gmail.com wrote: stop reason = signal SIGABRT When there's a SIGABRT, there's usually an error logged. You should look for that, because it might give a good clue. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303)

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Kevin Meaney
Your not creating a static C++ object anywhere are you? One that creates the dictionary before main gets called by any chance? Kevin Sent from my iPhone On 22 Oct 2014, at 22:45, Beinan Li li.bei...@gmail.com wrote: Note, the initial crashing function is merely translating a C++ enum to

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Quincey Morris
On Oct 22, 2014, at 14:10 , Beinan Li li.bei...@gmail.com wrote: And it stops crashing if I turn off ARC. I don’t understand this. How do you turn off ARC? Are you just changing the build setting that controls ARC? It sounds like there are no source code changes. Unless you’ve done something

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Beinan Li
Sorry, I didn't make it clearer. My code used to manage memory without ARC. Then I converted everything to using ARC. The conversion was done automatically via Xcode, with only a few hand edits. It worked without issues with Xcode 6.0.x. By turning off ARC, I meant that I reverted to the revision

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Beinan Li
Oh! I did actually. The method I posted belongs to an ObjC object which is wrapped by a C++ object. That C++ object is a singleton (static). How is this going to affect ARC and why it didn't down-right crash a week ago before I upgraded Xcode? Thanks, Beinan On Wed, Oct 22, 2014 at 7:00 PM,

Search feature on NavigationBar

2014-10-22 Thread Sasikumar JP
Hi, I am working on iOS 8 based application, i want to use UISearchController to provide search feature. I am able to show the searchBar by setting tableViewHeaderView as serachController.searchBar. but this approach shows searchBar permanently on tableView. Instead of that i want to display

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
On 23 Oct 2014, at 04:31, Greg Parker gpar...@apple.com wrote: On Oct 22, 2014, at 12:04 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: On 23 Oct 2014, at 01:37, Scott Ribe scott_r...@elevated-dev.com wrote: On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell

pacemaker in 10.10

2014-10-22 Thread Gerriet M. Denkmann
In 10.9 there was this nice pacemaker daemon (keeping the clock in sync). In 10.10: /private/var/db/ntp.drift exists and has a plausible value: -rw-r--r--@ 1 root wheel 8 21 Oct 17:29 /private/var/db/ntp.drift cat /private/var/db/ntp.drift -26.396 -rwxr-xr-x 1 root wheel 24720 10 Sep