<>Update>
我将Zombies变成了......,并得出了这一错误:
*** -[CALayer retain]: message sent to deallocated instance 0x709d1a0
我的过错,对我没有任何意义。 http://www.un.org。 I m 在方案上设立多个州,并向它们分配行动( openMedia:
)。 这一行动有“开放式”行动。 一切都发挥了巨大作用,直到行动得到呼吁;行动是在新的窗口上展开的,但一旦停下来,就会坠毁。 我用不同的代码取代“开放式URL”法,它仍然坠毁......思想?
奥索尔没有错误,我获得<>EXC_BAD_ACCESS。 青少年说:
sharedlibrary apply-load-rules all
Current language: auto; currently objective-c
kill
quit
Program ended with exit code: 0
几天前,我一直在处理这个问题,我无法说出。 我的争.是巨大的,read似乎运转良好。 我不知道这在Stack Overflow是否合法,但我很乐意向大家支付帮助我解决这一问题的费用。 我的最后期限非常紧。
希望能帮助!
-(IBAction)showMedia:(id)sender {
NSLog(@"Media Button was pressed");
//Begin Alert
[SVProgressHUD showInView:self.view status:@"Loading..."];
mediaScroll.delegate = self;
mediaScroll.frame = CGRectMake(15, 60, 240, 185);
mediaScroll.clipsToBounds = YES;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.4];
statsBTN.frame = CGRectMake(272, 76, 48, 46);
donateBTN.frame = CGRectMake(272, 124, 48, 46);
shareBTN.frame = CGRectMake(272, 172, 48, 46);
mediaBTN.frame = CGRectMake(280, 220, 48, 46);
incViewPopUP.alpha = 0;
donViewPopUP.alpha = 0;
shareViewPopUP.alpha = 0;
mediaViewPopUP.alpha = 1;
[UIView commitAnimations];
[self loadMediaList];
[mediaBTN addTarget:self action:@selector(closePopUp:) forControlEvents:UIControlEventTouchUpInside];
}
-(void)loadMediaList {
[self.productPointers removeAllObjects];
NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"date_reported" ascending:NO] autorelease];
NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
NSArray *sortedArray = [finalMediaList sortedArrayUsingDescriptors:sortDescriptors];
NSLog(@"Sorted Media Array: %@", sortedArray);
if (mediaLoaded == NO) {
NSDictionary *mediaPost;
for (mediaPost in sortedArray) {
NSDictionary *inside = (NSDictionary *)[mediaPost valueForKey:@"media"];
NSLog(@"Inside Array: %@", inside);
UIButton *mediaView = [[UIButton buttonWithType:UIButtonTypeCustom] retain];
mediaView.frame = CGRectMake(0, (mx * 100), 225, 100);
mediaView.backgroundColor = [UIColor clearColor];
[mediaView addTarget:self action:@selector(openMedia:) forControlEvents:UIControlEventTouchUpInside];
mediaView.titleLabel.hidden = YES;
mediaView.titleLabel.alpha = 0;
mx++; NSLog(@"MX: %i", mx);
UILabel *mediaDesc = [[UILabel alloc] init];
mediaDesc.frame = CGRectMake(50, 20, 154, 40);
mediaDesc.backgroundColor = [UIColor clearColor];
mediaDesc.font = [UIFont fontWithName:@"Geogrotesque" size:12];
mediaDesc.textColor = UIColorFromRGB(0xc7c7c7);
mediaDesc.numberOfLines = 0;
mediaDesc.lineBreakMode = UILineBreakModeWordWrap;
mediaDesc.text = [inside valueForKey:@"description"];
UILabel *mediaType = [[UILabel alloc] init];
mediaType.frame = CGRectMake(50, 40, 154, 50);
mediaType.backgroundColor = [UIColor clearColor];
mediaType.font = [UIFont fontWithName:@"Geogrotesque" size:12];
mediaType.textColor = UIColorFromRGB(0xffffff);
mediaType.numberOfLines = 0;
mediaType.lineBreakMode = UILineBreakModeWordWrap;
mediaType.text = [[inside valueForKey:@"type"] uppercaseString];
UIImageView *mediaBorder = [[UIImageView alloc] initWithFrame:CGRectMake(0, 99.0, 220.0, 1.0)];
[mediaBorder setImage:[UIImage imageNamed:@"bottom_border.png"]];
UIImageView *mediaArrow = [[UIImageView alloc] initWithFrame:CGRectMake(214.0, 45.0, 6.0, 9.0)];
[mediaArrow setImage:[UIImage imageNamed:@"media_right_arrow.png"]];
if ([mediaType.text isEqualToString:@"VIDEO"]) {
UIImageView *mediaThumb = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 35.0, 30.0, 30.0)] autorelease];
[mediaThumb setImage:[UIImage imageNamed:@"media_play_icon.png"]];
[mediaView addSubview:mediaThumb];
[mediaThumb release];
[mediaView setTag:1];
[mediaView setTitle:[inside valueForKey:@"filename"] forState:UIControlStateNormal];
}
if ([mediaType.text isEqualToString:@"IMAGE"]) {
UIImageView *mediaThumb = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 35.0, 30.0, 22.0)] autorelease];
[mediaThumb setImage:[UIImage imageNamed:@"media_photo_icon.png"]];
[mediaView addSubview:mediaThumb];
[mediaThumb release];
[mediaView setTag:2];
[mediaView setTitle:[inside valueForKey:@"url"] forState:UIControlStateNormal];
}
[mediaView addSubview:mediaArrow];
[mediaView addSubview:mediaBorder];
[mediaView addSubview:mediaDesc];
[mediaView addSubview:mediaType];
[mediaScroll addSubview:mediaView];
[self.productPointers addObject:mediaView];
[mediaArrow release];
[mediaBorder release];
[mediaType release];
[mediaDesc release];
[mediaView release];
}
}
mediaLoaded = YES;
[mediaScroll setContentSize:CGSizeMake(225.0f, (mx * 100))];
//End Alert
[SVProgressHUD dismiss];
}
-(IBAction)openMedia:(id)sender {
NSLog(@"Media opened!");
NSString *tag = [NSString stringWithFormat:@"%d", [sender tag]];
NSLog(@"Tag: %@", tag);
videoID = [sender currentTitle];
NSString *videoURL = [[[NSString alloc] initWithFormat:@"http://www.vimeo.com/%@", videoID] autorelease];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:videoURL]];
NSLog(@"Video URL: %@", videoURL);
}