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 Ik

Re: iOS table views using multiple cell subclasses.

2014-10-22 Thread Mike Abdullah
On 22 Oct 2014, at 15:19, Alex Zavatone 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 his table

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
> On 22 Oct 2014, at 03:17, Greg Parker wrote: > > >> On Oct 21, 2014, at 2:44 AM, Gerriet M. Denkmann >> wrote: >> >> 10.10, Xcode 6.1, using Arc. >> >> The following code works fine, with USE_INVOCATION defined or not: > > [...] > >> Without USE_INVOCATION defined, I get some compiler w

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 wrote: > > But how to fix this? ARC expects a retained pointer; I'd retain it. Things can get weird when calling across boundaries like NSInvocation, or function pointers, or whatever. Even weirder when the calls go between different threads.

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 11:46 AM, Gerriet M. Denkmann 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. -- Scott Ribe scott_r.

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
> On 23 Oct 2014, at 01:02, Scott Ribe wrote: > > On Oct 22, 2014, at 11:46 AM, Gerriet M. Denkmann > 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 'retain'". NSDictionary *temp; [ iv

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Jonathan Mitchell
> On 22 Oct 2014, at 19:10, Gerriet M. Denkmann wrote: > > >> On 23 Oct 2014, at 01:02, Scott Ribe wrote: >> >> On Oct 22, 2014, at 11:46 AM, Gerriet M. Denkmann >> wrote: >>> >>> But how to fix this? >> >> ARC expects a retained pointer; I'd retain it. > > I tried, but got told: "error

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 12:10 PM, Gerriet M. Denkmann 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 incantations wit

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell 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 http://www.elevated-dev.com/ (303) 722-0567 voi

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
> On 23 Oct 2014, at 01:37, Scott Ribe wrote: > > On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell > 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? Tried: [ iv invoke ]; NSDic

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
> On Oct 22, 2014, at 1:04 PM, Gerriet M. Denkmann 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 by-reference arguments

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 i

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 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, on Xcode

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Jonathan Mitchell
> On 22 Oct 2014, at 22:10, Beinan Li 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 ___ Cocoa-dev

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Greg Parker
> On Oct 22, 2014, at 12:04 PM, Gerriet M. Denkmann > wrote: > >> On 23 Oct 2014, at 01:37, Scott Ribe wrote: >> >> On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell >> wrote: >>> >>> Surely the code that returns the object pointed to by temp has to ensure >>> that the object has been corre

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 should

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, @(myAudioS

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 wrote: > It is quite unpredictable. > At first it crashes at a dictionary creation line in a .mm implementation > like this: > >

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 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) 722-0567 voice

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 wrote: > > Note, the initial crashing function is merely translating a C++ enum to the > AVFoundation

Re: Crash with ARC enabled on Xcode 6.1

2014-10-22 Thread Quincey Morris
On Oct 22, 2014, at 14:10 , Beinan Li 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 very clever, an

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 revisio

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, Ke

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 t

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
> On 23 Oct 2014, at 04:31, Greg Parker wrote: > > >> On Oct 22, 2014, at 12:04 PM, Gerriet M. Denkmann >> wrote: >> >>> On 23 Oct 2014, at 01:37, Scott Ribe wrote: >>> >>> On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell >>> wrote: Surely the code that returns the object point

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 06:27