2

I have two basic views with labels, text fields and swiches:
owerview First view is the root view of the navigation controller. There is a named segue from first view to second view as "next" called when clicking the bar button "İleri" in first view. Here is my code for both ViewController:

HMXNewPersonelStep1ViewController.h

HMXNewPersonelStep1ViewController.m

HMXNewPersonelStep2ViewController.h

HMXNewPersonelStep2ViewController.m

I am running the application clicking button "İleri" in first view and navigating to second view with no problem. But when i click button "Geri" in second view, program navigates back to firs view, i can see the fisrt view for a short time, and application crashes with following error:

Thread 1: EXC_BAD_ACCESS

It crashes on:
crash point

Debug trace:

debug trace

Debug detail for [_NSDictionaryM dealloc]:

libobjc.A.dylib`-[NSObject release]:
0x11339d0:  pushl  %ebp
0x11339d1:  movl   %esp, %ebp
0x11339d3:  pushl  %edi
0x11339d4:  pushl  %esi
0x11339d5:  subl   $16, %esp
0x11339d8:  calll  0x11339dd                 ; -[NSObject release] + 13
0x11339dd:  popl   %edi
0x11339de:  movl   8(%ebp), %esi
0x11339e1:  movl   %esi, (%esp)
0x11339e4:  calll  0x1132541                 ; _objc_rootReleaseWasZero
0x11339e9:  testb  %al, %al
0x11339eb:  je     0x11339ff                 ; -[NSObject release] + 47
0x11339ed:  movl   995643(%edi), %eax
0x11339f3:  movl   %eax, 4(%esp)
0x11339f7:  movl   %esi, (%esp)
0x11339fa:  calll  0x113108c                 ; objc_msgSend
0x11339ff:  addl   $16, %esp                 ; This line was highlighted
0x1133a02:  popl   %esi
0x1133a03:  popl   %edi
0x1133a04:  popl   %ebp
0x1133a05:  ret

I have enabled Zombie Objects as suggested and here is the message before crash:

2013-10-07 17:07:23.113 Arendi[5783:c07] *** -[UIDeviceRGBColor release]: message sent to deallocated instance 0x8171e90
Olcay Ertaş
  • 5,987
  • 8
  • 76
  • 112
  • Do you have stack trace on the left side ? There should be a list of calls in order which leads to crash. Try to get into first one in your code. – Grzegorz Krukowski Oct 07 '13 at 13:27
  • @GrzegorzKrukowski I have added debug trace. But can not found anything helpful. – Olcay Ertaş Oct 07 '13 at 13:41
  • I have deleted all outlets and connections and disabled kayboard notification register and gesture recognizer for scrollview but it did not help. – Olcay Ertaş Oct 07 '13 at 13:43
  • It's crashing on [NSDictonary release] - maybe you are overreleasing this object and it's Zombie ? Click on 2 - [_NSDictonary dealloc] and see where it leads - paste us a function which is causing that. – Grzegorz Krukowski Oct 07 '13 at 13:49
  • @GrzegorzKrukowski I have added console output with Zombies Enabled, does it give you any idea? – Olcay Ertaş Oct 07 '13 at 14:15
  • You are overreleasing this UIDeviceRGBColor or you are using it after it's released. Where do you keep it as property ? Can you paste a code where you are using it (property + when you create it) ? I don't see it anywhere in your code. – Grzegorz Krukowski Oct 07 '13 at 14:28

4 Answers4

4

I have changed the UISwitch Thumb Tint color to default and problem solved. I hate Xcode! Thanks for all answers and tips.

Olcay Ertaş
  • 5,987
  • 8
  • 76
  • 112
  • had the same problem only the error mine was throwing was *** -[UIDeviceRGBColor set]: message sent to deallocated instance – rbertsch8 Nov 20 '13 at 23:47
0

Because you are using a NavigationController,
It should have been set automatically without any additional back button.

Perhaps, processing of backButtonClicked:sender(HMXNewPersonelStep2ViewController.m) are unnecessary.

h.usune
  • 933
  • 1
  • 7
  • 9
0

you have declared activeField as strong but using the property directly. may be its releasing your text fields prematurely. add @synthesize for it and try.

Tejesh Alimilli
  • 1,782
  • 1
  • 21
  • 31
0

When touch back geri button maybe you try to reach 2nd view object? Try to use AllExceptions and see. Or if you use internet connection like Asihttprequest, clear or cancel your instance delegate.

Merhaba kardeş, eğer 1.viewe döndüğünde 2. viewde birşeyler değişmeye çalışıyorsa bundan kaynaklanıyordur büyük ihtimalle. Asihttprequest kullanıp değişiklikleri serverea yazıyorsan ve daha bağlantı sonucu dönmeeden geriye basıyorsan bu çok normaldir.

mialkan
  • 342
  • 3
  • 7
  • No, I am not trying to do anything yet. All the interface is dumy. I had this error last week and could not solve. So I decidet to make it all from start to just test navigating back to first view. Kardeş aynı hatayı geçen hafta geliştirdiğim uygulamada aldım. Evelsi gün çalışan navigasyon birden bu hatayı vermeye başladı. Ne yaptıysam çözemedim. Ben de yedek alıp sildim bu iki ekranı yeniden yaptım. Bu gün yine çalışırken gene aynı hatayı almaya başladım. Problem ne bulamıyorum. – Olcay Ertaş Oct 07 '13 at 12:35
  • Can you upload the whole project? – mialkan Oct 08 '13 at 09:49