objective c - UIImageView Memory Allocation -
in 1 of classes, when view loads, random image (from list of 50 images) assigned of 24 uiimageviews (6 rows, 4 columns). however, when view loads around 3 times, app crashes due memory problems. i'm pretty sure allocation problem, don't know start...
this how went doing uiimages:
greenapple= [uiimage imagenamed: @"greenapple.png"]; redapple = [uiimage imagenamed: @"redapple.png"]; burger = [uiimage imagenamed: @"cheeseburger.png"]; fries = [uiimage imagenamed:@"fries.png"]; blackcookie = [uiimage imagenamed:@"blackcookie.png"]; whitecookie = [uiimage imagenamed:@"whitecookie.png"]; pizza = [uiimage imagenamed:@"pizza.png"]; orange = [uiimage imagenamed:@"orange.png"]; plyers = [uiimage imagenamed:@"plyers1.png"]; scissors = [uiimage imagenamed:@"scissors1.png"]; watch = [uiimage imagenamed:@"watch.png"]; clippers = [uiimage imagenamed:@"clippers1.png"]; ... etc
this how went image assignment uiimageviews:
int selection = (arc4random()%(50))+ 0; switch (choice) { ... case 15: [self.a1 setimage:redapple]; break; case 16: [self.a1 setimage:burger]; break; case 17: [self.a1 setimage:fries]; break; case 18: [self.a1 setimage:whitecookie]; break; case 19: [self.a1 setimage:blackcookie]; break; case 20: [self.a1 setimage:pizza]; break; case 21: [self.a1 setimage:orange]; break; case 22: [self.a1 setimage:plyers]; break; case 23: [self.a1 setimage:scissors]; break; case 24: [self.a1 setimage:watch]; break; case 25: [self.a1 setimage:clippers]; break; ... etc
a1 first of 24 uiimageviews...
it may of import know have button pushes modally refresh view , re-randomize uiimageviews' images...
objective-c memory uiimageview uiimage
No comments:
Post a Comment