ios - Increased memory allocation when calling CGAffineTransformMakeRotation -



ios - Increased memory allocation when calling CGAffineTransformMakeRotation -

i have collection view layout set horizontal scrolling. each header section contains label needs rotated 90 degrees

- (uicollectionreusableview *)collectionview:(uicollectionview *)collectionview viewforsupplementaryelementofkind:(nsstring *)kind atindexpath:(nsindexpath *)indexpath { uicollectionreusableview *reusableview = nil; if (kind == uicollectionelementkindsectionheader) { collection *collection=self.collectionarray[indexpath.section]; uicollectionreusableview *headerview = [collectionview dequeuereusablesupplementaryviewofkind:uicollectionelementkindsectionheader withreuseidentifier:@"headerview" forindexpath:indexpath]; headerview.tag=indexpath.section; headerview.backgroundcolor=[settings getinstance].textcolor; uiimageview* expandview=(uiimageview*)[headerview viewwithtag:kexpandimage]; expandview.image=[uiimage imagenamed:[nsstring stringwithformat:@"expand_%@.png",[settings getinstance].appbrand]]; uilabel* label=(uilabel*)[headerview viewwithtag:kcollectionlabel]; label.text=[nsstring stringwithformat:@"%@",collection.name]; label.backgroundcolor=[settings getinstance].textcolor; label.textcolor=[settings getinstance].backcolor; label.font=[uifont fontwithname:@"helveticaneue-ultralight" size:50]; label.transform = cgaffinetransformmakerotation(-m_pi_2); cgrect frame=label.frame; frame.size.height=headerview.layer.frame.size.height; frame.origin.y=headerview.layer.frame.origin.y; label.frame=frame; //add tap gesture observe touch headertaprecognizer *singletaprecogniser = [[headertaprecognizer alloc] initwithtarget:self action:@selector(sectiontapped:)]; singletaprecogniser.sectionindexpath=indexpath; singletaprecogniser.delegate=self; singletaprecogniser.numberoftouchesrequired = 1; singletaprecogniser.numberoftapsrequired = 1; [headerview addgesturerecognizer:singletaprecogniser]; reusableview= headerview; } if (kind == uicollectionelementkindsectionfooter) { uicollectionreusableview *footerview = [collectionview dequeuereusablesupplementaryviewofkind:uicollectionelementkindsectionfooter withreuseidentifier:@"footerview" forindexpath:indexpath]; reusableview = footerview; } homecoming reusableview; }

when run through instruments, i'm getting increased memory allocation under gseventrunmodal. problem resolved taking out line of code

label.transform = cgaffinetransformmakerotation(-m_pi_2);

all examples i've seen utilize method rotate label unsure i'm going wrong.

any ideas welcome, thanks.

one thing seek applying transformation before add together text, background color, text color , font. way rotating empty label, subsequently filling it.

ios memory-leaks

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -