0

I am new to iPhone SDK.

I am working with Tabbar based application.it has 5 tabs.named by

  • General
  • School
  • Work
  • Favorite
  • Contact.

In General tab: I am showing his basic info and about his/her family and friends picture(thumb picture,note that user can upload any number of friends and family photo).

In School tab: List of all that school where he/she studied.he/she can put a single photo(thumb picture) of his/her school.

In Work: It is same as school.

In Favorite: It shows all data (around 20 textfields).

In Contact: It also shows few textfields.

User can edit any tab also.

Now my question is i am playing with tab for 10 mins and after that it is crashing without any warning.It never gives my any kind of acknowledgement.

What should i do now?

Thanks In Advance !

Krunal
  • 6,440
  • 21
  • 91
  • 155
HML
  • 103
  • 1
  • 9
  • check this answer to get crash location. http://stackoverflow.com/questions/10612444/getting-crash-location-ios/10614106#10614106 – waheeda Jun 14 '12 at 05:09
  • Check this link : http://stackoverflow.com/questions/10876874/how-to-track-crash-in-ios5/10876899#10876899 – Naveen Thunga Jun 14 '12 at 05:32

1 Answers1

0

It would be because of memory issue. Release your objects in didReceiveMemoryWarning method instead of dealloc method. Reinitialize the data in viewDidLoad method. Ex:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        yesNoLabel = [[UILabel alloc] initWithFrame:CGRectMake(520, 580, 80, 36)];
        [yesNoLabel setFont:[UIFont boldSystemFontOfSize:14.0]];
        [self.view addSubview:yesNoLabel];
    }
    return self;
}

- (void)viewDidLoad
{ 
    [yesNoLabel setText:@"NO"];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    [yesNoLabel release];
}
Dee
  • 1,887
  • 19
  • 47
  • thank you Dee.it will help to me but one more question arise if i am uploading images in General Tab.at that time if didReceiveMemoryWarning called then all variable will release ,so will my application goes to crash? – HML Jun 14 '12 at 05:59
  • It may crash if it exceeds memory limit. Even I faced same kind of issue when I worked for some project. If you change your code like I said if will not crash frequently. – Dee Jun 14 '12 at 06:18